Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why Recordcount equal to 0?

Status
Not open for further replies.

joseprez

Vendor
Sep 7, 2002
19
PA
I have the follow line in my code:

Set SN = DB.OpenRecordset("SELECT * FROM Sales WHERE ID LIKE " & ID_Temp, dbOpenSnapshot)

When Table Sales have 1 record, SN.Recordcount return 0 and my application send error 3021.

How solve this?
 
The way you have it set up now the 'Like' might as well be an '='. You will need to use some wildcard characters if you want to get the most out of the keyword 'Like'.

The wildcard character may depend on the database you are using so check the help files for examples. Thanks and Good Luck!

zemp
 
Change you key type Please remember to give helpful posts the stars they deserve!
This makes the post more visible to others in need!
 
I'm not 100% sure but are you saying that the real record count is 1 but when u use .recordcount it returns 0?????


I have seen that before When it happened to me i used .movelast then .recordcount and it returned the true record count


Or am i barking up the wrong tree

Killa
 
With error 3021 there are no records in the recordset. rs.movefirst will throw that error. Thanks and Good Luck!

zemp
 
try changing the cursor location to useClient:

SN.cursorLocation = adUserClient

i think this may well be your problem

hope that helps

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top