ilanm
asked on
updating an access database table from a textfile
i'm trying to write a function that will open a text file for reading, then read the file line by line and put it into an existing table- graph. i am trying first just to read the lines and past it into one of the table's fields without deviding it to fields.
i wrote:
Private Sub load_Click()
Dim dbss As Database
Set dbss = OpenDatabase("db3") 'db3 is my dbase name
Dim textline As String
Open "a:movefile.txt" For Input As #1
Do While Not EOF(1)
Line Input #1, textline
dbss.TableDefs("graph").Fi elds("num" ) = textline
Loop
Close #1
End Sub
the thing is it doesn't work.
the textline format in the file is:
:spo2= (3 digits number) pr= (3 digits number) no probe
if you can please tell me also how to read the file so i can imidiatly past the 3 digits numbers in to diffrent fields in table graph i would give you a very high score.
thank you my saviour.
i wrote:
Private Sub load_Click()
Dim dbss As Database
Set dbss = OpenDatabase("db3") 'db3 is my dbase name
Dim textline As String
Open "a:movefile.txt" For Input As #1
Do While Not EOF(1)
Line Input #1, textline
dbss.TableDefs("graph").Fi
Loop
Close #1
End Sub
the thing is it doesn't work.
the textline format in the file is:
:spo2= (3 digits number) pr= (3 digits number) no probe
if you can please tell me also how to read the file so i can imidiatly past the 3 digits numbers in to diffrent fields in table graph i would give you a very high score.
thank you my saviour.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER