I am accessing an Access mdb file using the Database functions.
Calling NextDatabaseRow() after DatabaseQuery() works.
Calling FirstDatabaseRow() after DatabaseQuery() does not work, as FirstDatabaseRow() always returns 0 (no rows available) even though there are rows in the Query ("database").
FirstDatabaseRow()
-
TheFlyingDutchman
- New User

- Posts: 8
- Joined: Sun Jan 28, 2007 2:18 pm
- Location: USA
I've seen this before, although I haven't done enough database work with PB and ODBC to know the exact reason why.
Most examples I've seen stick to NextDatabaseRow() and seem to avoid FirstDatabaseRow(), so in a way, you've answered your own question!
Perhaps FirstDatabaseRow() is to be used before a query is submitted, i.e. between opening the database and submitting an SQL query etc.
Most examples I've seen stick to NextDatabaseRow() and seem to avoid FirstDatabaseRow(), so in a way, you've answered your own question!
Perhaps FirstDatabaseRow() is to be used before a query is submitted, i.e. between opening the database and submitting an SQL query etc.
I may look like a mule, but I'm not a complete ass.
I also encountered problems with FirstDatabaseRow() in a project when I wanted to first loop through all records to count them and then restart the loop.
I am not sure, but probably it has something to do with the type of query (table-only or join)? I remember that with VB and ADO you could also select a forward-only database cursor...
I am not sure, but probably it has something to do with the type of query (table-only or join)? I remember that with VB and ADO you could also select a forward-only database cursor...
As you walk on by, Will you call my name? Or will you walk away?

