Results 1 to 2 of 2

Thread: Text Delimiters

  1. #1

    Thread Starter
    Fanatic Member Gary.Lowe's Avatar
    Join Date
    May 2000
    Location
    In my sphere of influence
    Posts
    621
    Hi All

    I am using ADO to open a text file into a recordset
    Code:
        Dim cn As ADODB.Connection
        Dim rs As ADODB.Recordset
    
        Set cn = New ADODB.Connection
        Set rs = New ADODB.Recordset
        
        'open connection to folder that contains the file
        cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\;Extended Properties=Text;"
        
        'open the file
        rs.Open "select * from test.txt", cn
    This works fine on a file where the delimiter is a comma i.e.
    0,23,"Hello"

    But if the dilimiter is a semi-colon it doesn't work i.e.
    0:23:"Hello"

    Does anyone know if you can specify the delimiter in the connection or recordset object

    Thanks
    Gary Lowe
    VB6 (Enterprise) SP5
    ADO 2.6
    SQL Server 7 SP3

    OK I know my spelling and grammer is crap so don't quote me on it!

    To err is human to take the P! is only natural !!

    Click on the top section of image for Marcus Miller website and bottom section of image for 'Run For Cover' sound clip


  2. #2
    Lively Member
    Join Date
    Aug 1999
    Location
    Blackpool, England
    Posts
    87
    Gary,

    If You use the ODBC text driver I think you can specify the delimeter in a file which must be called schema.ini and this file has to be located in the same directory as the source text file.
    I'll try and dig out some code.
    Ta
    SteveFlit
    Also at ANKER

Posting Permissions

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



Click Here to Expand Forum to Full Width