PC Review


Reply
Thread Tools Rate Thread

How to connect to foxpro database?

 
 
=?Utf-8?B?S2ltbw==?=
Guest
Posts: n/a
 
      12th May 2004
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


 
Reply With Quote
 
 
 
 
Cor Ligthert
Guest
Posts: n/a
 
      12th May 2004
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


 
Reply With Quote
 
Paul Clement
Guest
Posts: n/a
 
      12th May 2004
On Wed, 12 May 2004 02:21:04 -0700, "Kimo" <(E-Mail Removed)>
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 ~~~ (E-Mail Removed)
Microsoft MVP (Visual Basic)
 
Reply With Quote
 
Cindy Winegarden
Guest
Posts: n/a
 
      12th May 2004
In news: 745CD43F-40F0-484A-88D9-(E-Mail Removed),
Kimo <(E-Mail Removed)> 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
(E-Mail Removed) www.cindywinegarden.com



 
Reply With Quote
 
joepitz@mindspring.com
Guest
Posts: n/a
 
      20th May 2004
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...
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
using UDL to connect to Foxpro database imad koussa Microsoft Excel Discussion 0 26th Apr 2008 04:36 PM
database query not showing foxpro database How I import data =?Utf-8?B?bWFuZ2F0?= Microsoft Excel New Users 1 24th Jun 2007 03:31 PM
Connect to Foxpro Data (*.DBF) in VB.Net =?Utf-8?B?RXJpY0x1bg==?= Microsoft ADO .NET 9 4th Jan 2006 02:44 PM
Re: Connect to Visual FoxPro Sorin Sandu Microsoft ADO .NET 0 19th May 2004 05:16 AM
Connect to Visual FoxPro Sorin Sandu Microsoft ADO .NET 1 18th May 2004 02:09 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:59 AM.