frustrating
Registered User.
- Local time
- Today, 08:07
- Joined
- Oct 18, 2012
- Messages
- 68
Greetings:
I am trying to import text line by line (it's html source code), but access imports it out of order if I use the import tool, so I am running code that will paste it line by line.
I have most of the code finished, but the text file i wish to import has apostrophes in it, which won't go into the tables. I'd like everything to be automated, is there any way this can be done? What I'm using now:
I am trying to import text line by line (it's html source code), but access imports it out of order if I use the import tool, so I am running code that will paste it line by line.
I have most of the code finished, but the text file i wish to import has apostrophes in it, which won't go into the tables. I'd like everything to be automated, is there any way this can be done? What I'm using now:
Code:
Dim i As Integer
Dim strPathAndFile As String
Dim strHold As String
Dim strSQL As String
strPathAndFile = "P:\test1.txt"
i = FreeFile
Open strPathAndFile For Input As #i
Do Until EOF(i)
Line Input #i, strHold
strSQL = "Insert INTO Master ([Field1]) Values ('" & Chr(34) & strHold & Chr(34) & "')"
CurrentDb.Execute strSQL, dbFailOnError
Loop
Close #i