ObjRst & ObjConn

Code:

strSQL = "SELECT * FROM SEG_STUDENT WHERE (studentID = '" & StudID & "')"
objRst.open strSQL, objConn
Set objConn = Nothing
Code:

strSQL="Update Attempts SET Attempts = "& 3 &" WHERE (studentID = '" & Session("StudID") & "') AND (Paper ='"& Paper &"')"
objConn.Execute (strSQL)
objConn.Close

Or simply at every end of the asp page i do a ?

View Replies


ADVERTISEMENT

ObjRst.pagecount Returns -1 StoredProcedure

I'm writing an ASP page calling stored procedure from my database, in which I used Command Object. However, I can't get the pagecount or recordcount by the command: objRst.pagecount or objRst.recordcount since it returns -1, which, from the documentation, means these methods are not supported for some strange reason.
I'm thinking maybe it's becasue I used the Command Object with stored procedure. However, if I put my sql query into a string and then open it from a connection obj, the pagecout method would work fine.

The code is as follow:
====================
dim param
... ...
Set objConn = Server.CreateObject("ADODB.Connection")
Set objCmd = Server.CreateObject("ADODB.Command")
set objRst = Server.CreateObject("ADODB.RecordSet")

objConn.Open strLogin
objCmd.ActiveConnection = objConn
objCmd.CommandText = "test.my_procedure.method1"
objCmd.CommandType = 4

objCmd.Parameters.Append objCmd.CreateParameter("param", 200,1,50,param)
set objRst = objCmd.Execute
objRst.CursorLocation = adUseClient
'objRst.Source = objCmd [NOT SURE IF CORRECT, so cmt out, but doesn't affect my question]
objRst.CursorType = adOpenStatic
myrecordcount = objrst.PageCount [RETURNS -1 !! :confused: ]


======================================

View Replies View Related

SQL Connection Objconn Plz Tell Me How I Solve It?

I am trying to connect to an SQL database but I am getting an error saying
Server does not exist. I have not specified the Server it on because it is local
and I am not sure what I should put for the value of the Server property if I
do in fact have to have it.
Code:
var objConn, connStr
Set objConn = Server.CreateObject("ADODB.Connection") connStr = "DRIVER={SQL Server}; Database=OpenMSM; UID=sa; PWD=pass;"
objConn.Open(connStr)

View Replies View Related

Object Error After "objConn.execute(sql)"

after "objConn.execute(sql)" the page got error how can i show the error? there is an Object error?

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved