Information générale
Forum:
Microsoft SQL Server
Titre:
Calling stored proc via ADO from ASP
Hello everyone,
I am new to SQL Server & ASP so please allow me some slack if I get the terminology or acronyms wrong in places.
I am calling a parameterised stored procedure from an ASP page. The Stored procedure is returning the correct details in the recordset however the cursor type of the recordset is Forward-Only. Is there any way to get a Static cursor returned as we need to be able to navigate the recordset in reverse sequence in some circumstances?
The code being used is as follows:
Set test = Server.CreateObject("ADODB.Command")
lnRecsToReturn = 10
test.ActiveConnection = application("connstring")
test.CommandText = "Inv_Prod"
test.CommandType = adCmdStoredProc
test.Parameters.Append = test.CreateParameter("@SQLText",adVarWChar,adParamInput,len(vSQLText),vSQLText)
test.Parameters.Append = test.CreateParameter("@whse",adVarWChar,adParamInput,len(session("whse")),session("whse"))
test.Parameters.Append = test.CreateParameter("@StartPN",adVarWchar,adParamInput,len(lcStartPn),lcStartpN)
test.Parameters.Append = test.CreateParameter("@RecsToReturn",adInteger,adParamInput,,lnRecsToReturn)
Set VRS = Server.CreateObject("ADODB.Recordset")
VRS.Open test,,adOpenStatic, , adCmdStoredProc
The connection string to the SQL 7.0 server is as follows:
Application("ConnString") = "Provider=SQLOLEDB.1;User ID=sa;Password=testsa;Initial Catalog=Test;Data Source=TestBed"
TIA,
Andy
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement