Insert file

  • Thread starter Thread starter Darius Blaszijk
  • Start date Start date
D

Darius Blaszijk

Hello,

I want to insert a file into a MS access DB. What type of field should I
use, and what kind of syntax for the insert query should I use. I'm
programming in VBscript.

Kind regards, Darius Blaszijk
 
Dear Darius:

I cannot tell what you mean to do. What does it mean, "insert a file
into a MS access DB?" The database typically IS a file.

Is this file perhaps a text file with one line for each row of data
represented? Access has some built in capacities to do this. You may
be better off stepping out of VBScript to do this job, perhaps setting
up the job in Access and initiating it from a VB program.

Tom Ellison
Microsoft Access MVP
Ellison Enterprises - Your One Stop IT Experts
 
What I mean is that I have a string representing the path to a file (any
file). And I want to store this file in the database. Later I can extract
the file to any location I want. Normally one would use a blob to store
binary information, but MS Access doe not know this type. Further I have no
idea of what INSERT query to use. I guess some sort of stream should be
created to stream data into the DB, but how??

Kind regards, Darius Blaszijk
 
Dear Darius:

As best I understand, you want to store the entire contents of a file
in one column of one row in your database.

Access has no blob datatype. If your file can be of any significant
length, there is no datatype that can handle it.

Depending on how you must handle the data from within the database, it
may be sufficient to place the path and file name in a text column in
the database and then access the contents of the file when needed.

Tom Ellison
Microsoft Access MVP
Ellison Enterprises - Your One Stop IT Experts
 
GUESS GUESS GUESS

Never have used it, but you might look at OLE Object as a place to store your
data.
 
Back
Top