Re: Load from file using asterisk as field delimiter



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)


.



Relevant Pages

  • Re: Shared functions vs Non-Shared Functions
    ... > dim context as HttpContext = HttpContext.Current ... Imports Microsoft.VisualBasic ... Public Shared sub sendEmail ... >> dim webMasterEmail As String ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Importing text, etc. on remote .mdb file
    ... You can then use VBA string functions to get from there to the ... Is there an easy way to schedule the imports of the text files so I ... 'Modify strSQL and filenames as required ... Dim oJet 'DAO.DBEngine ...
    (microsoft.public.access.externaldata)
  • RE: Logon Error
    ... > Imports CrystalDecisions.CrystalReports ... > function is emailPDFwhich calls ChangeLogOnInfo EmailPDF returns a Report ... > Dim szErrorMailSecondary As String 'This is where all the mail messages ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: .net remoting vs SQL Server
    ... The connection to the database will only exist as long as the method runs. ... Imports System.Runtime.Remoting ... Public Function ConnectionString() As String ... Dim oCmd As SqlCommand = New SqlCommand ...
    (microsoft.public.dotnet.framework.remoting)
  • Help with VBA code to Copy / Paste Visio sheet to another Visio fi
    ... I have pieced together some VBA code from prior postings in Visio.general ... Set srcPage = pagsObj.Item ... Dim iObjCnt As Integer ... Dim strPageName As String ...
    (microsoft.public.visio.developer.vba)