I have the following connection string:
conn = "Provider=SQLNCLI; Server=" & conn_server &"; Database="& conn_database &"; UID="& conn_uid &"; PWD="& conn_pwd
And the code to open and run SP:
set conexao = server.CreateObject("ADODB.connection")
conexao.ConnectionString = conn
conexao.Open
set cmd = Server.CreateObject("ADODB.Command")
cmd.ActiveConnection = conexao
cmd.CommandText = "sp_login"
cmd.CommandType = adCmdStoredProc
cmd.Parameters.Append cmd.CreateParameter("@EMA_PES", adVarChar, adParamInput, 100, login)
cmd.Parameters.Append cmd.CreateParameter("@PSW_PES", adVarChar, adParamInput, 35, psw)
set Rs1 = Server.CreateObject("ADODB.RecordSet")
Rs1.CursorLocation = adUseClient
Rs1.CursorType = adOpenStatic
Rs1.Open cmd
session("id_pes") = Rs1("id")
Rs1.Close()
Set Rs1 = nothing
conexao.Close()
Set conexao = nothing
The problem occurs in the session("id_pes") = Rs1("id")
command. It says the item could not be found in the corresponding collection.
I've already checked and the command runs in the database.
When I change the connection string to use Driver = {SQL Native Client}
it works without problems.
Could anyone help me?