🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.database.ado
3 messages
3 total messages Started by Paul Machiaverna Fri, 01 Dec 2000 15:25
ADO Express Problem
#5958
Author: Paul Machiaverna
Date: Fri, 01 Dec 2000 15:25
50 lines
2239 bytes
In testing the performance of Borland ADOExpress for C++ Builder 5, I wrote
a simple test application.

An ADO object point is declared:

TADOQuery* iptQuery;

After it is created and the connection to the database is made, the
following code is executed:

try
{
    // Perform the query.
    iptQuery->Close();
    iptQuery->SQL->Clear();
    iptQuery->SQL->Add( "SELECT KeyValue FROM TestRecord" );
    iptQuery->Prepared = true;
    iptQuery->Open();

    // While there are records to process,
    while ( !iptQuery->Eof )
    {
        // Get the data and display it.
        liData = iptQuery->FieldByName( "KeyValue" )->AsInteger;
        MemoDisplay->Lines->Add( IntToStr( liData ) );

        // Go to the next record.
        iptQuery->Next();
    }
}
catch( Exception& E )
{
    ShowMessage( E.Message );
}

// Close the query.
iptQuery->Close();


This all works fine until it hits the last line (iptQuery->Close()).  That's
when an exception is throw and it reports:

"Either BOF or EOF is True, or the current record has been deleted.
Requested operation requires a current record."

Why does this happen?  Is there a way to suppress this?  Since I just want
to simply close the query, I really don't want an exception thrown and
displayed.

Paul
Re: ADO Express Problem
#5964
Author: Ivan
Date: Sat, 02 Dec 2000 22:29
68 lines
2487 bytes
Hi Paul,

This is a bug of ADO Express.
There is a patch for ADO Express in CodeCentral  that fixses this one and
some other
bugs.

Ivan



"Paul Machiaverna" <machiave@i-stat.com> wrote in message
news:908fug$apf7@bornews.inprise.com...
> In testing the performance of Borland ADOExpress for C++ Builder 5, I
wrote
> a simple test application.
>
> An ADO object point is declared:
>
> TADOQuery* iptQuery;
>
> After it is created and the connection to the database is made, the
> following code is executed:
>
> try
> {
>     // Perform the query.
>     iptQuery->Close();
>     iptQuery->SQL->Clear();
>     iptQuery->SQL->Add( "SELECT KeyValue FROM TestRecord" );
>     iptQuery->Prepared = true;
>     iptQuery->Open();
>
>     // While there are records to process,
>     while ( !iptQuery->Eof )
>     {
>         // Get the data and display it.
>         liData = iptQuery->FieldByName( "KeyValue" )->AsInteger;
>         MemoDisplay->Lines->Add( IntToStr( liData ) );
>
>         // Go to the next record.
>         iptQuery->Next();
>     }
> }
> catch( Exception& E )
> {
>     ShowMessage( E.Message );
> }
>
> // Close the query.
> iptQuery->Close();
>
>
> This all works fine until it hits the last line (iptQuery->Close()).
That's
> when an exception is throw and it reports:
>
> "Either BOF or EOF is True, or the current record has been deleted.
> Requested operation requires a current record."
>
> Why does this happen?  Is there a way to suppress this?  Since I just want
> to simply close the query, I really don't want an exception thrown and
> displayed.
>
> Paul
>
>
>
Re: ADO Express Problem
#5965
Author: Paul Machiaverna
Date: Mon, 04 Dec 2000 14:48
78 lines
2934 bytes
Ivan:
CodeCentral is in a limited access mode until tomorrow.  I'll check it out
then.
Thanks, Paul

"Ivan" <iradev@mail.vega.bg> wrote in message
news:90bt0q$a317@bornews.inprise.com...
> Hi Paul,
>
> This is a bug of ADO Express.
> There is a patch for ADO Express in CodeCentral  that fixses this one and
> some other
> bugs.
>
> Ivan
>
>
>
> "Paul Machiaverna" <machiave@i-stat.com> wrote in message
> news:908fug$apf7@bornews.inprise.com...
> > In testing the performance of Borland ADOExpress for C++ Builder 5, I
> wrote
> > a simple test application.
> >
> > An ADO object point is declared:
> >
> > TADOQuery* iptQuery;
> >
> > After it is created and the connection to the database is made, the
> > following code is executed:
> >
> > try
> > {
> >     // Perform the query.
> >     iptQuery->Close();
> >     iptQuery->SQL->Clear();
> >     iptQuery->SQL->Add( "SELECT KeyValue FROM TestRecord" );
> >     iptQuery->Prepared = true;
> >     iptQuery->Open();
> >
> >     // While there are records to process,
> >     while ( !iptQuery->Eof )
> >     {
> >         // Get the data and display it.
> >         liData = iptQuery->FieldByName( "KeyValue" )->AsInteger;
> >         MemoDisplay->Lines->Add( IntToStr( liData ) );
> >
> >         // Go to the next record.
> >         iptQuery->Next();
> >     }
> > }
> > catch( Exception& E )
> > {
> >     ShowMessage( E.Message );
> > }
> >
> > // Close the query.
> > iptQuery->Close();
> >
> >
> > This all works fine until it hits the last line (iptQuery->Close()).
> That's
> > when an exception is throw and it reports:
> >
> > "Either BOF or EOF is True, or the current record has been deleted.
> > Requested operation requires a current record."
> >
> > Why does this happen?  Is there a way to suppress this?  Since I just
want
> > to simply close the query, I really don't want an exception thrown and
> > displayed.
> >
> > Paul
> >
> >
> >
>
>
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads