Link to home
Start Free TrialLog in
Avatar of sgriffin
sgriffinFlag for Ireland

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
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

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?
Avatar of sgriffin

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
Hi Angel ,
tried that and unfortunately no joy :( get -1 again......

thanks!
ASKER CERTIFIED SOLUTION
Avatar of petoskey-001
petoskey-001

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Are you still having this problem?  Did you try the CursorLocation fix I suggested?