OLEDB Provider throws exception "Specified cast is not valid"

  • Thread starter Thread starter HVG
  • Start date Start date
H

HVG

We are trying to use a 3rd party OLEDB driver that apparently works well
under VB6.
The driver appears to be installed correctly, as we can access data via the
driver using Excell.

Just excecuting the following lines...
dim oledbCnctn as New OleDbConnection(<CnctnString>)
oldedbCnctn.Open()
throws the exception "Specified cast is not valid" (please see details
below).

All connection string parameters except the provider-name are ignored (ie.
they are correct as per the Excell test above), but altering them has no
effect on the exception thrown.
As we are aware, no one else has used this OLEDB driver within in the .NET
environment before, and we posses no experience in OLEDB driver development.
We access SQL data with no problems.

Any ideas as to what we should be doing/trying greatly appreciated.
Should an existing OLEDB driver automatically work in the .NET environment,
or could some modifications be required first?

Many thanks for any help.
Hugo

[InvalidCastException: Specified cast is not valid.]
System.Data.OleDb.OleDbException..ctor(IErrorInfo errorInfo, Int32
errorCode, Exception inner)
System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hResult,
OleDbConnection connection, Object src)
System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr)
System.Data.OleDb.OleDbConnection.InitializeProvider()
System.Data.OleDb.OleDbConnection.Open()

It looks as tho the OLEDB driver is returning a result value that cannot be
cast to an integer - this maybe because the driver reports a failure or it
experenced a problem?
FYI: The 3rd-party driver provides a SQL-like interface to an ISAM-like file
system of flat files.
 
Hi,

If you are sure that syntax for the connection string is fine, then most
likely OLEDB provider is not certified for the .NET. Not all OLEDB providers
work with .NET and even some Microsoft's OLEDB providers do not work. To be
able to work with those provider's from .NET they should meet some level of
standard. I would ask vendor of the provider if it is compatible with .NET
or not
 
Thanks for the reponse.
I'm certain there has been no certification for .NET operation - the hope
was that it would work ok.
It seems geared for use with Recordset operations, which don't seem to make
much sense to me in ADO.NET.

Is there maybe some "compatability mode" that I could use this driver in
under .NET, or would the only way be to build a small ASP appln & run it on
a non-.NET server (eg. Windows 2000 without the Framework installed), and
have my ASPX appln communicate with it.

Thanks for the help.
Hugo

Val Mazur said:
Hi,

If you are sure that syntax for the connection string is fine, then most
likely OLEDB provider is not certified for the .NET. Not all OLEDB providers
work with .NET and even some Microsoft's OLEDB providers do not work. To be
able to work with those provider's from .NET they should meet some level of
standard. I would ask vendor of the provider if it is compatible with .NET
or not

--
Val Mazur
Microsoft MVP


HVG said:
We are trying to use a 3rd party OLEDB driver that apparently works well
under VB6.
The driver appears to be installed correctly, as we can access data via
the
driver using Excell.

Just excecuting the following lines...
dim oledbCnctn as New OleDbConnection(<CnctnString>)
oldedbCnctn.Open()
throws the exception "Specified cast is not valid" (please see details
below).

All connection string parameters except the provider-name are ignored (ie.
they are correct as per the Excell test above), but altering them has no
effect on the exception thrown.
As we are aware, no one else has used this OLEDB driver within in the ..NET
environment before, and we posses no experience in OLEDB driver
development.
We access SQL data with no problems.

Any ideas as to what we should be doing/trying greatly appreciated.
Should an existing OLEDB driver automatically work in the .NET
environment,
or could some modifications be required first?

Many thanks for any help.
Hugo

[InvalidCastException: Specified cast is not valid.]
System.Data.OleDb.OleDbException..ctor(IErrorInfo errorInfo, Int32
errorCode, Exception inner)
System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hResult,
OleDbConnection connection, Object src)
System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr)
System.Data.OleDb.OleDbConnection.InitializeProvider()
System.Data.OleDb.OleDbConnection.Open()

It looks as tho the OLEDB driver is returning a result value that cannot
be
cast to an integer - this maybe because the driver reports a failure or it
experenced a problem?
FYI: The 3rd-party driver provides a SQL-like interface to an ISAM-like
file
system of flat files.
 
You cannot specify any level of compatibility. It just works or not.

--
Val Mazur
Microsoft MVP


HVG said:
Thanks for the reponse.
I'm certain there has been no certification for .NET operation - the hope
was that it would work ok.
It seems geared for use with Recordset operations, which don't seem to
make
much sense to me in ADO.NET.

Is there maybe some "compatability mode" that I could use this driver in
under .NET, or would the only way be to build a small ASP appln & run it
on
a non-.NET server (eg. Windows 2000 without the Framework installed), and
have my ASPX appln communicate with it.

Thanks for the help.
Hugo

Val Mazur said:
Hi,

If you are sure that syntax for the connection string is fine, then most
likely OLEDB provider is not certified for the .NET. Not all OLEDB providers
work with .NET and even some Microsoft's OLEDB providers do not work. To be
able to work with those provider's from .NET they should meet some level of
standard. I would ask vendor of the provider if it is compatible with
.NET
or not

--
Val Mazur
Microsoft MVP


HVG said:
We are trying to use a 3rd party OLEDB driver that apparently works
well
under VB6.
The driver appears to be installed correctly, as we can access data via
the
driver using Excell.

Just excecuting the following lines...
dim oledbCnctn as New OleDbConnection(<CnctnString>)
oldedbCnctn.Open()
throws the exception "Specified cast is not valid" (please see details
below).

All connection string parameters except the provider-name are ignored (ie.
they are correct as per the Excell test above), but altering them has
no
effect on the exception thrown.
As we are aware, no one else has used this OLEDB driver within in the .NET
environment before, and we posses no experience in OLEDB driver
development.
We access SQL data with no problems.

Any ideas as to what we should be doing/trying greatly appreciated.
Should an existing OLEDB driver automatically work in the .NET
environment,
or could some modifications be required first?

Many thanks for any help.
Hugo

[InvalidCastException: Specified cast is not valid.]
System.Data.OleDb.OleDbException..ctor(IErrorInfo errorInfo, Int32
errorCode, Exception inner)
System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hResult,
OleDbConnection connection, Object src)
System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr)
System.Data.OleDb.OleDbConnection.InitializeProvider()
System.Data.OleDb.OleDbConnection.Open()

It looks as tho the OLEDB driver is returning a result value that
cannot
be
cast to an integer - this maybe because the driver reports a failure or it
experenced a problem?
FYI: The 3rd-party driver provides a SQL-like interface to an ISAM-like
file
system of flat files.
 
Ok, thanks.
Hugo

Val Mazur said:
You cannot specify any level of compatibility. It just works or not.

--
Val Mazur
Microsoft MVP


HVG said:
Thanks for the reponse.
I'm certain there has been no certification for .NET operation - the hope
was that it would work ok.
It seems geared for use with Recordset operations, which don't seem to
make
much sense to me in ADO.NET.

Is there maybe some "compatability mode" that I could use this driver in
under .NET, or would the only way be to build a small ASP appln & run it
on
a non-.NET server (eg. Windows 2000 without the Framework installed), and
have my ASPX appln communicate with it.

Thanks for the help.
Hugo

Val Mazur said:
Hi,

If you are sure that syntax for the connection string is fine, then most
likely OLEDB provider is not certified for the .NET. Not all OLEDB providers
work with .NET and even some Microsoft's OLEDB providers do not work.
To
be
able to work with those provider's from .NET they should meet some
level
of
standard. I would ask vendor of the provider if it is compatible with
.NET
or not

--
Val Mazur
Microsoft MVP


We are trying to use a 3rd party OLEDB driver that apparently works
well
under VB6.
The driver appears to be installed correctly, as we can access data via
the
driver using Excell.

Just excecuting the following lines...
dim oledbCnctn as New OleDbConnection(<CnctnString>)
oldedbCnctn.Open()
throws the exception "Specified cast is not valid" (please see details
below).

All connection string parameters except the provider-name are ignored (ie.
they are correct as per the Excell test above), but altering them has
no
effect on the exception thrown.
As we are aware, no one else has used this OLEDB driver within in the .NET
environment before, and we posses no experience in OLEDB driver
development.
We access SQL data with no problems.

Any ideas as to what we should be doing/trying greatly appreciated.
Should an existing OLEDB driver automatically work in the .NET
environment,
or could some modifications be required first?

Many thanks for any help.
Hugo

[InvalidCastException: Specified cast is not valid.]
System.Data.OleDb.OleDbException..ctor(IErrorInfo errorInfo, Int32
errorCode, Exception inner)
System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hResult,
OleDbConnection connection, Object src)
System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr)
System.Data.OleDb.OleDbConnection.InitializeProvider()
System.Data.OleDb.OleDbConnection.Open()

It looks as tho the OLEDB driver is returning a result value that
cannot
be
cast to an integer - this maybe because the driver reports a failure
or
it
experenced a problem?
FYI: The 3rd-party driver provides a SQL-like interface to an ISAM-like
file
system of flat files.
 
Back
Top