Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 9 of 9 total
Thread Error when using RecordSet.BOF VB6
Wed, Sep 20 2006 5:32 AMPermanent Link

Deneys
Hi There,

Please could you advise,

There seems to be a bug when using the odbc drivers when calling the
BOF Procedure. (EOF works fine) this always happens on large record sets

1.VB6
2.Win XP

=============================================================

'Reference "Microsoft DAO 3.6 Object Library"
'Note Record Count is 4938

Public RecSet As Recordset
Public DB As Database
Public WS As Workspace

Private Sub Form_Load()
  Set WS = CreateWorkspace("", "", "", dbUseODBC)
  Set DB = WS.OpenDatabase("Smart Charts", False, True, "ODBC;dsn=Smart
Charts;TablePassword1=greenmoney;")
End Sub


Private Sub Command1_Click()

  Dim sDate As String
  On Error GoTo ErrHndl
  
  Set RecSet = DB.OpenRecordset("SELECT * FROM PriceData WHERE sName = 'ABSA'",
dbOpenDynaset, dbExecDirect, dbOptimisticValue)
  
  'THIS WORKS FINE
  RecSet.MoveFirst
  Do Until RecSet.EOF
     sDate = RecSet("sDate")
     RecSet.MoveNext
  Loop
  
  'THIS GIVES ERRORS
  RecSet.MoveLast
  Do Until RecSet.BOF
     sDate = RecSet("sDate")
     RecSet.MovePrevious
  Loop
  
  
Exit Sub
ErrHndl:
'ERROR ON RECORD 37
MsgBox "Error " & RecSet.AbsolutePosition

End Sub

===========================================================



Thanking you,
Deneys
Wed, Sep 20 2006 5:53 AMPermanent Link

Deneys
 OOps this works fine the post above but when you rem out
  
  'THIS WORKS FINE
'   RecSet.MoveFirst
'   Do Until RecSet.EOF
'      sDate = RecSet("sDate")
'      RecSet.MoveNext
'   Loop
  

Then it gives ther error

This is a tricky one

Please help
Wed, Sep 20 2006 4:40 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Deneys,

<< There seems to be a bug when using the odbc drivers when calling the BOF
Procedure. (EOF works fine) this always happens on large record sets >>

What is the error message that you're getting and what version of the DBISAM
ODBC driver are you using ?

--
Tim Young
Elevate Software
www.elevatesoft.com

Thu, Sep 21 2006 3:45 AMPermanent Link

Deneys
"Tim Young [Elevate Software]" <timyoung@elevatesoft.com> wrote:

Deneys,

<< There seems to be a bug when using the odbc drivers when calling the BOF
Procedure. (EOF works fine) this always happens on large record sets >>

What is the error message that you're getting and what version of the DBISAM
ODBC driver are you using ?

--
Tim Young
Elevate Software
www.elevatesoft.com

------------------------------------------------------------------------------------------

Tim Young,


It does not give any errors but it does return "RecSet("sDate")" as Null when I use BOF
thats why I had to use
a "On Error GoTo ErrHndl". I have checked the Database for blank entries and there are'nt
any.When I REM out the
BOF loop and UnREM the EOF loop then all works fine.

I have found a work around which is first looping through the database and then doing my
Loop back BOF but to me
this is just not the right way of doing things

Version = 4.24.0.1 ODBC

Please find attached my Test application

Thanking you,
Deneys De Beer











Attachments: TEST.ZIP
Thu, Sep 21 2006 8:06 AMPermanent Link

Chris Holland

SEC Solutions Ltd.

Avatar

Team Elevate Team Elevate

Hi Deneys,

There is a file missing from the project that you have zipped up:

Form=C:\Program Files\Microsoft Visual Studio\VB98\Form1.frm

Chris Holland


Deneys wrote:
> "Tim Young [Elevate Software]" <timyoung@elevatesoft.com> wrote:
>
> Deneys,
>
> << There seems to be a bug when using the odbc drivers when calling the BOF
> Procedure. (EOF works fine) this always happens on large record sets >>
>
> What is the error message that you're getting and what version of the DBISAM
> ODBC driver are you using ?
>
Thu, Sep 21 2006 9:52 AMPermanent Link

Deneys
Chris Holland <mail@chrisholland.me.uk> wrote:

Hi Deneys,

There is a file missing from the project that you have zipped up:

Form=C:\Program Files\Microsoft Visual Studio\VB98\Form1.frm

Chris Holland


Deneys wrote:
> "Tim Young [Elevate Software]" <timyoung@elevatesoft.com> wrote:
>
> Deneys,
>
> << There seems to be a bug when using the odbc drivers when calling the BOF
> Procedure. (EOF works fine) this always happens on large record sets >>
>
> What is the error message that you're getting and what version of the DBISAM
> ODBC driver are you using ?
>


-------------------------------------------------------------------------------------------

Sorry about that here is the full project


Thanking you
Deneys





Attachments: NewTest.zip
Thu, Sep 21 2006 1:19 PMPermanent Link

Chris Holland

SEC Solutions Ltd.

Avatar

Team Elevate Team Elevate

Hi Deneys,

It is a strange problem but I am not sure that it is a BOF problem.

If you comment out the line:

sDate = RecSet.Fields("sDate").Value

It runs to the end, with no error.

Chris Holland

Deneys wrote:
> Chris Holland <mail@chrisholland.me.uk> wrote:
>
> Hi Deneys,
>
> There is a file missing from the project that you have zipped up:
>
> Form=C:\Program Files\Microsoft Visual Studio\VB98\Form1.frm
>
> Chris Holland
>
>
> Deneys wrote:
>> "Tim Young [Elevate Software]" <timyoung@elevatesoft.com> wrote:
>>
>> Deneys,
>>
>> << There seems to be a bug when using the odbc drivers when calling the BOF
>> Procedure. (EOF works fine) this always happens on large record sets >>
>>
>> What is the error message that you're getting and what version of the DBISAM
>> ODBC driver are you using ?
>>
>
>
> -------------------------------------------------------------------------------------------
>
> Sorry about that here is the full project
>
>
> Thanking you
> Deneys
>
>
>
>
Thu, Sep 21 2006 3:52 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Deneys,

<< Please find attached my Test application >>

Please don't post attachments in this newsgroup.  There is a Binaries
newsgroup for this purpose.

--
Tim Young
Elevate Software
www.elevatesoft.com


Thu, Sep 21 2006 5:32 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Deneys,

There is a bug in the prior functionality when using a large rowset size (VB
6 uses 100 rows as the default).  If you send me your customer information
via private email, I can at least send you a fixed version of the driver
that will alleviate this problem.

--
Tim Young
Elevate Software
www.elevatesoft.com

Image