I've done this in C++ with Access and it is supported. I suspect it is quite
possible with Perl. Since you cannot represent, for example, gif images as
character string literal (not easily, anyway) you read your gif image from a
file into a string and then bind it to a "?" in your SQL statement. Have you
tried that?

I looked at the Win32::ODBC interface in the book "Programming the Perl DBI"
and I did not see a way to bind -- which is surprising. But you can
certainly do it, and it is recommended, with the DBI interface. Try it and
let us know the results.

Siegfried

-----Original Message-----
From: Chris Devers [mailto:[EMAIL PROTECTED] 
Sent: Friday, July 01, 2005 1:52 PM
To: Steve Gross
Cc: Perl Beginners List
Subject: Re: Microsoft Access storing images?

On Fri, 1 Jul 2005, Steve Gross wrote:

> Is there a resource for using Perl to save and extract images from a 
> Microsoft Access database?  I've looked in CPAN but I don't see 
> anything.

I'm not a Windows programmer and haven't used Perl with Access, so this 
won't be the answer you're looking for.

But, that said...

With MySQL and other databases, I've seen good arguments for *not* 
storing binary data such as images directly in a database. In many 
cases, it's much easier to store the images as regular files on your 
filesystem, and use the database to store references to those files.

So, for example, if you were building a web site that had a company 
phone book, you could have database fields for things like name, title, 
phone number, email, office location, etc, along with the filesystem 
path to a JPG image of that person. When the CGI script (or whatever) 
is called to present this person's page, it looks up the filesystem path 
as well, and converts that to a suitable <img src="..." /> tag. 

Depending on your application, this may or may not make sense, but it's 
worth considering, as it can make things much easier to manage. 


And with *that* said, if you do feel it's necessary to keep the data 
directly in Access, the same general techniques used for MySQL or any 
other database should, in general, still apply, provided that you're 
using the DBI database abstraction module. If you can't find anything 
specific on getting binary data into Access with Perl, you may be able 
to make use of instructions based on MySQL, PostgreSQL, Oracle, etc. 
 


-- 
Chris Devers

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to