Board index » delphi » Ado and Lookup Fields

Ado and Lookup Fields


2004-07-29 05:46:43 PM
delphi237
Hi,
I have a AdoDataset where I have created a lookup field which looks to a
AdoTable.
When I insert a row to AdoDataset the Keyfield of the lookup is null at the
beginning, and
appears the message
"Project test.exe raised exception Class EOleException with message 'An
unknown error has occured'. Process stopped. Use step or run to continue."
But this only happens if I run the program from Delphi, and not when I
execute the exe from disk.
Insteed when on AfterInsert I initialized the Keyfield it works fine.
Does it means that null is not allowed to keyfield, or there is something
else?
Thanks.
Any
 
 

Re:Ado and Lookup Fields

I was wrong it doesn't work on AfterPost, and the problem is that I don't
know where to initialize this, if this is the only way which I hope not.
"Penny" <XXXX@XXXXX.COM>writes
Quote
Hi,

I have a AdoDataset where I have created a lookup field which looks to a
AdoTable.
When I insert a row to AdoDataset the Keyfield of the lookup is null at
the
beginning, and
appears the message

"Project test.exe raised exception Class EOleException with message 'An
unknown error has occured'. Process stopped. Use step or run to continue."

But this only happens if I run the program from Delphi, and not when I
execute the exe from disk.

Insteed when on AfterInsert I initialized the Keyfield it works fine.

Does it means that null is not allowed to keyfield, or there is something
else?


Thanks.
Any


 

Re:Ado and Lookup Fields

Penny,
It's a handled exception inside Delphi's ADO components (ADODB.pas?). Try
setting the lookup field's LookupCache = True and/or for more information
search on the error at
www.fulltextsearch.com/
Good luck,
krf
"Penny" <XXXX@XXXXX.COM>writes
Quote
Hi,

I have a AdoDataset where I have created a lookup field which looks to a
AdoTable.
When I insert a row to AdoDataset the Keyfield of the lookup is null at
the
beginning, and
appears the message

"Project test.exe raised exception Class EOleException with message 'An
unknown error has occured'. Process stopped. Use step or run to continue."

But this only happens if I run the program from Delphi, and not when I
execute the exe from disk.

Insteed when on AfterInsert I initialized the Keyfield it works fine.

Does it means that null is not allowed to keyfield, or there is something
else?


Thanks.
Any