473,386 Members | 1,752 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,386 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 13376
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
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
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...

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.