Automate import .csv into table

G

Greg Clements

everyone,

i have an Access 2000 database that has to get
information from an Excel 2000.csv file and place the
information into a table i have already created from that
same file for future updates, i need this to be automated
by clicking a command button, i tried the
Transferspreadsheet method but come up with the error
code, External table is not in expected format, here is
the code i am using from the form with the command button:

DoCmd.TransferSpreadsheet acImport, "ADPAdjust",
Me.txtFileName, True, Me.txtworksheetname,
acSpreadsheetTypeExcel8

me.txtfilename is an unbound textbox that has the path
and file name since it will change by date every time it
is run, and Me.txtworksheetname is the name of the
worksheet.

any help would be great as i need to get this automated
ASAP, doing it manually it works fine by going to File,
import,etc...

thanks!!

Greg Clements
 
K

Ken Snell

Use TransferText to import a .csv file ... a .csv file is not an EXCEL
file, it's a text file.
 
G

Guest

i followed the basic instructions in the database help
file and created the following code:

DoCmd.TransferText acImportDelim, "UshdXXXX Import
Specification", "ADPAdjust", Me.txtFileName, True

when i run the code i come up with a runtime error 3027:
cannot update database or object is read only.

niether the file or the table has been set to read only.

still need a little help here.
 
K

Ken Snell

Guessing that there is something about the Me.txtFileName string value that
ACCESS doesn't like.

What does that string look like?
 
G

Guest

it was the file ext not being present in the box that it
didn't like after i changed that it is all good thanks
for the Help!!

Greg
-----Original Message-----
Guessing that there is something about the
Me.txtFileName string value that
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top