Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Importing Text into Access 1

Status
Not open for further replies.

BMDE

Programmer
Apr 4, 2006
11
0
0
Could someone share an example(s) of importing text into Access using Line Input? Its been awhile since I used it.


Thanks in advance.
 
Do you mean:
Code:
Dim rs As DAO.Recordset
'Table to accept input
Set rs = CurrentDb.OpenRecordset("tblTable1")
'File for input
Open CurrentProject.Path & "\imp.txt" For Input As #1
Do While Not EOF(1)
    'Get line
    Line Input #1, strString
    
    'Add line to table
    rs.AddNew
    rs!Field1 = strString
    rs.Update
Loop
Close #1
rs.Close
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top