|
-
August 23rd, 1999, 03:47 PM
#1
ADO
Set rsTable = cnnConnection.OpenSchema(adSchemaTables)
While Not rsTable.EOF
lstrCommand = "select * from [" & rsTable("TABLE_NAME") & "]"
'Open one Table
rs.Open lstrCommand, cnnConnection, , , adCmdText
If Not rs.EOF And Not rs.BOF Then
call ProcessOneTable
end if
Wend
--->The problem is even if my table is empty(no records), but still
rs.EOF and rs.BOF returns False, and go to the CALL ProcessOneTable which
I don't want.
Thanks for help
-
August 24th, 1999, 07:55 AM
#2
Re: ADO
Maybe you forgot to move to the next record in your loop
i.e. :
While Not rsTable.EOF
...
rsTable.MoveNext
Wend
Tip : you can use this line to open your recordset
rs.Open rsTable("TABLE_NAME"), cnnConnection,,, adCmdTable
Marc
-
August 24th, 1999, 08:15 AM
#3
Re: ADO
Hi Marc,
I did have the rsTable.MoveNext
and the it loops thru all the tables fine,
but still it does not recognize an empty table
Thanks for your help
-
August 24th, 1999, 08:36 AM
#4
Re: ADO
Is it possible that something isn't closing your recordset object (rs) ?
Have you got more code than this going on somewhere (especially an 'On Error Resume Next' statement ) ?
Try doing an rs.close just before the Wend statement.
Chris Eastwood
CodeGuru - the website for developers
http://www.codeguru.com/vb
-
August 24th, 1999, 09:02 AM
#5
Re: ADO
I've made my code as simple as this, no Error Resume Next at all, but still....
While Not rsTable.EOF
rs.Open rsTable("TABLE_NAME"), cnnConnection, , , adCmdTable
If Not rs.EOF And Not rs.BOF Then
Kathy
End If
rs.Close
rsTable.MoveNext
Wend
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|