General information
Forum:
Microsoft SQL Server
Title:
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
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only