import text file

Results 1 to 2 of 2

Thread: import text file

  1. #1
    Join Date
    Dec 1969

    Default import text file

    How can I import a delimited text file into access database using my ado connection with asp, sql statements

  2. #2
    Join Date
    Dec 1969

    Default RE: import text file

    You could try something like:<BR>set db=currentdb()<BR>stSQL = "INSERT INTO tblNewData (Field1, Field2, ....)" & _<BR>"SELECT Field1 , Field2.... & _<BR>"FROM [" & stFileName & "] IN &#039;&#039;[Text; DATABASE=" & stPathName & "] WHERE (( some criteria if you need it???));"<BR><BR>db.Execute stSQL<BR><BR>Where Field1 etc are the field names, stFile name is your Comma deliminated Text File.<BR><BR>You will probably need to create a file to set the import field names<BR><BR>There are quite a few articles on the MS KnowledgeBase regarding Schema.ini files and importing text but it does sometimes take a bit of playing around to get it right.<BR><BR>Doug

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts