Automate import .csv into table

  • Thread starter Thread starter Greg Clements
  • Start date Start date
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
 
Use TransferText to import a .csv file ... a .csv file is not an EXCEL
file, it's a text file.
 
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.
 
Guessing that there is something about the Me.txtFileName string value that
ACCESS doesn't like.

What does that string look like?
 
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
 
Back
Top