Solved

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

Posted on 2004-10-07
8
802 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 
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 125 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: 12259692
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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

Foreword In the years since this article was written, numerous hacking attacks have targeted password-protected web sites.  The storage of client passwords has become a subject of much discussion, some of it useful and some of it misguided.  Of cou…
As a database administrator, you may need to audit your table(s) to determine whether the data types are optimal for your real-world data needs.  This Article is intended to be a resource for such a task. Preface The other day, I was involved …
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

756 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