473,395 Members | 1,516 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How do I read and update DbaseIII files.

Hi, the problem I have is that an older dos program is using dbase 3 or 4
database files and I wish to add a little utility that scanns this database,
and if specific record has a certain entry (flag) i wish to extract all of
the records for this entry change the flag in the dbase file and write it
into a new mdb database. The second part is no problem, i can hook into mdb
databases and do all that stuff, but I cannot seem to create a proper
connection with a dbase file.

Problem: How do I set a connection corectly with a sample.dpf sample.ndx,
and read and write records into this dataset.

Any help would be great
Nov 20 '05 #1
3 5465
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
-------------------
"Frank" <frank> wrote in message
news:up**************@TK2MSFTNGP12.phx.gbl...
Hi, the problem I have is that an older dos program is using dbase 3 or 4
database files and I wish to add a little utility that scanns this database, and if specific record has a certain entry (flag) i wish to extract all of
the records for this entry change the flag in the dbase file and write it
into a new mdb database. The second part is no problem, i can hook into mdb databases and do all that stuff, but I cannot seem to create a proper
connection with a dbase file.

Problem: How do I set a connection corectly with a sample.dpf sample.ndx,
and read and write records into this dataset.

Any help would be great

Nov 20 '05 #2
I can import a dBase 5 table to a datatable in a dataset.
No idea if this works for older versions.

================================================== =========
strSQL = "SELECT * FROM [" & dBaseTableName & "]"
If strFileFormat = "dBase 5.0" Then
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strPath &
";Extended Properties=""dBase 5.0"""
End If

Dim obj As New DAL(strConn)
obj.FillTable(dsMain, strTableName, strSQL, "OLEDB")
================================================== =========
In my DAL (data access layer) I have a FillTable method:
================================================== =========
Public Sub FillTable(ByRef ds As DataSet, ByVal TableName As String, ByVal
strSQL As String, ByVal DBtype As String)
If DBtype = "SQL Server" Then
'do something
ElseIf DBtype = "Oracle" Then
'do something
ElseIf DBtype = "OLEDB" Then
Dim da As OleDbDataAdapter
Dim cnn As New OleDbConnection(mConnStr)
Dim cmd As New OleDbCommand(strSQL, cnn)
Try
cmd.CommandType = CommandType.Text
cnn.Open()
da = New OleDbDataAdapter(cmd)
da.Fill(ds, TableName)
Catch exc As Exception
Throw exc
Finally
cnn.Close()
End Try
End If
End Sub
================================================== =========
--
Joe Fallon

"Frank" <frank> wrote in message
news:up**************@TK2MSFTNGP12.phx.gbl...
Hi, the problem I have is that an older dos program is using dbase 3 or 4
database files and I wish to add a little utility that scanns this database, and if specific record has a certain entry (flag) i wish to extract all of
the records for this entry change the flag in the dbase file and write it
into a new mdb database. The second part is no problem, i can hook into mdb databases and do all that stuff, but I cannot seem to create a proper
connection with a dbase file.

Problem: How do I set a connection corectly with a sample.dpf sample.ndx,
and read and write records into this dataset.

Any help would be great

Nov 20 '05 #3
Hi Frank,

You can access dbase files as datatables etc just as any other ado .net
object if you use the odbc provider for .net. If you have vs .net 2003 you
have it and need only set the correct import statements; if an earlier
version, you can download it and install it from msdn.microsoft.com.

HTH,

Bernie Yaeger

"Frank" <frank> wrote in message
news:up**************@TK2MSFTNGP12.phx.gbl...
Hi, the problem I have is that an older dos program is using dbase 3 or 4
database files and I wish to add a little utility that scanns this database, and if specific record has a certain entry (flag) i wish to extract all of
the records for this entry change the flag in the dbase file and write it
into a new mdb database. The second part is no problem, i can hook into mdb databases and do all that stuff, but I cannot seem to create a proper
connection with a dbase file.

Problem: How do I set a connection corectly with a sample.dpf sample.ndx,
and read and write records into this dataset.

Any help would be great

Nov 20 '05 #4

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

Similar topics

10
by: Yang Li Ke | last post by:
Hi guys! I have some datas that I must check everytime a visitor comes to my site What is better to do: 1- Read data from a file or 2- Read data from a mysql db Thank you
6
by: Maurice Mertens | last post by:
Hi, how can I open and read a DbaseIII file in .NET? -- Met vriendelijke groet / With regards / Saludos, Moviat Automatisering
1
by: David Gresser | last post by:
When I import a dbaseiii database into access, one of the fields which was a memo field in dbase now contains a wierd char that looks like an I with an accent over it followed by a box. This...
2
by: Jonny | last post by:
Hey all I'm looking for the fastest way to read/write/update/append xml files. Fairly complicated, large scale files It needs to be scalable, but very fast Any idea's Thanks
5
by: JenHu | last post by:
Hi experts, I wrote a function which retrieves a file in the folder, the file path is : Dim sr As New StreamReader(strFilepath & ReturnFileName) What if I have more than 1 file_name in...
1
by: eiji | last post by:
Hi folks, I'm new to binary-file handling and try to work/learn playing around with MD5. Now everything works fine with small files, but when files get bigger(e.g. 28MB) this loop stops in the...
35
by: RyanS09 | last post by:
Hello- I am trying to write a snippet which will open a text file with an integer on each line. I would like to read the last integer in the file. I am currently using: file = fopen("f.txt",...
2
by: jwt007 | last post by:
Hello everyone, I have a very specific need to detect rollbacks within a certain table in the database. To do this I am actively monitoring the transaction log with a small C++ program (using...
0
by: mukil | last post by:
Importing DbaseIII data to sql 2005 using asp Coding platform windows server 2003 awaitinf for reply regards, mukil
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.