Re: Load from file using asterisk as field delimiter
- From: "Dan Rock" <danno492_NOSPAM@xxxxxxxxxxx>
- Date: Wed, 31 Aug 2005 10:08:26 -0400
Below is my VBA code which imports the file.
The magic appears to be in the line :
DoCmd.TransferText acImportDelim, "spc823_ProductCatalog",
"tblB2B_823_TEMP", strFileName, False, ""
MS Access allows me to create an "Import Specification" where I can set up
the field delimiters, etc.
It simply grabs the text file and then imports the data into the temp table.
Takes about 10 seconds for the table to be populated.
By the way, I am using an Advantage Database server for my database.
Dim strFileName As String
strFileName = CurrentProject.Path & "\832.txt"
Dim db As Database
Dim rs As Recordset
Dim strTable As String
DoCmd.OpenForm "frmImportFTP"
CodeDb.Execute "delete * from tblB2B_823_TEMP"
DoCmd.TransferText acImportDelim, "spc823_ProductCatalog",
"tblB2B_823_TEMP", strFileName, False, ""
Set db = CodeDb
Set rs = db.OpenRecordset("MSysObjects", dbReadOnly)
With rs
.MoveFirst
Do Until .EOF
strTable = !Name
If Right(strTable, 12) = "ImportErrors" Then
DoCmd.DeleteObject acTable, strTable
End If
.MoveNext
Loop
.Close
End With
Set rs = Nothing
db.Close
Set db = Nothing
"Bill Todd" <no@xxxxxx> wrote in message
news:4315b0af@xxxxxxxxxxxxxxxxxxxxxxxxx
> What data access components are you using?
>
> Please post the code.
>
> --
> Bill Todd (TeamB)
.
- Follow-Ups:
- Re: Load from file using asterisk as field delimiter
- From: Guillem
- Re: Load from file using asterisk as field delimiter
- From: Bill Todd
- Re: Load from file using asterisk as field delimiter
- References:
- Load from file using asterisk as field delimiter
- From: Dan Rock
- Re: Load from file using asterisk as field delimiter
- From: Bill Todd
- Load from file using asterisk as field delimiter
- Prev by Date: Re: DBF tables
- Next by Date: Re: Load from file using asterisk as field delimiter
- Previous by thread: Re: Load from file using asterisk as field delimiter
- Next by thread: Re: Load from file using asterisk as field delimiter
- Index(es):
Relevant Pages
|