FoxPro Data Connection

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello

I'm very new to the .NET environment and am starting to learn on my home pc. I have some foxpro tables that I want to use. How would I go about connecting to the data? I am very familar with VB 6 and all versions of Fox. This .Net stuff is quite the different animal

Any suggestions or examples would be greatly appreciated! Also, I would like to purchase a good vb.net jumpstart book but there are hundreds out there...any suggestions there as well

Trent
 
Actually, I am very familar with FoxPro and only somewhat similar with certain areas of Visual Basic.
 
Trent said:
I'm very new to the .NET environment and am starting to learn on my home
pc. I have some foxpro tables that I want to use. How would I go about
connecting to the data? I am very familar with VB 6 and all versions of
Fox. This .Net stuff is quite the different animal.

Hi Trent: Are you hoping to use the .DBF files (and indexes) as they are or
are you willing/planning to move them into some other format? Have you
accessed the files using VB before? The reason I ask is, there is a product
that can help and their is a .Net version. At least check it out at
Advantage Systems if you haven't already.

http://www.advantagedatabase.com/ADS/default.htm

Tom
 
* "=?Utf-8?B?VHJlbnQ=?= said:
I'm very new to the .NET environment and am starting to learn on my
home pc. I have some foxpro tables that I want to use. How would I go
about connecting to the data? I am very familar with VB 6 and all
versions of Fox. This .Net stuff is quite the different animal.

<http://www.connectionstrings.com/>
 
In news: (e-mail address removed),
Trent said:
I'm very new to the .NET environment and am starting to learn on my
home pc. I have some foxpro tables that I want to use. How would I
go about connecting to the data?

Hi Trent,

Accessing FoxPro data is like accessing any other data - you can use either
ODBC or OLE DB. What you do after that depends on what you're doing. Are you
just reading data? Are you updating data? What you really need to understand
is ADO.NET.

Here's some code I wrote to experiment with updating data in a FoxPro Memo
field:

Imports System.Data.OleDb

Module Module1

Sub Main()



' Assumes VFP table TestADO (Id C(10), Memo1 M)

' in database Test.dbc



Dim OleDbConnection1 = New OleDbConnection("User ID=;DSN=;" & _

"Cache Authentication=False;Data Source=""C:\MY DOCUMENTS\VISUAL FOXPRO
PROJECTS\TEST.DBC"";" & _

"Password=;Provider=""VFPOLEDB.1"";Collating Sequence=MACHINE;Mask
Password=False;Mode=Share Deny None;" & _

"Extended Properties=;Encrypt Password=False")



OleDbConnection1.Open()



Dim OleDbCommand1 As OleDbCommand = New OleDbCommand

OleDbCommand1.Connection = OleDbConnection1

OleDbCommand1.CommandType = CommandType.Text

OleDbCommand1.CommandText = _

"INSERT INTO TestADO (Id, Memo1) VALUES (?, ?)"



Dim Parm0 As OleDbParameter = New Data.OleDb.OleDbParameter

Dim Parm1 As OleDbParameter = New Data.OleDb.OleDbParameter

OleDbCommand1.Parameters.Add(Parm0)

OleDbCommand1.Parameters.Add(Parm1)



OleDbCommand1.Parameters(0).Value = "Id Here"

OleDbCommand1.Parameters(1).Value = _

"The quick brown fox jumped over the lazy dog. 50" & _

"The quick brown fox jumped over the lazy dog. 100" & _

"The quick brown fox jumped over the lazy dog. 150" & _

"The quick brown fox jumped over the lazy dog. 200" & _

"The quick brown fox jumped over the lazy dog. 250" & _

"The quick brown fox jumped over the lazy dog. 300" & _

"The quick brown fox jumped over the lazy dog. 350" & _

"The quick brown fox jumped over the lazy dog. 400" & _

"The quick brown fox jumped over the lazy dog. 450" & _

"The quick brown fox jumped over the lazy dog. 500"



Dim RowsAffected As Integer = OleDbCommand1.ExecuteNonQuery()



OleDbConnection1.Close()



End Sub



End Module
 
Hello,

you also use DSN, you create your fox pro database DSn and use in Dot
net through server explorer and what ever you want.


Thanks,

Warm Regards,

Ayaz Ahmed
Software Engineer & Web Developer
Creative Chaos (Pvt.) Ltd.
"Managing Your Digital Risk"
http://www.csquareonline.com
Karachi, Pakistan
Mobile +92 300 2280950
Office +92 21 455 2414
 
Back
Top