.docmd.transfertext via vb
Posted on 2005-03-10
I am using VB 6 and referencing MS Access to transfer a text file into a table.
below is a section of code i am using:
Dim ACObject As Access.Application
Set ACObject = CreateObject("Access.Application")
.OpenCurrentDatabase filepath:="" & App.Path & "\some_db.mdb "
.DoCmd.TransferText acImportDelim, "ReaderSpec", "Hierarchy-20050310", strFilename, True
i have never used the .docmd.transfertext..... and i am not sure what i need to specify in each of the fields.
i get an error message that states : Runtime error 3625....The text file specification 'ReaderSpec' does not exist . You can not import,export or link using the specification.
What is the correct syntax to use?
ok, in the specification area where i have 'ReaderSpec' . I have placed an empty string in its place (""), now i get an error (runtime 2391) that says my field names do not exist in the destination table.
I have all the field names in the table. I am not sure why i get this error.