Board index » delphi » ADO 2.5 and Access 2000 problem

ADO 2.5 and Access 2000 problem

Hi!

I'm having some strange problem when trying to use Access 2000 Database with
ADO 2.5 on Windows 2000 Proffesional.
I've dropped TADOConnection and TADOQuery components on the form and set
their properties. When I opened the ADOQuery it worked fine, it even showed
data in the grid. But when I tried to close my query (ADOQuery.Close) I get
this {*word*193} Access Violation exception. I don't even know where to start
looking for some error, since Close is method of TADOQuery component.

Using Delphi5, Access2000 DB, ADO 2.5 in Win2000 Pro

If anyone has already experienced the same problem, please let me know. Any
help would be greatly appreciated.

TIA

regards

 

Re:ADO 2.5 and Access 2000 problem


I sometimes received that error message too, but I don't know where the
mistake was (maybe there's no mistake at all :)), so just put the code:

try
    Close;
except
end;

When you're closing the query,{*word*222}the mistake.

- JC

Quote
"Jure Bogataj" <jure.boga...@cis.si> wrote in message

news:3ade98d1_1@dnews...
Quote
> Hi!

> I'm having some strange problem when trying to use Access 2000 Database
with
> ADO 2.5 on Windows 2000 Proffesional.
> I've dropped TADOConnection and TADOQuery components on the form and set
> their properties. When I opened the ADOQuery it worked fine, it even
showed
> data in the grid. But when I tried to close my query (ADOQuery.Close) I
get
> this {*word*193} Access Violation exception. I don't even know where to start
> looking for some error, since Close is method of TADOQuery component.

> Using Delphi5, Access2000 DB, ADO 2.5 in Win2000 Pro

> If anyone has already experienced the same problem, please let me know.
Any
> help would be greatly appreciated.

> TIA

> regards

Re:ADO 2.5 and Access 2000 problem


Hi

I was experiencing exceptions in instances like this

   while not myQuery.EOF do
   begin
      ...
   end ;

   myQuery.Close ; // <-- exception would be thrown here.

I got around this by calling .First before the close (hoping that the query
had results!)

I hunted round the Borland site and found a patch available for ADO Express
that fixes this access violation. This is aimed at users of MDAC 2.6.
I applied it to my install, and the exceptions I encountered magically went
away...

Regarards

Vince Bartlett

Quote
"John Cheung" <johnche...@e{*word*277}.com> wrote in message

news:3adfb0af_2@dnews...
Quote
> I sometimes received that error message too, but I don't know where the
> mistake was (maybe there's no mistake at all :)), so just put the code:

> try
>     Close;
> except
> end;

> When you're closing the query,{*word*222}the mistake.

> - JC

> "Jure Bogataj" <jure.boga...@cis.si> wrote in message
> news:3ade98d1_1@dnews...
> > Hi!

> > I'm having some strange problem when trying to use Access 2000 Database
> with
> > ADO 2.5 on Windows 2000 Proffesional.
> > I've dropped TADOConnection and TADOQuery components on the form and set
> > their properties. When I opened the ADOQuery it worked fine, it even
> showed
> > data in the grid. But when I tried to close my query (ADOQuery.Close) I
> get
> > this {*word*193} Access Violation exception. I don't even know where to start
> > looking for some error, since Close is method of TADOQuery component.

> > Using Delphi5, Access2000 DB, ADO 2.5 in Win2000 Pro

> > If anyone has already experienced the same problem, please let me know.
> Any
> > help would be greatly appreciated.

> > TIA

> > regards

Re:ADO 2.5 and Access 2000 problem


Quote
> I got around this by calling .First before the close (hoping that the
query
> had results!)

I've thought of the same solution then, but if the recordset has no records,
it throws exception anyway, because it can't position itself to the first
record.

Quote

> I hunted round the Borland site and found a patch available for ADO
Express
> that fixes this access violation. This is aimed at users of MDAC 2.6.
> I applied it to my install, and the exceptions I encountered magically
went
> away...

that helped

Thanks!

Re:ADO 2.5 and Access 2000 problem


Thank you both!

Other Threads