We use Delphi V and assoc mydac-
We have a variable normally accessible as a pointer which is initialized with a getmem(ptr,size) line of code. We modify the pointer referenced contents and now want to store the referenced contents in a text column in on-line data base. can I use the putcolumndata method with the ptr as datasource like
putcolumndata(fieldname,1,ptr)
or if not, can I typecast pointer as Pchar and use
putcolumndata(fieldname,1,Pchar(ptr))?Thanks,
Jennifer good
putrcolumndata with pointer
Try:
1: Convert the data to a string
2: Use TMyquery to store it:
with MyQuery do begin
Append; // or Edit if its an update.
FieldByName('theField').asstring := TheNewString;
Post;
end
1: Convert the data to a string
2: Use TMyquery to store it:
with MyQuery do begin
Append; // or Edit if its an update.
FieldByName('theField').asstring := TheNewString;
Post;
end
Last edited by kaffeburk on Wed 22 Jun 2011 18:28, edited 2 times in total.
-
AndreyZ
You can use the following code:
Code: Select all
PutColumnData(fieldname, 1, string(PChar(ptr)));