sgriffin
asked on
Using rs.RecordCount - Get -1 ( minus one) value everytime.....
Hi , im using ASP with VBScript and Mysql
I didnt have a problem when the db was MS access but now have started using it with MySQL..
This is Code for record set...
rs.CursorType = 3
rs.Open strSCat, strConn
rc = rs.RecordCount
response.write rc
Rc value giving me "-1" every time....
Have tried using
rs.Open strSCat, strConn,3,3
rc = rs.RecordCount
response.write rc
but get
2 (This is the value which is correct!)
Microsoft Cursor Engine error '80004005'
Key column information is insufficient or incorrect. Too many rows were affected by update.
/category.asp, line 73
any ideas?
Cheers
Stephen
I didnt have a problem when the db was MS access but now have started using it with MySQL..
This is Code for record set...
rs.CursorType = 3
rs.Open strSCat, strConn
rc = rs.RecordCount
response.write rc
Rc value giving me "-1" every time....
Have tried using
rs.Open strSCat, strConn,3,3
rc = rs.RecordCount
response.write rc
but get
2 (This is the value which is correct!)
Microsoft Cursor Engine error '80004005'
Key column information is insufficient or incorrect. Too many rows were affected by update.
/category.asp, line 73
any ideas?
Cheers
Stephen
Do you have an index/primary key on the MySQL version of the table?
I have seen this also with Primary key defined on datatype where ADO/DAO could not work on correctly (ie .Oracle Timestamp column). What is the table's definition?
ASKER
Yes , theres a primary key defined...
Anyhow, this should work better:
rs.Open strSCat, strConn,1,3
or this:
rs.CursorType = 1
rs.LockType = 3
rs.Open strSCat, strConn
rc = rs.RecordCount
response.write rc
CHeers
rs.Open strSCat, strConn,1,3
or this:
rs.CursorType = 1
rs.LockType = 3
rs.Open strSCat, strConn
rc = rs.RecordCount
response.write rc
CHeers
ASKER
Hi Angel ,
tried that and unfortunately no joy :( get -1 again......
thanks!
tried that and unfortunately no joy :( get -1 again......
thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Are you still having this problem? Did you try the CursorLocation fix I suggested?