Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
aakash.agarwal
Starting Member
2 Posts |
Posted - 2008-01-03 : 07:30:32
|
HiI am trying to get a recordset using ADODB with SQL Server2005 but i am getting a record count as -1.although when i am trying to run the same query with the SQL manager directly it is working fine and i can get the records i wanted.can anyone help me on thisthanks in advance |
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2008-01-03 : 07:42:25
|
Record count of -1 does not mean records are not being fetched. Correctness of RecordCount property depends upon the CursorType of the recordset.Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-01-03 : 08:03:13
|
quote: Originally posted by aakash.agarwal HiI am trying to get a recordset using ADODB with SQL Server2005 but i am getting a record count as -1.although when i am trying to run the same query with the SQL manager directly it is working fine and i can get the records i wanted.can anyone help me on thisthanks in advance
If you use Server side cursor, then dont use recordcount properly instead see if Rs.EOF is true/false. If it is true then there are no recordsMadhivananFailing to plan is Planning to fail |
|
|
aakash.agarwal
Starting Member
2 Posts |
Posted - 2008-01-03 : 13:08:16
|
Sorry that was my mistake yes it is giving EOF and BOF as true |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-01-04 : 07:34:19
|
quote: Originally posted by aakash.agarwal Sorry that was my mistake yes it is giving EOF and BOF as true
It means your query doesnt give any dataMadhivananFailing to plan is Planning to fail |
|
|
|
|
|