Connecting to a Text file

Results 1 to 3 of 3

Thread: Connecting to a Text file

  1. #1
    Troy Guest

    Default Connecting to a Text file

    I want to connect to a textfile containing test results and be able to display the results in a textbox for editing. Can this be done? What would be my DSN-less connection string? Can I refer to the recordset as rs fields the way we do it with recordset from a database?<BR><BR>Thanks for all your inputs.

  2. #2
    Troy Guest

    Default RE: Connecting to a Text file

    The file format looks like this:<BR>unit1 2 4 4 5 1 0 1 N 12 23 21 213<BR>unit2 0 1 2 3 4 5 6 L 21 23 21 456

  3. #3
    Join Date
    Dec 1969

    Default Use a DSN is best...

    ...because when you use a DSN you can specify that space is your delimiter. By default, you would need a comma as a delimiter.<BR><BR>Just bring up the ODBC or ODBC32 item in the control panel, add a new System DSN, specify the text file driver and the *directory* where the file is. Click on "Define Format", choose the actual file, choose space as the delimiter, and then click "Guess" to see what the system comes up with for column names and types. (Click on each column name, in turn, to see the data type it chose...modify it if you need to.) This tool is *very* smart and makes it easy to then use the named DSN in your ADO code.<BR><BR>If you don&#039;t do this, then you probably need to--at a minimum--use commas instead of spaces in the text file as delimiters.<BR><BR><BR>

Posting Permissions

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