calenger
07-20-2005, 02:14 PM
Hi and thanks for reading.
I am attempting to create a routine that will import a comma delimted text file into an exsisting access 2000 table. I have tried the transfertext method but running into a problem with data type mismatch because some fields are number and some are date/time. I understand that there is a way to call an existing import format. but not sure if that is the answer?
what i have so far.
Dim objAccess
Dim strPathToMDB
Dim sTable
Dim sFilePath
Const acImportDelim = 0
strPathToMDB = "C:\Jay_1\Cdscdrtest.mdb"
sFilePath = "C:\Jay_1\200507201632.txt"
sTable = "x_Acct_op"
Set objAccess = CreateObject("Access.Application.9")
objAccess.OpenCurrentDatabase(strPathToMDB)
objAccess.DoCmd.TransferText, acImportDelim,,sTable,sFilePath,True
Set objAccess = Nothing
I am attempting to create a routine that will import a comma delimted text file into an exsisting access 2000 table. I have tried the transfertext method but running into a problem with data type mismatch because some fields are number and some are date/time. I understand that there is a way to call an existing import format. but not sure if that is the answer?
what i have so far.
Dim objAccess
Dim strPathToMDB
Dim sTable
Dim sFilePath
Const acImportDelim = 0
strPathToMDB = "C:\Jay_1\Cdscdrtest.mdb"
sFilePath = "C:\Jay_1\200507201632.txt"
sTable = "x_Acct_op"
Set objAccess = CreateObject("Access.Application.9")
objAccess.OpenCurrentDatabase(strPathToMDB)
objAccess.DoCmd.TransferText, acImportDelim,,sTable,sFilePath,True
Set objAccess = Nothing