FoxPro ... ODBC ... Help !!

G

Guest

Yes I know Microsoft has provided provider for OleDB ... but still I must use
ODBC to connect to a foxpro database file.

The file is called clients.DBF

The DSN created using Microsoft FoxPro VFP Driver (*.DBF). The DSN is called
ClientDB.

I am using following to connect to the ODBC source...


----------------------------------------
Dim c As New
Odbc.OdbcConnection("BackgroundFetch=Yes;DSN=ClientDB;UID=;SourceType=DBF;Collate=Machine;SourceDB=c:\Inetpub\wwwroot\App\foxpro_files;Exclusive=No")
----------------------------------------

When I use this code in Windows Based application, it works fine. Connection
is opened and my application can read the data.

But when comes to Web Base application... it gives following error which is
Way Beyond my intellect ...

------------------------------------------------------------
ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found
and no default driver specified
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.

Exception Details: System.Data.Odbc.OdbcException: ERROR [IM002]
[Microsoft][ODBC Driver Manager] Data source name not found and no default
driver specified
 
J

Jeff Dillon

It's looking for a System DSN (not User DSN) of the name ClientDB.

When in doubt, drop a connection and datadapter object on a form, go through
the Wizard, then look at the code generated.

Jeff
 
G

Guest

Hi...

Thankyou very much for the solution! :)

If one wants to access ODBC DataSource in ASP .NET, it must be "System DSN".

Reason: ASP .NET WP is executed under separate limited right based user. If
you will create the "User DSN", it would be fine for the windows based
applications but not for ASP .NET as ASP .NET user (which is kind of passive)
will not be able to access it.

However, if you use "User DSN", it is accessible under Windows Application
for the particular user for whom DSN is defined.

Thanks for help.

fadee...



Jeff Dillon said:
It's looking for a System DSN (not User DSN) of the name ClientDB.

When in doubt, drop a connection and datadapter object on a form, go through
the Wizard, then look at the code generated.

Jeff

fahad said:
Yes I know Microsoft has provided provider for OleDB ... but still I must use
ODBC to connect to a foxpro database file.

The file is called clients.DBF

The DSN created using Microsoft FoxPro VFP Driver (*.DBF). The DSN is called
ClientDB.

I am using following to connect to the ODBC source...


----------------------------------------
Dim c As New
Odbc.OdbcConnection("BackgroundFetch=Yes;DSN=ClientDB;UID=;SourceType=DBF;Co
llate=Machine;SourceDB=c:\Inetpub\wwwroot\App\foxpro_files;Exclusive=No")
----------------------------------------

When I use this code in Windows Based application, it works fine. Connection
is opened and my application can read the data.

But when comes to Web Base application... it gives following error which is
Way Beyond my intellect ...

------------------------------------------------------------
ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found
and no default driver specified
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.

Exception Details: System.Data.Odbc.OdbcException: ERROR [IM002]
[Microsoft][ODBC Driver Manager] Data source name not found and no default
driver specified
-----------------------------------------------------------

Can Anyone Help me ... Please ... I promise I won't mess with FoxPro again ..

Fahad Khalil
 
C

Cindy Winegarden

Hi Fahad,

I'm curious why can't you use the Visual FoxPro OLE DB data provider?
 
G

Guest

Personally I would love to, coz it would be quite easy to manage. But the
problem is that I have to deploy the final product on a server where I cannot
perform any installation and server admin is not that much willing to change
any configuration. He was comfortable with making a DSN, so I and considering
this option.

Beside this, the website does not expect too many hits a day, so I think
ODBC will not create any problem for it. In future if it does, I will switch
to OleDB.

Have a Good Day,
Fahad
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top