Solved

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

Posted on 2004-10-07
8
789 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 142

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 142

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
 
LVL 142

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
Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

All XML, All the Time; More Fun MySQL Tidbits – Dynamically Generate XML via Stored Procedure in MySQL Extensible Markup Language (XML) and database systems, a marriage we are seeing more and more of.  So the topics of parsing and manipulating XM…
Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

708 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now