Using PreviousDatabaseRow()

Just starting out? Need help? Post your questions and find answers here.
TerryHough
Enthusiast
Enthusiast
Posts: 781
Joined: Fri Apr 25, 2003 6:51 pm
Location: NC, USA
Contact:

Using PreviousDatabaseRow()

Post by TerryHough »

Still learning how to use the database features of PB.

Every effort to use PreviousDatabaseRow() returns a value of 0 rather
than positioning back to the previous row.

Code snip..

Code: Select all

    Case #NextButton
      Num = NextDatabaseRow()  
      If Num
        NextRecord()  ; procedure to handle the record
      Else
        DisableGadget(#NextButton,1)
      EndIf     
    Case #PrevButton
      Num = PreviousDatabaseRow()
      If Num
        PrevRecord() ; procedure to handle the record
      Else
        DisableGadget(#PrevButton,1)
      EndIf     
While NextDatabaseRow() works perfectly, the PreviousDatabaseRow()
always returns a value of 0 even though there should be numerous
previous rows to back up through.

Has anybody experienced this? Any suggestions?

Thanks,
Terry
User avatar
GedB
Addict
Addict
Posts: 1313
Joined: Fri May 16, 2003 3:47 pm
Location: England
Contact:

Post by GedB »

I think this may be to do with the ODBC driver.

Backwards scrolling is not supported by all ODBC drivers.
When Scrolling Is Supported
As originally designed, SQL provided only forward scrolling, but ODBC extends scrolling capabilities. The available level of support for scrolling depends on the ODBC driver(s) your application will work with, your driver's ODBC API conformance level, and whether the ODBC Cursor Library is loaded into memory.

http://msdn.microsoft.com/library/defau ... DBC.29.asp
I've tried to find if there is a way to find out what is supported by which drivers, but I've had no luck.
TerryHough
Enthusiast
Enthusiast
Posts: 781
Joined: Fri Apr 25, 2003 6:51 pm
Location: NC, USA
Contact:

Post by TerryHough »

Thanks for the quick reply GedB.

Drat... this is frustrating... apparently just what Microsoft intended!

Appreciate the information.

Terry
User avatar
GedB
Addict
Addict
Posts: 1313
Joined: Fri May 16, 2003 3:47 pm
Location: England
Contact:

Post by GedB »

Terry,

You might find updating to the latest ODBC drivers will help.

Problem with this is you can't be sure how things will work out on a clients machine.

Your probably best of copying the results into memory if you need to move backwards and forwards.
Post Reply