 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Randal Ferguson Guest
|
Posted: Sun Jan 25, 2004 10:36 pm Post subject: ODBCExpress Question |
|
|
All,
Sorry for posting this here. I posted in the ODBCExpress newsgroup and
haven't gotten a response and my question may not be related to that product
in particular. I'm having a problem with a small program that reads an
Access Database and saves an image in an OLE field to a file. The following
is the code in question:
procedure Select();
var
Hstmt: THstmt;
Hdbc: THdbc;
begin
Hdbc := THdbc.Create(nil);
try
Hdbc.DataSource := 'AccessHandheld';
Hstmt := THstmt.Create(nil);
try
Hstmt.hDbc := Hdbc;
Hstmt.SQL := 'SELECT pic1 FROM TestPic';
Hstmt.Execute();
if Hstmt.FetchNext() then
begin
Hstmt.ColMemory[2].SaveToFile('Pic1.bmp');
end;
finally
Hstmt.Free();
end;
finally
Hdbc.Free();
end;
end;
The program bombs with an access violation on the ColMemory.Save method. Is
there something else I should be doing? I can open the table and view the
image in Access, it's a small bitmap. I'm new to Delphi so forgive my
ignorance.
Thanks,
Randal Ferguson
|
|
| Back to top |
|
 |
Randal Ferguson Guest
|
Posted: Mon Jan 26, 2004 7:05 pm Post subject: Re: ODBCExpress Question |
|
|
All,
I got it, thanks anyway.
Randal Ferguson
"Randal Ferguson" <rdfsoft (AT) cs (DOT) com> wrote
| Quote: | All,
Sorry for posting this here. I posted in the ODBCExpress newsgroup and
haven't gotten a response and my question may not be related to that
product
in particular. I'm having a problem with a small program that reads an
Access Database and saves an image in an OLE field to a file. The
following
is the code in question:
procedure Select();
var
Hstmt: THstmt;
Hdbc: THdbc;
begin
Hdbc := THdbc.Create(nil);
try
Hdbc.DataSource := 'AccessHandheld';
Hstmt := THstmt.Create(nil);
try
Hstmt.hDbc := Hdbc;
Hstmt.SQL := 'SELECT pic1 FROM TestPic';
Hstmt.Execute();
if Hstmt.FetchNext() then
begin
Hstmt.ColMemory[2].SaveToFile('Pic1.bmp');
end;
finally
Hstmt.Free();
end;
finally
Hdbc.Free();
end;
end;
The program bombs with an access violation on the ColMemory.Save method.
Is
there something else I should be doing? I can open the table and view the
image in Access, it's a small bitmap. I'm new to Delphi so forgive my
ignorance.
Thanks,
Randal Ferguson
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|