B
Bill Schanks
I am trying to import data into A SQL Server Database via an Access
Project (.adp).
Here is a sample of the data downloaded to a CSV File:
02 Jan 2007 ,"01","I","108123959780" ...
02 Jan 2007 ,"01","I","108123959780" ...
02 Jan 2007 ,"01","I","108123959780" ...
02 Jan 2007 ,"01","I","108123959780" ...
....
When I use this:
docmd.TransferText acImportDelim,,"CCYTrans","C:\550417596.csv"
It imports it properly, however it names the table userid.CCYTrans
regardless if I have that table setup or not. I need it to import into
dbo.ccytrans. So that doesn't work. If I name the table dbo.ccytrans
It names the table userid.dbo_ccytrans. An Access bug in my opionion.
I don't want to have users create tables and then move the records to
the real table.
So I tried this code:
-----
Sub sImportTesting()
Dim BookDate, BankCode, AcctType, AcctNum
Dim i As Integer
Const conFileName As String = "C:\550417596.csv"
Open conFileName For Input As #1
Do While Not EOF(1)
Input #1, BookDate, BankCode, AcctType, AcctNum
Debug.Print BookDate
Debug.Print BankCode
Debug.Print AcctType
Debug.Print AcctNum
i = i + 1
If i = 50 Then Exit Do
Loop
Close
End Sub
-----
But is splits the first column into two. Here is the debug window
output:
sImportTesting
2
Jan 2007
01
I
Any ideas on how to get this to work properly?
Project (.adp).
Here is a sample of the data downloaded to a CSV File:
02 Jan 2007 ,"01","I","108123959780" ...
02 Jan 2007 ,"01","I","108123959780" ...
02 Jan 2007 ,"01","I","108123959780" ...
02 Jan 2007 ,"01","I","108123959780" ...
....
When I use this:
docmd.TransferText acImportDelim,,"CCYTrans","C:\550417596.csv"
It imports it properly, however it names the table userid.CCYTrans
regardless if I have that table setup or not. I need it to import into
dbo.ccytrans. So that doesn't work. If I name the table dbo.ccytrans
It names the table userid.dbo_ccytrans. An Access bug in my opionion.
I don't want to have users create tables and then move the records to
the real table.
So I tried this code:
-----
Sub sImportTesting()
Dim BookDate, BankCode, AcctType, AcctNum
Dim i As Integer
Const conFileName As String = "C:\550417596.csv"
Open conFileName For Input As #1
Do While Not EOF(1)
Input #1, BookDate, BankCode, AcctType, AcctNum
Debug.Print BookDate
Debug.Print BankCode
Debug.Print AcctType
Debug.Print AcctNum
i = i + 1
If i = 50 Then Exit Do
Loop
Close
End Sub
-----
But is splits the first column into two. Here is the debug window
output:
sImportTesting
2
Jan 2007
01
I
Any ideas on how to get this to work properly?