Print Thread
Lookup fields
#688 07/13/00 10:30 AM
Joined: Jul 2000
Posts: 3
Lexington, KY, USA
H
hawscs Offline OP
Member
OP Offline
Member
H
Joined: Jul 2000
Posts: 3
Lexington, KY, USA
I have the trial version of 3.3.3, BCB5 Pro, and Oracle 8.1.6 standard.
I'm having trouble with lookup fields. With BDE datasets, I would just add a new field in the fields editor, hook it up to the lookup dataset & be done. However, that isn't working here. I'm mostly quite impressed with the product's speed & flexibility, but if I can't use lookup fields I'm gonna have a serious problem. (Lookup combo boxes do work fine, but I need this in a few grids so I have to do it this way.)
So, any ideas? Anybody got any workarounds?
Is it related to being a trial version? Being a BCB port? (I also had trouble using cached updates - it couldn't link in the OracleSession::ApplyUpdates method even though it compiled correctly. I figured this was a BCB issue because the Delphi code has smarter arrays & doesn't need the extra param to specify length.) Curiously enough, it seems to work in the IDE; if I open up the table with the lookup field, then I see the correct name from the lookup dataset in the grid. But when I run my app, I get an empty cell in the grid.
Help! Quickly, or I may have to abandon the product so I can get something rolled out soon!

Re: Lookup fields
#689 07/14/00 04:17 PM
Joined: Aug 1999
Posts: 22,206
Member
Offline
Member
Joined: Aug 1999
Posts: 22,206
If your lookup fields work at design time, it should also work at run time, unless you manipulate the related datasets a run time in such a way that this affects the lookup fields. Maybe the datasets are closed or opened at run time, maybe you use variables and need to refresh a dataset at some point? If this doesn't help, just send me a small demo project to reproduce the problem.

The TOracleSession->ApplyUpdates function works the same as the TDatabase->ApplyUpdates function (except for the extra Commit parameter). Open array constructors that are used in Delphi can also be used in C++Builder by using the OPENARRAY macro. The following Delphi and C++Builder syntax is equivalent:
[quote]
Code
MainSession.ApplyUpdates([ds1, ds2], True);

MainSession->ApplyUpdates(OPENARRAY(TDataSet *, (ds1, ds2)), true);
[/quote]
Note that the OPENARRAY macro defines both the DataSets and DataSets_Size parameters that you see in the function definition.



------------------
Marco Kalter
Allround Automations


Marco Kalter
Allround Automations
Re: Lookup fields
#690 07/14/00 10:38 PM
Joined: Jul 2000
Posts: 3
Lexington, KY, USA
H
hawscs Offline OP
Member
OP Offline
Member
H
Joined: Jul 2000
Posts: 3
Lexington, KY, USA
I do indeed open & close datasets & use variables frequently at runtime, and I expect that's the problem.
I didn't see anything in the help file that mentioned an extra step to reconnect the lookup fields. I'm sure that's it, so what do I do about it?
(And, in fact, now that you mention it, some other fields seem to get disconnected too - I've had to use DataSet->FieldByName instead of the variables that I had already generated on the form. But the workaround was obvious & I didn't bother mentioning it.)

Hmm, I'm not sure if that accounts for it. See, it compiled correctly but then wouldn't link. I didn't use OPENARRAY, though.

Thanks for your help... you're making a lot of sense, but I still don't have it working.


[This message has been edited by hawscs (edited 14 July 2000).]

[This message has been edited by hawscs (edited 14 July 2000).]


Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.071s Queries: 13 (0.018s) Memory: 2.5045 MB (Peak: 3.0393 MB) Data Comp: Off Server Time: 2024-04-29 18:34:40 UTC
Valid HTML 5 and Valid CSS