Re: Function to return dataset record
- From: "Benson Wong" <benson@xxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 5 Jun 2006 17:22:52 +0800
Sorry, wrong post. It should be on language newsgroup.
"Benson Wong" <benson@xxxxxxxxxxxxxxxxxxxxx> ׫??ì¶à]¼þÐÂÂ?
:4483f57a@xxxxxxxxxxxxxxxxxxxxxxxxx
I know how to write simple function to return string, integer, booleantype.
But how to write a function to return a control, eg. TTable?
My problem is:
- Given a tablename, a key field and its value
- select data from the database
- return the Dataset records (which may be more than 1)
- Something like this:
function ReturnDatasetRecord(Tablename, KeyFieldName, KeyFieldValue):
TDataset
begin
s:='select * from '+Tablename+' where
'+KeyFieldName+'='+quotedstr(KeyFieldValue);
try
Query:=TQuery.create(nil);
Query.sql.text:=s;
Query.open;
result:=Query; //????????????
finally
Freeandnil(Query);
end;
.
- References:
- Function to return dataset record
- From: Benson Wong
- Function to return dataset record
- Prev by Date: Function to return dataset record
- Next by Date: Re: Request For Reviewers
- Previous by thread: Function to return dataset record
- Next by thread: Re: Function to return dataset record
- Index(es):
Relevant Pages
|
|