Re: Is it possible to Change String Delimiter without using an interface Spec?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Thanks John,

Thanks also for the assistance you provided on my previous query relating to
transfertext. I had been looking at numerous highly complicated methods and
your suggestion was far simpler.

Andi

"John Nurick" <j.mapson.nurick@xxxxxxxxxxxxxx> wrote in message
news:uFi5SKH5FHA.3192@xxxxxxxxxxxxxxxxxxxxxxx
> Hi Andi,
>
> If you want to use TransferText the only way to specify a non-standard
> delimiter is by using an import specification or a schema.ini file.
>
> Probably the best thing to do is to include code in your routine to handle
> it, e.g.
> - create the appropriate schema.ini, then use TransferText, then delete
the
> schema.ini
> or
> - read the file a line at a time, parsing each line into fields and
> appending the resulting record to the table
>
>
> "Andibevan" <Andibevan@xxxxxxxxxxxxxxxxxxxx> wrote in message
> news:u$CNGAF5FHA.3136@xxxxxxxxxxxxxxxxxxxxxxx
> > Hi All,
> >
> > I have build the following simple function to import data into a table
but
> > the data has a ' as the string delimiter. Is there any way I can
specify
> > the string delimiter without using an interface spec?
> >
> > I want to be able to distribute just the code on its own to keep it as
> > simple as possible for the users.
> >
> > Thanks
> >
> > Andi
> >
> > Function fncBatchImport(strSRCpath As String, strTableName As String) As
> > Boolean
> > Dim strSRCdir As String, strSRCfile As String
> > 'Reference the library Microsoft ActiveX Data Objects 2.1 (or higher).
> > On Local Error GoTo ImportError
> > 'DoCmd.Hourglass True
> >
> > DoCmd.TransferText acImportDelim, , strTableName, strSRCpath, True
> > ImportEnd:
> > 'DoCmd.Hourglass False
> > fncBatchImport = tableExists(strTableName)
> > Exit Function
> >
> > ImportError:
> > MsgBox Err.Description
> > ' DoCmd.Hourglass False
> > End Function
> >
> >
>
>


.



Relevant Pages

  • Is it possible to Change String Delimiter without using an interface Spec?
    ... the data has a ' as the string delimiter. ... Dim strSRCdir As String, strSRCfile As String ... On Local Error GoTo ImportError ...
    (microsoft.public.access.externaldata)
  • RE: TransferText(FileName)
    ... The File_Name_Directory is a string, so you can build it with variables. ... See AlsoApplies ToExampleSpecificsThe TransferText method carries out the ... Only acImportDelim, acImportFixed, acExportDelim, acExportFixed, or ... SpecificationName Optional Variant. ...
    (microsoft.public.access.macros)
  • RE: TransferText from a table with a selection-parameter
    ... The TransferText() method doesn't have a parameter for "selective records." ... Public Sub TransferTextWParam(sDataSrc As String, sFldName As String, ... Dim sqlStmt As String ...
    (microsoft.public.access.modulesdaovba)
  • Re: Help with transferspreadsheet
    ... TransferText will only let you import files whose extensions are .txt., ... Dim strPathFile As String, strFile As String, strPath As String, ... Dim strTable As String ...
    (microsoft.public.access.externaldata)
  • RE: TransferText from a table with a selection-parameter
    ... how can i get TransferText to handle this one accordingly? ... > Public Sub TransferTextWParam(sDataSrc As String, sFldName As String, ... > Dim sqlStmt As String ...
    (microsoft.public.access.modulesdaovba)