How to see first line as data with ADO+ODBC/Microsoft Text Driver 
Author Message
 How to see first line as data with ADO+ODBC/Microsoft Text Driver

Is there any way to see first row as data, rather than column names,
when using Microsoft Text Driver with ADO?

Trying to avoid having to make changes to the source text file, which
is has comma separated values, but has a ".txt" file extension.

Apparently when used with ADO the SCHEMA.INI file is not used.

This is VBS invoked from CSCRIPT if it makes a difference.

--
______________________________________________________________________
Lee Gillie, CCP                                Remove NOSPAM to E-Mail
Online Data Processing, Inc. - 3501 N. Haven -  Spokane, WA 99207-8500



Fri, 16 Aug 2002 03:00:00 GMT  
 How to see first line as data with ADO+ODBC/Microsoft Text Driver
OK
you have SCHEMA.INI

Use this if the table for instance is yourtable.csv

[yourtable.csv]
colnameheader=false
DateTimeFormat=ddmmyy
Format=CSVDelimited
MaxScanRows=0
CharacterSet=ANSI


Quote:
> Is there any way to see first row as data, rather than column names,
> when using Microsoft Text Driver with ADO?

> Trying to avoid having to make changes to the source text file, which
> is has comma separated values, but has a ".txt" file extension.

> Apparently when used with ADO the SCHEMA.INI file is not used.

> This is VBS invoked from CSCRIPT if it makes a difference.

> --
> ______________________________________________________________________
> Lee Gillie, CCP                                Remove NOSPAM to E-Mail
> Online Data Processing, Inc. - 3501 N. Haven -  Spokane, WA 99207-8500



Sun, 18 Aug 2002 03:00:00 GMT  
 How to see first line as data with ADO+ODBC/Microsoft Text Driver
Egbert -

Yes, I have SCHEMA.INI.  I understand the concept.  When I import
this text file via Access, it pulls it in correctly, first line
as data, not field names.  When done from a script using ADO it
does not use SCHEMA.INI.

http://support.microsoft.com/support/kb/articles/Q233/3/18.ASP says
ADO does not use schema.ini.  It also says "The first line in the
delimited text file will be used by ADO for column names. If you
don't want to have column names in the file, then you must leave
the first row blank; otherwise the first row will be used by ADO
as a source for column names and your RecordCount will be short by
one."  This is really the pits.  I was hoping someone would have
found a way around this.  The Q-articles are not always 100%
accurate when it comes to what you can't do based on past
experience.

Ultimately this is working through ODBC, and there may be a way to
communicate something like Extended Properties to the connection
object, if I knew what the right word was to use.  I can't believe
that in the general design spirit of ADO to expose ODBC drivers, and
to embrace the diversity, there is not SOME WAY to get unique driver
properties through to the ODBC driver.  I'm still betting that there
is a way to tailor the text driver operating parameters from ADO.

Let us know if you have discovered how.

--
______________________________________________________________________
Lee Gillie, CCP                                Remove NOSPAM to E-Mail
Online Data Processing, Inc. - 3501 N. Haven -  Spokane, WA 99207-8500

Quote:

>OK
>you have SCHEMA.INI

>Use this if the table for instance is yourtable.csv

>[yourtable.csv]
>colnameheader=false
>DateTimeFormat=ddmmyy
>Format=CSVDelimited
>MaxScanRows=0
>CharacterSet=ANSI



>> Is there any way to see first row as data, rather than column names,
>> when using Microsoft Text Driver with ADO?

>> Trying to avoid having to make changes to the source text file, which
>> is has comma separated values, but has a ".txt" file extension.

>> Apparently when used with ADO the SCHEMA.INI file is not used.

>> This is VBS invoked from CSCRIPT if it makes a difference.

>> --
>> ______________________________________________________________________
>> Lee Gillie, CCP                                Remove NOSPAM to E-Mail
>> Online Data Processing, Inc. - 3501 N. Haven -  Spokane, WA 99207-8500



