473,881 Members | 1,730 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can I connect a dbf file in .net ?

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

Regards
Chuen
Nov 21 '05 #1
3 22396
Chuen

As a program

Use application start something as this (I never did this with dbase)
\\\
Dim p As New System.Diagnost ics.ProcessStar tInfo()
p.WindowStyle = ProcessWindowSt yle.Hidden
p.FileName = "C:\filename.db f"
p.UseShellExecu te = True
System.Diagnost ics.Process.Sta rt(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
Nov 21 '05 #2
On Mon, 23 Aug 2004 16:10:12 +1200, "Chuen" <cn*****@hotmai l.com> wrote:

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

See if the following helps:

Dim ConnectionStrin g As String

ConnectionStrin g = "Provider=Micro soft.Jet.OLEDB. 4.0;" & _
"Data Source=e:\My Documents\dBase ;Extended Properties=dBas e IV"
Dim dBaseConnection As New System.Data.Ole Db.OleDbConnect ion(ConnectionS tring)
dBaseConnection .Open()

Dim dBaseCommand As New System.Data.Ole Db.OleDbCommand ("SELECT * FROM MyDBase",
dBaseConnection )
Dim dBaseDataReader As System.Data.Ole Db.OleDbDataRea der =
dBaseCommand.Ex ecuteReader(Com mandBehavior.Se quentialAccess)

While dBaseDataReader .Read
Console.WriteLi ne(dBaseDataRea der("Column1"). ToString)
Console.WriteLi ne(dBaseDataRea der("Column2"). ToString)
Console.WriteLi ne(dBaseDataRea der("Column3"). ToString)
End While

dBaseConnection .Close()
Paul ~~~ pc******@amerit ech.net
Microsoft MVP (Visual Basic)
Nov 21 '05 #3
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" <cn*****@hotmai l.com> wrote:

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

See if the following helps:

Dim ConnectionStrin g As String

ConnectionStrin g = "Provider=Micro soft.Jet.OLEDB. 4.0;" & _
"Data Source=e:\My Documents\dBase ;Extended Properties=dBas e IV"
Dim dBaseConnection As New System.Data.Ole Db.OleDbConnect ion(ConnectionS tring)
dBaseConnection .Open()

Dim dBaseCommand As New System.Data.Ole Db.OleDbCommand ("SELECT * FROM MyDBase",
dBaseConnection )
Dim dBaseDataReader As System.Data.Ole Db.OleDbDataRea der =
dBaseCommand.Ex ecuteReader(Com mandBehavior.Se quentialAccess)

While dBaseDataReader .Read
Console.WriteLi ne(dBaseDataRea der("Column1"). ToString)
Console.WriteLi ne(dBaseDataRea der("Column2"). ToString)
Console.WriteLi ne(dBaseDataRea der("Column3"). ToString)
End While

dBaseConnection .Close()
Paul ~~~ pc******@amerit ech.net
Microsoft MVP (Visual Basic)

Nov 21 '05 #4

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

Similar topics

3
3110
by: Krista | last post by:
Hi, Hope you guys can help me out~~ I have a config.php file. I want to conncet to my own mysql version. When i run the config.php file as below, i get all successful message. However, when i take a look the database information in doc environment, I don't see any database or table created. <html> <head><title>Create Database and table</title></head> <body>
0
1826
by: Kevin Sage | last post by:
For anyone who is having this problem and want to know the solution. Add this line of code before your connect method call. It loads up some config file that the code behind the scenes needs that causes the delay when the config file is loaded behind the scenes. int temp = ServicePointManager.DefaultConnectionLimit;
4
5217
by: Ellen K. | last post by:
Hi all, Being that so far I didn't get an answer to my below problem on the Oracle newsgroup, I figured it couldn't hurt to try here. While at my current job I've been working with mostly SQL Server, now I need to connect to our Oracle Financials running on HP-UX. The Oracle DBA set me up as a user and installed the Oracle client on my box and I have the tnsnames file, but I still can't establish a connection to the database from my...
10
4385
by: Ed Stevens | last post by:
A tale of woe, and a question . . . Last week my boss said to me "we've installed DB2 Connect on this Solaris box. Make it work." Now, I've barely seen DB2 Connect on Windows, having fumbled thru one install and config, with a lot of handholding from IBM Support. I'm comfortable in unix but have never dealt with DB2 Connect there. (my main job is as an Oracle DBA, and most of my db's are on Solaris or AIX) I've found the install...
5
5701
by: mayamorning123 | last post by:
A comparison among six VSS remote tools including SourceOffSite , SourceAnyWhere, VSS Connect, SourceXT, VSS Remoting, VSS.NET To view the full article, please visit http://www.BetterVssRemoting.com Better VSS Remote Access Tool This article makes a detailed comparison among SourceAnyWhere 4.0, SourceOffSite 4.1, VSS Connect 1.5, SourceXT 2.1, VSS Remoting 2.5,
2
2752
by: xiuchuanli | last post by:
I install Fedora 4 with web server, after that I installed mysql 5.0.15. Now I can connect to mysql from command line and mysql-administrator and mysql-query-browser. But when I try to test to connect from php code, it told me that "can not connect to local mysql through /tmp/mysql.sock. /tmp/mysql.sock is my sock file to connect and permission is set good. when I add phpinfo() to my php code, it show me that mysql lib php uses is 4.1.X,...
2
4522
by: Mondal | last post by:
Hi, I am using MySQL 5.0 beta and Active Python 2.4. I have the correct version of MySQLdb installed. The problem is that I can't connect to MySQL through the Active Python interactive window. Here is a sample error: >>> c=MySQLdb.Connect(host='localhost',user='root',passwd='',db='shop',port=3306) Traceback (most recent call last):
3
4274
by: asemeiks | last post by:
I'm using Access 97, Jet 4.0. the data resides on a Win 2000 domain server. Using .Net 1.1 and IIS 5.0 on a local XPPro computer I am trying connect to a Jet database on the server. If the data source is on the local computer I can connect ok. If it is is on the server I cannot connect and get the following error. 'Error message. "The Microsoft Jet database engine cannot open the file ''. It is already opened exclusively by another...
3
1695
by: beliavsky | last post by:
I want to write a function that writes to an output file if specified and otherwise to standard output. How can I connect a file object to standard output in the code below? I could use an if statement to choose between print and print>>fp throughout the function, but this seems awkward. I think there is a way to connect standard output to a file, but I'd prefer not to do that, since I want to use plain print statements to warn about...
1
2052
by: GNoter | last post by:
Scenario: I've a WebFarm with 2 web servers which are NLBs (network load balanced). Web1 and Web2; they are not part of a domain. I have a third server, Server3, which is part of a domain and on the same physical network, and it has an MSAccess database which is used on the external webfarm as well as on the internal intranet. I can connect via the intranet because the DB file is on the same box from which the intranet is being served...
0
9931
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, weíll explore What is ONU, What Is Router, ONU & Routerís main usage, and What is the difference between ONU and Router. Letís take a closer look ! Part I. Meaning of...
0
9776
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10724
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10825
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7953
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Duprť who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7113
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4598
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4198
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3226
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.