.NETGURU
Error when connecting to a Foxpro database from a .NET web app
Messages   Related Types
This message was discovered on microsoft.public.dotnet.framework.odbcnet.

Post a new message to this list...

Grinnell Almy
Hello all -

Here's the situation. I have a web server, and I'm developing a web application using VB.NET that will run on this server. I also have another server, which runs a third party Human Resources application, written in Visual Foxpro. Its databases are standard .dbf files.

I want to be able to connect to the .dbf files on the HR server directly from my web app on the web server. I have not been able to make this work. Here's what I've tried:

1. In the Server Explorer, I created a connection using Microsoft OLE DB Provider for Visual FoxPro. The connection string is:

User ID=;DSN=;Cache Authentication=False;
Data Source=""\\<HR Server>\<path>\<to>\<data>"";Password=;Provider=""VFPOLEDB.1"";
Collating Sequence=MACHINE;Mask Password=False;Mode=Share Deny None;Extended Properties=;
Encrypt Password=False".

When I run the app, when it tries to open the connection, I get this error message:

System.Data.OleDb.OleDbException: Invalid path or file name

However, if I put this line in Web.config:

<identity impersonate="true" userName="<domain>\Administrator" password="<nevermind>" />

it works. So I'm assuming I have a permissions issue here. But I don't want the password in clear text in the config file.

2. In the Server Explorer, I created a connection using Microsoft OLE DB Provider for ODBC Drivers, and I selected Visual FoxPro tables as the machine data source. The connection string is:

BackgroundFetch=Yes;DSN=Visual FoxPro Tables;UID=;SourceType=DBF;Collate=Machine;
SourceDB=\\<HR server>\<path>\<to>\<data>;Exclusive=No

When I run the app, when it tries to open the connection, I get this error message:

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

2a. In the Server Explorer, I created a connection using Microsoft OLE DB Provider for ODBC Drivers, and I selected dBase files as the machine data source. The connection string is:

MaxBufferSize=2048;DSN=dBASE Files;PageTimeout=5;DefaultDir=\\<HR server>\<path>\<to>\<data>;
DBQ=\\<HR server>\<path>\<to>\<data>;DriverId=533

But that gives the same result as in 2.) above.

I'd appreciate any ideas. Thank you.
Reply to this message...
 
    
Cindy Winegarden
In news: Click here to reveal e-mail address,
Grinnell Almy <Click here to reveal e-mail address> wrote:
[Original message clipped]

Hi Grinnell,

Since your app runs on the web server, do you have a data source configured
on the web server that points to the file server where the FoxPro files
live?

--
Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
Click here to reveal e-mail address www.cindywinegarden.com

Reply to this message...
 
    
tsun@nospamavectra.com
Has anybody done anything on this? I have exactly the same scenario.

Thanks.

---
Posted using Wimdows.net NntpNews Component -

Post Made from http://www.DotNetJunkies.com/newsgroups Our newsgroup engine supports Post Alerts, Ratings, and Searching.
Reply to this message...
 
 
System.Data.Odbc.OdbcException
System.Data.OleDb.OleDbException




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification