Subject | Re: [IBO] TIB_Cursor Education Needed |
---|---|
Author | Daniel Rail |
Post date | 2003-05-26T21:37:16Z |
Hi,
At May 26, 2003, 17:27, kumasoftllc wrote:
HMSDataModule.ReadOnlyTransaction.StartTransaction;
cBox.Items.Clear;
cBox.ItemValues.Clear;
with myCursor do
begin
if not Prepared then
Prepare;
Open;
while not Eof do
begin
cBox.Items.Add(myCursor.FieldByName('myCode').AsString);
cBox.ItemValues.Add(myCursor.FieldByName('myKey').AsString);
APINext;
end;
Close;
end;
HMSDataModule.ReadOnlyTransaction.Commit;
That is how I have my code, and it works for me.
--
Best regards,
Daniel Rail
Senior System Engineer
ACCRA Group Inc. (www.accra.ca)
ACCRA Med Software Inc. (www.filopto.com)
At May 26, 2003, 17:27, kumasoftllc wrote:
> I am attempting to use tib_cursor to populate the Items andTry it this way:
> ItemValues of a TIB_ComboBox. Using some sample code from one of the
> Tech Info Sheets I tried the following in the FormCreate event:
> HMSDataModule.ReadOnlyTransaction.StartTransaction;
> cBox.Items.Clear;
> cBox.ItemValues.Clear;
> with myCursor do
> begin
> First;
> while not Eof do
> begin
> cBox.Items.Add(myCursor.FieldByName('myCode').AsString);
> cBox.ItemValues.Add(myCursor.FieldByName('myKey').AsString);
> Next;
> end;
> Close;
> end;
> HMSDataModule.ReadOnlyTransaction.Commit;
HMSDataModule.ReadOnlyTransaction.StartTransaction;
cBox.Items.Clear;
cBox.ItemValues.Clear;
with myCursor do
begin
if not Prepared then
Prepare;
Open;
while not Eof do
begin
cBox.Items.Add(myCursor.FieldByName('myCode').AsString);
cBox.ItemValues.Add(myCursor.FieldByName('myKey').AsString);
APINext;
end;
Close;
end;
HMSDataModule.ReadOnlyTransaction.Commit;
That is how I have my code, and it works for me.
--
Best regards,
Daniel Rail
Senior System Engineer
ACCRA Group Inc. (www.accra.ca)
ACCRA Med Software Inc. (www.filopto.com)