Recordcount

jaji2000
12-18-2003, 05:18 PM
Why doesn't this work????

'Checks to see if data in MakeTable
strSQL = "SELECT * from [T_Audit_MakeTable]"
recMakeTable.Open strSQL, cnnRetDtbse, adOpenDynamic, adLockOptimistic

If recMakeTable.RecordCount < 1 Then
Beep
MsgBox "No records available for the selected month.", vbOKOnly
Screen.MousePointer = vbDefault '
Unload Me
Exit Sub
End If

'''I keep getting a -1 for recordcount even though I know that the table has records. No matter what I've tried, I get -1.....WHY??? :huh:

Please help....Thanks :D

couch612
12-18-2003, 05:21 PM
use one of the move methods to move to the end of the recordset before calling the recordcount property.

MikeJ
12-18-2003, 05:27 PM
Set the connection to use adUseClient for the CursorLocation property before you open the connection and the RecordCount property should work properly.

reboot
12-18-2003, 07:40 PM
If recMakeTable.BOF And recMakeTable.EOF Then

Is the more proper way to check for an empty recordset.

jaji2000
12-19-2003, 08:08 AM
Thanks for all of your help!!! Merry Christmas to all!!!!

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum