reading text files

  • Thread starter Thread starter John Smith
  • Start date Start date
J

John Smith

Hi All,

Haven't been around here in a long time, need some help, I need to read a
text file into an access table, character by character using code. Anyone
any suggestions?

Help gratefuly accepted

Mark
 
Thanks Jason, the link is more relevant to VB than Access, maybe I should
explain further

My problem is I
need to be able to open a file on a pc/s on the network, read the data
character by character, check to see if a certain character is present, if
it is, update the database and continue reading the file until it comes
across the character again, updates the database and so on . . . .

Anybody got any suggestions, all help gratefuly received!!
 
I strongly disagree. I used this code in Access and it works just fine
and dandy.

Private Sub cmdInput_Click()
Const MY_FILE = "z:\temp\test.txt"
Dim strIn As String, i As Integer

Open MY_FILE For Input As #1
Do While Not EOF(1)
Input #1, strIn
For i = 1 To Len(strIn)
' do your checks on the character here
Debug.Print Mid(strIn, i, 1)
Next i
Loop
Close #1
End Sub
 
I am a muppet! Thanks for your help Jason


Jason Lepack said:
I strongly disagree. I used this code in Access and it works just fine
and dandy.

Private Sub cmdInput_Click()
Const MY_FILE = "z:\temp\test.txt"
Dim strIn As String, i As Integer

Open MY_FILE For Input As #1
Do While Not EOF(1)
Input #1, strIn
For i = 1 To Len(strIn)
' do your checks on the character here
Debug.Print Mid(strIn, i, 1)
Next i
Loop
Close #1
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top