Link to home
Start Free TrialLog in
Avatar of ilanm
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").Fields("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.
ASKER CERTIFIED SOLUTION
Avatar of gissing
gissing

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ilanm
ilanm

ASKER

i don't know if it works but this is the first time someone actualy submits a code to his answer.