Marius0188
asked on
Delphi 7 : Lookup Field?
Hi Experts,
I have an TDBGrid and would like the use to be able to pick from a dropdown in the list.
For example:
Table1:
ColorID INT PK
ColorCode VARCHAR(10)
Description VARCHAR(100)
Table2:
VehicleID INT PK
ColorID INT
RegNumber VARCHAR(20)
When inserting a new row in the DBGrid for Table2, I would like to user to be able to select from dropdown in grid from all the available colorcodes and after selecting the ColorID should be saved in this table.
I managed to get what I am looking by means of creating a new lookup field on my ADOTable Component for Table2. But when inserting a new row I receive the following error:
"raised exception class EOleException with message 'An unkown error has occurred.' Process stopped...."
Please advise.
I have an TDBGrid and would like the use to be able to pick from a dropdown in the list.
For example:
Table1:
ColorID INT PK
ColorCode VARCHAR(10)
Description VARCHAR(100)
Table2:
VehicleID INT PK
ColorID INT
RegNumber VARCHAR(20)
When inserting a new row in the DBGrid for Table2, I would like to user to be able to select from dropdown in grid from all the available colorcodes and after selecting the ColorID should be saved in this table.
I managed to get what I am looking by means of creating a new lookup field on my ADOTable Component for Table2. But when inserting a new row I receive the following error:
"raised exception class EOleException with message 'An unkown error has occurred.' Process stopped...."
Please advise.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I have build a demo app using Firebird database and Interbase components.
I have created a lookup table exactly as I have done with the ADO table components and it is WORKING here.
I guess there is something else about the TADOTable component.
Let me see if I can provide you with a demo.
Cheers
I have created a lookup table exactly as I have done with the ADO table components and it is WORKING here.
I guess there is something else about the TADOTable component.
Let me see if I can provide you with a demo.
Cheers
ASKER
Ok I have produced a demo for you:
http://www.medalware.com/demo_lookup.zip
Just connect both TIBDatabase & TADOConnection components to the databasis that is in a subfolder.
1 x Firebird DB
1 x MS SQL MDF DB
The firebird is working 100%.
The SQL db is giving me that nasty exception.
Thanks in advance!
http://www.medalware.com/demo_lookup.zip
Just connect both TIBDatabase & TADOConnection components to the databasis that is in a subfolder.
1 x Firebird DB
1 x MS SQL MDF DB
The firebird is working 100%.
The SQL db is giving me that nasty exception.
Thanks in advance!
ASKER
It looks like a bug in ADO.
http://qc.codegear.com/wc/qcmain.aspx?d=46248
Is there any work arounds?
Where can I get the latest Delphi 7 updates?
Thanks!
http://qc.codegear.com/wc/qcmain.aspx?d=46248
Is there any work arounds?
Where can I get the latest Delphi 7 updates?
Thanks!
ASKER
Can one connect to SQL 2005 db without using ADO components?
Is there any other good alternative components or methods one can try?
Is there any other good alternative components or methods one can try?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Yes I do have that update.
But if I remember correctly, when installing that update it prompt to notify me about missing files where after I just clicked ignore. Maybe it has something to do with that.
Mmmmh, I wonder if I can just update the ADO dcu's etc by getting them from you.
Will that not work?
But if I remember correctly, when installing that update it prompt to notify me about missing files where after I just clicked ignore. Maybe it has something to do with that.
Mmmmh, I wonder if I can just update the ADO dcu's etc by getting them from you.
Will that not work?
Much cleaner to get your intall to work correctly, but worth a shot I guess.
Would back up before attempting.
Here you go.
http://www.logancontracting.com.au/ado/ado.zip
Would back up before attempting.
Here you go.
http://www.logancontracting.com.au/ado/ado.zip
ASKER
Nope, still not working.
Are you also using Delphi 7 Enterprise?
Are you also using Delphi 7 Enterprise?
Delphi 7 pro. I would have thought the ado stuff would have been the same. But I could be wrong.
Not sure how else I can help you...
Not sure how else I can help you...
ASKER
You don't think it might be the TDBGrid component?
Maybe you must sent me your source and let me try that.
Maybe you must sent me your source and let me try that.
I still think getting your install correct would be a better way to go. But again,
Here you go.
http://www.logancontracting.com.au/ado/dbgrids.zip
Here you go.
http://www.logancontracting.com.au/ado/dbgrids.zip
ASKER
Yip, after this one I will go for re-install and then apply that 7.1 update.
But need a quick fix because installing all my components from start takes 1-2 days.
Enjoy
But need a quick fix because installing all my components from start takes 1-2 days.
Enjoy
ASKER
Ok but another thing is:
It is only in the compiler (IDE) that I get the exception EOleException.
When running outside the IDE no problem.
Should I still be worried?
It is only in the compiler (IDE) that I get the exception EOleException.
When running outside the IDE no problem.
Should I still be worried?
ASKER
Ok I will accept that this might be an installation problem.
Have not tested yet but will try to re-install as soon as I have time available.
Lets split the points....
Thanks to all!
Have not tested yet but will try to re-install as soon as I have time available.
Lets split the points....
Thanks to all!
ASKER
http://www.medalware.com/delphi_lookup.JPG
I use a normal TDBGrid and TADOTable components.
Thanks!