Re: Using Microsoft Text Driver with CSV files

From: Dmitri Ivanov (divanov_NOSP_at_M_.aha.ru)
Date: 12/28/04


Date: Tue, 28 Dec 2004 08:57:01 +0300

Hello Wayne,
"Wayne Phipps" <Wayne Phipps@discussions.microsoft.com> wrote:

WP> I have a working application that uses an ODBC connection to
WP> retrieve data from a CSV file.
WP>
WP> The only problem I have is that it always treats the first line as
WP> Column Names but out company gets sent data from different sources,
WP> some include Column Names, others don't.
WP>
WP> I would like to make the application more flexible and enable it to
WP> work with either format files.
WP>
WP> The connection string is something like:
WP> <code>
WP> "Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=C:\MyTest;"
WP> </code>
WP>
WP> Can the connection string be changed to indicate if column info is
WP> not included?

No, you cannot specify this kind of information in DSN nor in connection
string.
Instead, you must put the following attribute for each (!) table definition
in the schema.ini:
    ColNameHeader

--
Sincerely,
Dmitri Ivanov
Common Lisp ODBC interface - www.ystok.ru


Relevant Pages

  • Re: Problem Connecting to a CSV File in Word 2007
    ... Thank for responding Doug. ... the connection to the CSV file (and seen the data come up in the Word ... The CSV file resides in a subfolder of My Documents. ... In Word 2003 I can connect my document to a .CSV file as my data source ...
    (microsoft.public.word.mailmerge.fields)
  • Re: importing csv to datagrid, adding column data
    ... Robson Siqueira wrote: ... //Function For Importing Data From CSV File ... // Create a connection string as below, if you want to use DSN ...
    (microsoft.public.dotnet.languages.csharp)
  • Using Microsoft Text Driver with CSV files
    ... I have a working application that uses an ODBC connection to retrieve data ... from a CSV file. ... Can the connection string be changed to indicate if column info is not ...
    (microsoft.public.data.odbc)
  • Re: importing csv to datagrid, adding column data
    ... Its removes the rows but its still using the first row as the header, ... Robson Siqueira wrote: ... //Function For Importing Data From CSV File ... // Create a connection string as below, if you want to use DSN ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: importing csv to datagrid, adding column data
    ... Robson Siqueira wrote: ... //Function For Importing Data From CSV File ... // Create a connection string as below, if you want to use DSN ...
    (microsoft.public.dotnet.languages.csharp)