Mon, 19 Aug 2002 03:00:00 GMT  
 How to see first line as data with ADO+ODBC/Microsoft Text Driver
Hi Lee,

The information in the KB is not quite aqurate... Of course in both cases
wether I use ODBC or Ole DB or ADO or RDO just continue summing it uses
SCHEMA.INI.

I got this working right after some research. I had also like you did some
problems to get it working with ADO 2.5.

 ' this connectionstring uses schema.ini
    db.Open "Provider=Microsoft.Jet.OLEDB.4.0;Text;Database=C:\ExactW2\;"
    rs.Open "Credit6.txt", db, adOpenStatic, adLockOptimistic,
adCmdTableDirect


Quote:
> Egbert -

> Yes, I have SCHEMA.INI.  I understand the concept.  When I import
> this text file via Access, it pulls it in correctly, first line
> as data, not field names.  When done from a script using ADO it
> does not use SCHEMA.INI.

> http://support.microsoft.com/support/kb/articles/Q233/3/18.ASP says
> ADO does not use schema.ini.  It also says "The first line in the
> delimited text file will be used by ADO for column names. If you
> don't want to have column names in the file, then you must leave
> the first row blank; otherwise the first row will be used by ADO
> as a source for column names and your RecordCount will be short by
> one."  This is really the pits.  I was hoping someone would have
> found a way around this.  The Q-articles are not always 100%
> accurate when it comes to what you can't do based on past
> experience.

> Ultimately this is working through ODBC, and there may be a way to
> communicate something like Extended Properties to the connection
> object, if I knew what the right word was to use.  I can't believe
> that in the general design spirit of ADO to expose ODBC drivers, and
> to embrace the diversity, there is not SOME WAY to get unique driver
> properties through to the ODBC driver.  I'm still betting that there
> is a way to tailor the text driver operating parameters from ADO.

> Let us know if you have discovered how.

> --
> ______________________________________________________________________
> Lee Gillie, CCP                                Remove NOSPAM to E-Mail
> Online Data Processing, Inc. - 3501 N. Haven -  Spokane, WA 99207-8500


> >OK
> >you have SCHEMA.INI

> >Use this if the table for instance is yourtable.csv

> >[yourtable.csv]
> >colnameheader=false
> >DateTimeFormat=ddmmyy
> >Format=CSVDelimited
> >MaxScanRows=0
> >CharacterSet=ANSI



> >> Is there any way to see first row as data, rather than column names,
> >> when using Microsoft Text Driver with ADO?

> >> Trying to avoid having to make changes to the source text file, which
> >> is has comma separated values, but has a ".txt" file extension.

> >> Apparently when used with ADO the SCHEMA.INI file is not used.

> >> This is VBS invoked from CSCRIPT if it makes a difference.

> >> --
> >> ______________________________________________________________________
> >> Lee Gillie, CCP                                Remove NOSPAM to E-Mail
> >> Online Data Processing, Inc. - 3501 N. Haven -  Spokane, WA 99207-8500



Mon, 19 Aug 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. * Microsoft Text Driver as an ODBC driver

2. Oracle ODBC driver / Microsoft ODBC driver for Oracle

3. VB Sql Server Via ADO Problem: [Microsoft][ODBC Sql Server Driver]

4. Microsoft Oracle ODBC driver and ADO

5. Decimal Problem usind ADO and Microsoft Oracle ODBC driver

6. Microsoft Text Driver ( ODBC )

7. 01004 - 0 - [Microsoft][ODBC SQL Server Driver]String data, right truncation

8. ADO, text driver - ADO picks wrong data type...

9. [ODBC Microsoft Access Driver] ODBC--call failed.

10. [ODBC Microsoft Access Driver] ODBC--call failed.

11. Ado 2.5 and Microsoft Text driver

12. ADO and Microsoft text driver

 

 
Powered by phpBB® Forum Software