MaxScanRows=0 gives wront datatypes for Text file

From: Payman (paymankamali_at_yahoo.com)
Date: 04/29/04


Date: 29 Apr 2004 02:27:33 -0700

Hi,

I am working with ADO to connect to the Jet 4.0 engine to get a
dataset for
a csv file.

My connection string is:

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=%s;Extended
Properties="text;
HDR=%s;FMT=Delimited"

I am also using a Schema file that looks like this:

[MyFile.csv]
Format=Delimited(;)
ColNameHeader=True
MaxScanRows=0

The problem is that when I have a file with headers and I define
HDR=Yes in the connect string
and ColNameHeader=True in the schema file, the file is read in
properly, the header is also fine, but I get a string datatype in my
ado dataset for every column regardless of what information is stored
in the column ( integer, date, etc. ).

Now when I take the same file and remove its header row and I define
HDR=No in the connection string and ColNameHeader=false in the schema
file,
only the first 25 rows are scanned so columns where the first 25
entries are integers and the 26th entry is a string, is given a null
value for the 26th entry.

It almost seems like only the first row is scanned to determine the
datatype!??

I have also changed the ImportMixedTypes registry entry in the key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engines\Text
to the value: Text

When I change MaxScanRows to MaxScanRows=100 Everything works fine.

I think I've read almost every post about maxscanrows...

PLEASE HELP!
Payman



Relevant Pages

  • Re: Read info from a file
    ... :>> string I wanted to read from the file was the Initial Catalog and the ... :>>> Are you using ADO to connect to the db? ... :>>>> I have a project that is going to connect to a SQL Server. ... :>>>> connection string so that it looks at the correct SQL Server and ...
    (microsoft.public.vb.syntax)
  • Multipart connectionstring question
    ... I’ve got an asp.net site that contains an access database. ... running the same app both on my machine and my host without making changes. ... How could one even use a server.mappath with a database connection string? ...
    (microsoft.public.dotnet.general)
  • Installer - Custom Textboxes in UI problem
    ... void Install function. ... I've tested it by writing the string out to a text file ... put the connection string and I intend to test the db connectivity and write ... throw new InstallException("The database conection information is not ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Accessing mdb file via VB code
    ... None of the previous installs re-registers etc worked but I got it fixed ... If any of you know why my string would not work, ... You need a connection string like: ... Some people report it as happening to an entire new suite of boxes. ...
    (microsoft.public.vb.general.discussion)
  • Re: EXEC master..xp_cmdshell Prevention
    ... way to significantly reduce vulnerabilities around dynamic string execution. ... > I found that my web application did use a connection string in a file ... I have created a new login account ...
    (microsoft.public.sqlserver.security)