Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Using rs.RecordCount - Get -1 ( minus one) value everytime.....

Posted on 2004-10-07
8
Medium Priority
?
809 Views
Last Modified: 2008-02-01
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
0
Comment
Question by:sgriffin
  • 3
  • 3
  • 2
8 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 12248903
Do you have an index/primary key on the MySQL version of the table?
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 12248911
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?
0
 
LVL 2

Author Comment

by:sgriffin
ID: 12248926
Yes , theres a primary key defined...

0
Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 12249157
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
0
 
LVL 2

Author Comment

by:sgriffin
ID: 12249431
Hi Angel ,
tried that and unfortunately no joy :( get -1 again......

thanks!
0
 
LVL 7

Accepted Solution

by:
petoskey-001 earned 250 total points
ID: 12259682

are you using CursorLocation = adUseClient??

rs.CursorLocation = adUseClient

ADO will always return -1 when CursorLocation is set to adUseServer
0
 
LVL 7

Expert Comment

by:petoskey-001
ID: 12350014
Are you still having this problem?  Did you try the CursorLocation fix I suggested?
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this blog post, we’ll look at how using thread_statistics can cause high memory usage.
In this article, we’ll look at how to deploy ProxySQL.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses
Course of the Month8 days, 21 hours left to enroll

877 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question