.NETGURU
Problem in connecting to FoxPro DB
Messages   Related Types
This message was discovered on microsoft.public.dotnet.framework.odbcnet.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
Post a new message to this list...

Pranam Ben via .Net Guru (VIP)
(Type your message here)

Hi-

I am trying to connect to a FoxPro db. My application is built as a C# user control in .NET. The DB is a free table directory. I created a DSN (Microsoft Visual Foxpro Driver type) on the server and linked to the folder. It created fine. But when I run my code, it gives me a 'file sample.dbf does not exist'. The file is present under the folder.

I also tried a DSNLess connection. I added a key in the web.config file

ConnStr= "Driver=Microsoft Visual Foxpro Driver;UID=;PWD=;SourceType=;SourceDB=\\Servername\Data;Exclusive=No

It then gave me an error

An error occurred ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed ERROR [01000] [Microsoft][ODBC Driver Manager] The driver doesn't support the version of ODBC behavior that the application requested (see SQLSetEnvAttr). ERROR [01S00] [Microsoft][ODBC Visual FoxPro Driver]SourceType

I would request an immediate help from any of you guys who have run into this before. I am running tight deadlines to deliver this application.

Thanks in advance,
Ben

--------------------------------
From: Pranam Ben

-----------------------
Posted by a user from .Net Guru (http://www.dot-net-guru.com/)

<Id>FGR/G+eIiEyM3ISE33nSOQ==</Id>
Reply to this message...
 
    
Bob Grommes
Cindy's response is excellent and comprehensive. I'd add that using the
FoxPro OLE DB driver would be a better alternative in terms of performance
and features. The only reason I can think of to stick with ODBC is that
*maybe* if the table is shared by an application based upon FoxPro 7.0 or
earlier, there could be some conflict, or locking scheme differences,
between the two runtimes, and I'd want to test for that first. Also if the
Fox ODBC driver is already installed on the target machine and needed by
something else. Otherwise, go with the newer OLE DB driver.

--Bob

"Pranam Ben via .Net Guru" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
(Type your message here)

Hi-

I am trying to connect to a FoxPro db. My application is built as a C# user
control in .NET. The DB is a free table directory. I created a DSN
(Microsoft Visual Foxpro Driver type) on the server and linked to the
folder. It created fine. But when I run my code, it gives me a 'file
sample.dbf does not exist'. The file is present under the folder.

I also tried a DSNLess connection. I added a key in the web.config file

ConnStr= "Driver=Microsoft Visual Foxpro
Driver;UID=;PWD=;SourceType=;SourceDB=\\Servername\Data;Exclusive=No

It then gave me an error

An error occurred ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's
SQLSetConnectAttr failed ERROR [01000] [Microsoft][ODBC Driver Manager] The
driver doesn't support the version of ODBC behavior that the application
requested (see SQLSetEnvAttr). ERROR [01S00] [Microsoft][ODBC Visual FoxPro
Driver]SourceType

I would request an immediate help from any of you guys who have run into
this before. I am running tight deadlines to deliver this application.

Thanks in advance,
Ben

--------------------------------
From: Pranam Ben

-----------------------
Posted by a user from .Net Guru (http://www.dot-net-guru.com/)

<Id>FGR/G+eIiEyM3ISE33nSOQ==</Id>

Reply to this message...
 
    
Cindy Winegarden
Hi Ben,

For your first try see the KB article at
http://support.microsoft.com/?id=192979, "PRB: VFPODBC Driver Ignores Path
in DSN When Executing SQL"

For your second try, the error message says it doesn't like the value you
have entered for SourceType. I'm assuming you used the OLE DB provider for
ODBC drivers. Your SourceType is blank and the driver doesn't have support
for that value. Try SourceType=DBF (or SourceType=DBC if you're connecting
to a dababase).

You can also use the Visual FoxPro OLE DB provider, downloadable from
http://msdn.microsoft.com/vfoxpro/downloads/updates/default.aspx. A
connection string using the Visual FoxPro OLE DB provider does not have a
SourceType parameter. OLE DB determines from the source whether it's a DBC
or free tables.

I see that you are "requesting immediate help" and are under a "tight
deadline." Everyone that answers questions here is a volunteer and answers
questions at their leisure; as it stands now I'm giving up free time on my
Saturday afternoon to answer your question.

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

"Pranam Ben via .Net Guru" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
I am trying to connect to a FoxPro db. My application is built as a C# user
control in .NET. The DB is a free table directory. I created a DSN
(Microsoft Visual Foxpro Driver type) on the server and linked to the
folder. It created fine. But when I run my code, it gives me a 'file
sample.dbf does not exist'. The file is present under the folder.

I also tried a DSNLess connection. I added a key in the web.config file

ConnStr= "Driver=Microsoft Visual Foxpro
Driver;UID=;PWD=;SourceType=;SourceDB=\\Servername\Data;Exclusive=No

It then gave me an error

An error occurred ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's
SQLSetConnectAttr failed ERROR [01000] [Microsoft][ODBC Driver Manager] The
driver doesn't support the version of ODBC behavior that the application
requested (see SQLSetEnvAttr). ERROR [01S00] [Microsoft][ODBC Visual FoxPro
Driver]SourceType

I would request an immediate help from any of you guys who have run into
this before. I am running tight deadlines to deliver this application.

Thanks in advance,
Ben

--------------------------------
From: Pranam Ben

-----------------------
Posted by a user from .Net Guru (http://www.dot-net-guru.com/)

<Id>FGR/G+eIiEyM3ISE33nSOQ==</Id>

Reply to this message...
 
 




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