I am using TADODataSet
(D7).
I do not create constant fields in design mode using a DataSet.
dsItems.CommandText := 'select ID, ItemName, UserIDCreate from Items'; dsUsers.CommandText := 'select ID, LoginName from Users'; // lookup dataset
If I double-click on dsItems
and "Add all files", and then click "New Submission" and define the search field, everything works fine. The resulting dsItems
should contain: ID, ItemName, UserIDCreate, LoginName_Lookup
How can I avoid doing all this during development and add a search box after / or earlier (? Not sure) that the DataSet is opening.
In other words: How can I emulate βAdd all filesβ and then βNew fileβ to add a search loaded at runtime?
Note: I get an exception when running John code from the IDE. An exception occurs when trying to open a DataSet: EOleException with message 'An unknown error has occured'
.
function TCustomADODataSet.LocateRecord (ADODB.pas)
in line if FieldCount = 1 then FLookupCursor.Find...
I accept the answer because the executed program is working.
It would be nice if someone could check the receipt (or not) of the Exception when running the form inside the IDE.
source share