By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,587 Members | 1,891 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,587 IT Pros & Developers. It's quick & easy.

Data Connections into dBase files

P: n/a
Hi,
Please help me with Data Connections into dBase files.
I have catalog with lot of files like *.dbf and *.mdx . Every file contains
one table (I can see it in MS Access).
How can I make connections into this/that folder/files in VB.NET project?
Tomek
Nov 20 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
* "Tomek" <tn******@bcdplus.pl> scripsit:
Please help me with Data Connections into dBase files.
I have catalog with lot of files like *.dbf and *.mdx . Every file contains
one table (I can see it in MS Access).


Just FYI:

There is a separate group for .NET + database related questions
available:

<URL:news://news.microsoft.com/microsoft.public.dotnet.framework.adonet>

Web interface:

<URL:http://msdn.microsoft.com/newsgroups/?dg=microsoft.public.dotnet.framework.adonet>

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #2

P: n/a
Hi Tomek,

Made on the fly
\\\
Dim connString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\MyFile.mdb;"
Dim Conn As New OleDb.OleDbConnection(connString)
Dim oledbStr as String = "Select * from Mytable"
Dim ds as New DataSet
Try
Dim da As New OleDb.OleDbDataAdapter(oledbStr, Conn)
da.Fill(ds)
Catch oledbExc As OleDb.OleDbException
MessageBox.Show(oledbExc.ToString)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
///
Ma nadzieje ze to pomoze?

Cor
Nov 20 '05 #3

P: n/a
Hi,

It has been a while since I opened a dbase file. You do it the same
as with access but use this as the connection string
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source= directory with dbase files;
Extended Properties=DBase III;". To open sample.dpf use this as your sql
statement. Select * from sample. Hope this helps.

Ken
-------------------
"Tomek" <tn******@bcdplus.pl> wrote in message
news:%2******************@TK2MSFTNGP09.phx.gbl...
Hi,
Please help me with Data Connections into dBase files.
I have catalog with lot of files like *.dbf and *.mdx . Every file
contains
one table (I can see it in MS Access).
How can I make connections into this/that folder/files in VB.NET project?
Tomek

Nov 20 '05 #4

P: n/a
check out http://www.able-consulting.com/ADO_Conn.htm

He has every connection string you can think of.

--
Frank Hoover
"Tomek" <tn******@bcdplus.pl> wrote in message
news:%2******************@TK2MSFTNGP09.phx.gbl...
Hi,
Please help me with Data Connections into dBase files.
I have catalog with lot of files like *.dbf and *.mdx . Every file contains one table (I can see it in MS Access).
How can I make connections into this/that folder/files in VB.NET project?
Tomek

Nov 20 '05 #5

P: n/a
Ken,

Thanks I mistreaded it.

Cor
Nov 20 '05 #6

P: n/a
Hi,
Thanks for help.
I'm using connection string:
MyConnectionString="Driver={Microsoft dBASE Driver
(*.dbf)};DriverID=277;Dbq=my_dbf_folder_path"

The problem is:
How can I use it in DataGrid or other ways to edit\add data?

I have following code:
connODBC = New OdbcConnection(MyConnectionString)
connODBC.Open()
commODBC = New OdbcCommand("Select * from NAMES.DBF", connODBC)
daODBC = New OdbcDataAdapter(commODBC)
cbODBC = New OdbcCommandBuilder(daODBC)
dsODBC = New DataSet("X")
'daODBC.Fill(dsODBC, "XX")
dg.SetDataBinding(dsODBC, "XX")
It correctly displays table Names.DBF in my DataGrid (dg). What should I add
to this code to make available edit/add?

Tomek
Nov 20 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.