PC Review


Reply
Thread Tools Rate Thread

How can I connect a dbf file in .net ?

 
 
Chuen
Guest
Posts: n/a
 
      23rd Aug 2004
I want to open a dbf file in vb.net,how can I do it?

Regards
Chuen


 
Reply With Quote
 
 
 
 
Cor Ligthert
Guest
Posts: n/a
 
      23rd Aug 2004
Chuen

As a program

Use application start something as this (I never did this with dbase)
\\\
Dim p As New System.Diagnostics.ProcessStartInfo()
p.WindowStyle = ProcessWindowStyle.Hidden
p.FileName = "C:\filename.dbf"
p.UseShellExecute = True
System.Diagnostics.Process.Start(p)
///
As a database have a look first here (Foxpro)
http://www.connectionstrings.com/

http://www.able-consulting.com/ADO_Conn.htm

I hope this helps?

Cor


 
Reply With Quote
 
Paul Clement
Guest
Posts: n/a
 
      23rd Aug 2004
On Mon, 23 Aug 2004 16:10:12 +1200, "Chuen" <(E-Mail Removed)> wrote:

¤ I want to open a dbf file in vb.net,how can I do it?
¤
¤ Regards
¤ Chuen
¤

See if the following helps:

Dim ConnectionString As String

ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=e:\My Documents\dBase;Extended Properties=dBase IV"
Dim dBaseConnection As New System.Data.OleDb.OleDbConnection(ConnectionString)
dBaseConnection.Open()

Dim dBaseCommand As New System.Data.OleDb.OleDbCommand("SELECT * FROM MyDBase",
dBaseConnection)
Dim dBaseDataReader As System.Data.OleDb.OleDbDataReader =
dBaseCommand.ExecuteReader(CommandBehavior.SequentialAccess)

While dBaseDataReader.Read
Console.WriteLine(dBaseDataReader("Column1").ToString)
Console.WriteLine(dBaseDataReader("Column2").ToString)
Console.WriteLine(dBaseDataReader("Column3").ToString)
End While

dBaseConnection.Close()


Paul ~~~ (E-Mail Removed)
Microsoft MVP (Visual Basic)
 
Reply With Quote
 
=?Utf-8?B?Sm9lbCBFaXNlbmhhbmRsZXI=?=
Guest
Posts: n/a
 
      25th Aug 2004
I have had very good success with ODBC. Set up the database directory under
System DSN. All your connection string has to say is "DSN=XXX"

"Paul Clement" wrote:

> On Mon, 23 Aug 2004 16:10:12 +1200, "Chuen" <(E-Mail Removed)> wrote:
>
> ¤ I want to open a dbf file in vb.net,how can I do it?
> ¤
> ¤ Regards
> ¤ Chuen
> ¤
>
> See if the following helps:
>
> Dim ConnectionString As String
>
> ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
> "Data Source=e:\My Documents\dBase;Extended Properties=dBase IV"
> Dim dBaseConnection As New System.Data.OleDb.OleDbConnection(ConnectionString)
> dBaseConnection.Open()
>
> Dim dBaseCommand As New System.Data.OleDb.OleDbCommand("SELECT * FROM MyDBase",
> dBaseConnection)
> Dim dBaseDataReader As System.Data.OleDb.OleDbDataReader =
> dBaseCommand.ExecuteReader(CommandBehavior.SequentialAccess)
>
> While dBaseDataReader.Read
> Console.WriteLine(dBaseDataReader("Column1").ToString)
> Console.WriteLine(dBaseDataReader("Column2").ToString)
> Console.WriteLine(dBaseDataReader("Column3").ToString)
> End While
>
> dBaseConnection.Close()
>
>
> Paul ~~~ (E-Mail Removed)
> Microsoft MVP (Visual Basic)
>

 
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
How to connect to .adp file D Microsoft ASP .NET 4 24th Jan 2007 02:32 PM
How does this file know where to connect =?Utf-8?B?Q2hhcmxpZSBCcm93bg==?= Microsoft Access VBA Modules 14 16th Jul 2006 06:46 AM
file splitter (also creates a batch file to re-connect the split files) *ProteanThread* Freeware 0 11th Jan 2005 04:31 PM
Connect To CSV File via ADO Mark Microsoft Access VBA Modules 4 21st Oct 2004 09:22 AM
Where is the connect.asp file? Pete Windows XP Help 0 6th May 2004 07:29 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:26 PM.