Solved

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

Posted on 2004-10-07
8
796 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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MySQL left join performance 4 38
selecting date modified field from a table 2 44
category table 2 24
change database name 2 28
Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikipedia.org/wiki/PHP  Very powerful.  But a…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

808 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