d2g
Programmer
- Apr 10, 2005
- 32
Hello, I'm sure this is a simple one.. Ive done alot with record sets but we are rewriting some code to make it more efficient and we are replacing our old code with single SQL Update statments.
In this following example how would I determine if a record was updated or not. Using ASP
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open "DSN=SOMEDSN"
oConn.CursorLocation = 3
strSQL = "UPDATE testtable SET TESTVAR = 'testentry' where PKID = 12"
oConn.Execute strSQL
I have tried using a variable called sqlselected, setting it to 0 before the execute, then using
oConn.Execute strSQL, sqlselected
then the sqlselected variable i thought would give me the number of rows updated, however its still returning 0 even though it is updating the record in the database.
I know PHP has some built in functions for mysql to show affected rows, but im trying to do this in asp
thanks
D2
In this following example how would I determine if a record was updated or not. Using ASP
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open "DSN=SOMEDSN"
oConn.CursorLocation = 3
strSQL = "UPDATE testtable SET TESTVAR = 'testentry' where PKID = 12"
oConn.Execute strSQL
I have tried using a variable called sqlselected, setting it to 0 before the execute, then using
oConn.Execute strSQL, sqlselected
then the sqlselected variable i thought would give me the number of rows updated, however its still returning 0 even though it is updating the record in the database.
I know PHP has some built in functions for mysql to show affected rows, but im trying to do this in asp
thanks
D2