473,396 Members | 2,158 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to connect to foxpro database?

Hi
I develope an application in VB.Net. I want to connect to foxpro database. I use the following code

Tr
Dim cnn As New OleDbConnectio
cnn.ConnectionString = "Provider=VFPOLEDB.1;" +
"Data Source=E:\FoxDB.dbc;
cnn.Open(
Catch e As System.Exceptio
MsgBox(e.Message
End Tr

Although database tables is contained in "E:\FoxDB" folder, the following error message is displayed: Invalid path or file name

Would you help me please

Thanks
Kim
Jul 21 '05 #1
4 13377
Hi Kino,

It is Cindys stuff, however when I see this, than you have set a reference
to something strange
"Data Source=E:\FoxDB.dbc;"


That is in my opinion the FoxDB.dbc database in the mainroot from drive E:\

Should it not be something as
E:\FoxDB\FoxDB.dbc or whathever name that dbc has

However not my stuff but Cindy visits this newsgroup regulary however not
daily.

Cor
Jul 21 '05 #2
On Wed, 12 May 2004 02:21:04 -0700, "Kimo" <an*******@discussions.microsoft.com>
wrote:

¤ Hi,
¤ I develope an application in VB.Net. I want to connect to foxpro database. I use the following code:
¤
¤ Try
¤ Dim cnn As New OleDbConnection
¤ cnn.ConnectionString = "Provider=VFPOLEDB.1;" + _
¤ "Data Source=E:\FoxDB.dbc;"
¤ cnn.Open()
¤ Catch e As System.Exception
¤ MsgBox(e.Message)
¤ End Try
¤
¤ Although database tables is contained in "E:\FoxDB" folder, the following error message is displayed: Invalid path or file name.
¤

The syntax looks OK to me. Is the E: drive a local resource and if not do you
have full access permissions to the network resource? Does the same code work if
the database source is on the C: drive?
Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)
Jul 21 '05 #3
In news: 74**********************************@microsoft.com,
Kimo <an*******@discussions.microsoft.com> wrote:
cnn.ConnectionString = "Provider=VFPOLEDB.1;" + _
"Data Source=E:\FoxDB.dbc;" Although database tables is contained in "E:\FoxDB" folder, the
following error message is displayed: Invalid path or file name.


Hi Kimo,

FoxPro tables can come in either of two formats. They can be "free" tables,
meaning that each table is independent of the others, or they can be part of
a "database container" which holds metadata and allows additional features
for the tables. If you see a file with a DBC extension then you've got a
database.

Here are two connection strings:

*-- Free table directory
Provider=VFPOLEDB.1;Data Source=C:\My Documents\Visual FoxPro
Projects;Password="";Collating Sequence=MACHINE

*-- Database Container
Provider=VFPOLEDB.1;Data Source=C:\My Documents\Visual FoxPro
Projects\Test.DBC;Password="";Collating Sequence=MACHINE
--
Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
ci**************@mvps.org www.cindywinegarden.com

Jul 21 '05 #4
If "E:\FoxDB" is the folder shouldn't your data source be
"Data Source=E:\FoxDb\FoxDB.dbc;" ?

************************************************** ********************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
Jul 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: JN | last post by:
Hello, I'm having problem calling stored procedures from Visual FoxPro database. I got the following exception error: "System.Data.OleDb.OleDbException: Unrecognized command verb" It seems...
4
by: Kimo | last post by:
Hi I develope an application in VB.Net. I want to connect to foxpro database. I use the following code Tr Dim cnn As New OleDbConnectio cnn.ConnectionString = "Provider=VFPOLEDB.1;" + "Data...
14
by: johnsobd | last post by:
I am accessing an existing Foxpro database, of which I have no control over. I have been successful in accessing all the tables except for one. This one table I can access the first 9 fields in...
0
by: diston52 | last post by:
Hello,,, I'm Don I'm currently working on a system to track contacts for a railroad in a nearby town. I am using Visual Studio 2005 and SQL Server Express. The client has purchased a package...
0
by: smtwtfs007 | last post by:
I have an ASP.NET website. I'm trying to connect to a Foxpro database (ADO.NET) with the following connect string: txtConnectionStr.Text = "\\soya4042\Qd\LM\LMS\Data" Dim strFoxProDirectory As...
1
by: smtwtfs007 | last post by:
I have an ASP.NET website. I'm trying to connect to a Foxpro database (ADO.NET) with the following connect string: txtConnectionStr.Text = "\\soya4042\Qd\LM\LMS\Data" Dim strFoxProDirectory As...
1
by: goutam | last post by:
I develope an application in VB.Net. I want to connect to foxpro database. What would be the connection string. I need help with example....
2
by: bluepiper | last post by:
Please help me, I have been given a project in VB 6 and the database that I should connect and manipulate with is made from Visual Foxpro database. Is this possible, can you guys teach me how?...
8
by: pechar | last post by:
Hi all, I created an application to copy certain tables from a database on MSSQL server to another database on MYSQL server which is on another server (very very very far away). The process works...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.