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

Visual Basic.Net & DBF files

P: n/a
I have been given the task of converting a program from VFP (visual
foxpro) to Visual Basic.net. My question is "Is it possible to
generate a DBF file Dynamically(at runtime) using Visual Basic.Net?"
With all the field properties, such as, field length and type. I'm not
sure if this is a stupid quesiton or If I am just over looking
something, but I have not found solid information on the internet about
this topic.

Any useful information would greatly be appreciated.

Further Information:
1. The program I am coding, opens up various types of data (.txt,
..xls, .dbf) and processes the data files and then exports as a .dbf
file.

2. The program also opens existing dbf files, searches for companies,
and the then alters the dbf file and also creates a new dbf with just
company names.

Since the primary postal software that we use only supports dbf files,
I need to generate dbf files. (note: all the data files I am working
with do not have the same pattern, they come in different structures
(different data columns))

I have been pondering on a few things about this topic but am seeking
professional advise before I start programming.

Sep 4 '06 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Hello JimmyKoolPantz,

Check out System.Data.OleDb, and connectionstrings.com

Enjoy
-Boo
I have been given the task of converting a program from VFP (visual
foxpro) to Visual Basic.net. My question is "Is it possible to
generate a DBF file Dynamically(at runtime) using Visual Basic.Net?"
With all the field properties, such as, field length and type. I'm not
sure if this is a stupid quesiton or If I am just over looking
something, but I have not found solid information on the internet
about this topic.

Any useful information would greatly be appreciated.

Further Information:
1. The program I am coding, opens up various types of data (.txt,
.xls, .dbf) and processes the data files and then exports as a .dbf
file.
2. The program also opens existing dbf files, searches for companies,
and the then alters the dbf file and also creates a new dbf with just
company names.

Since the primary postal software that we use only supports dbf files,
I need to generate dbf files. (note: all the data files I am working
with do not have the same pattern, they come in different structures
(different data columns))

I have been pondering on a few things about this topic but am seeking
professional advise before I start programming.

Sep 4 '06 #2

P: n/a
Hi Jimmy,

Assuming that your DBFs are FoxPro files you can use the latest FoxPro and
Visual FoxPro OLE DB data provider, downloadable from
msdn.microsoft.com/vfoxpro/downloads/updates . You can create tables using
the CREATE TABLE statement; you can read about it in the VFP section of the
MSDN Library.

--
Cindy Winegarden MCSD, Microsoft Most Valuable Professional
ci***@cindywinegarden.com
"JimmyKoolPantz" <ko*******@gmail.comwrote in message
news:11**********************@p79g2000cwp.googlegr oups.com...
>..... "Is it possible to
generate a DBF file Dynamically(at runtime) using Visual Basic.Net?"
With all the field properties, such as, field length and type. ......

Sep 5 '06 #3

P: n/a
Hi Jimmy,

Another thing that you should consider is how index files associated
with the .DBF's will be updated.

Ayon kay JimmyKoolPantz:
I have been given the task of converting a program from VFP (visual
foxpro) to Visual Basic.net. My question is "Is it possible to
generate a DBF file Dynamically(at runtime) using Visual Basic.Net?"
With all the field properties, such as, field length and type. I'm not
sure if this is a stupid quesiton or If I am just over looking
something, but I have not found solid information on the internet about
this topic.

Any useful information would greatly be appreciated.

Further Information:
1. The program I am coding, opens up various types of data (.txt,
.xls, .dbf) and processes the data files and then exports as a .dbf
file.

2. The program also opens existing dbf files, searches for companies,
and the then alters the dbf file and also creates a new dbf with just
company names.

Since the primary postal software that we use only supports dbf files,
I need to generate dbf files. (note: all the data files I am working
with do not have the same pattern, they come in different structures
(different data columns))

I have been pondering on a few things about this topic but am seeking
professional advise before I start programming.
Sep 5 '06 #4

P: n/a
Cindy,

The DBF file's will not be FoxPro files, Basically what I will be doing
is converting text file, excel files, CSV files, to DBF files, such as,
What microsoft does when you export a table/query from microsoft
access, and save as a "DBF".

I don't have a problem connecting to a dbf file and creating a dataset
with the file information, but, I do forsee a problem (which I have not
yet began to code) updating or creating a new dbf file. If this is as
easy as generating a xml, txt, excel from visual studio, than this
should not be a problem. One thing I do question is the .cdx file that
is associated with the dbf file. Is this .cdx file required or is this
..cdx file something that vfp has generated. Please keep in mind the
program that I am writing in visual studio will be replacing vfp
program.

a few program details:
The program I am creating imports various data types into
datasets/tables, then processes ithe nformation within the
dataset/tables, then exports as a dbf file. Such as, the way microsoft
access does when you import various file types, and then export as a
dbf file. The only difference is my program has data intelligence that
will determine the length and data type for each column then add a few
columns if needed. This should reduce mistakes, and reduce processing
time.

Another task, is opening a dbf file (an existing dbf file), filter
through each record and seperate residents from companies. Some of our
clients do not want to mail information to companies, so I set up an
xml file with various key words which will be used as filters, I want
to alter the existing dbf file (pull out company names or if needed
create a new dbf file) and I also want to create a new dbf file with
just company names.

Cindy Winegarden wrote:
Hi Jimmy,

Assuming that your DBFs are FoxPro files you can use the latest FoxPro and
Visual FoxPro OLE DB data provider, downloadable from
msdn.microsoft.com/vfoxpro/downloads/updates . You can create tables using
the CREATE TABLE statement; you can read about it in the VFP section of the
MSDN Library.

--
Cindy Winegarden MCSD, Microsoft Most Valuable Professional
ci***@cindywinegarden.com
"JimmyKoolPantz" <ko*******@gmail.comwrote in message
news:11**********************@p79g2000cwp.googlegr oups.com...
..... "Is it possible to
generate a DBF file Dynamically(at runtime) using Visual Basic.Net?"
With all the field properties, such as, field length and type. ......
Sep 5 '06 #5

P: n/a
JimmyKookPanz,

Give this group a try. I know there are some people in here that have
..Net providers for DBF files.

http://groups.google.com/group/comp....-objects?hl=en

Rob

JimmyKoolPantz wrote:
I have been given the task of converting a program from VFP (visual
foxpro) to Visual Basic.net. My question is "Is it possible to
generate a DBF file Dynamically(at runtime) using Visual Basic.Net?"
With all the field properties, such as, field length and type. I'm not
sure if this is a stupid quesiton or If I am just over looking
something, but I have not found solid information on the internet about
this topic.

Any useful information would greatly be appreciated.

Further Information:
1. The program I am coding, opens up various types of data (.txt,
.xls, .dbf) and processes the data files and then exports as a .dbf
file.

2. The program also opens existing dbf files, searches for companies,
and the then alters the dbf file and also creates a new dbf with just
company names.

Since the primary postal software that we use only supports dbf files,
I need to generate dbf files. (note: all the data files I am working
with do not have the same pattern, they come in different structures
(different data columns))

I have been pondering on a few things about this topic but am seeking
professional advise before I start programming.
Sep 5 '06 #6

P: n/a
"JimmyKoolPantz" <ko*******@gmail.comwrote in message
news:11**********************@i3g2000cwc.googlegro ups.com...

Hi Jimmy,
The DBF file's will not be FoxPro files, Basically what I will be doing
is converting text file, excel files, CSV files, to DBF files, such as,
What microsoft does when you export a table/query from microsoft
access, and save as a "DBF".
Using the VFP OLE DB data provider, you can't create Dbase III/IV compatible
files, which is what Excel creates. If the other apps that will consume your
DBFs can access Visual FoxPro tables then you can use the FoxPro OLE DB data
provider. Otherwise you'll have to find something to work with Dbase III/IV
DBFs.
I don't have a problem connecting to a dbf file and creating a dataset
with the file information, but, I do forsee a problem (which I have not
yet began to code) updating or creating a new dbf file. If this is as
easy as generating a xml, txt, excel from visual studio, than this
should not be a problem. One thing I do question is the .cdx file that
is associated with the dbf file. Is this .cdx file required or is this
.cdx file something that vfp has generated. Please keep in mind the
program that I am writing in visual studio will be replacing vfp
program.
Since you're referring to CDX indexes, your DBF tables are FoxPro tables.
Early versions of FoxPro Tables were DBase III/IV compatible. Fox tables
come in 3 parts, the DBF which is the table itself, the FPT (optional) which
contains any data that is in Memo fields, and the CDX (optional) which is an
index file. Other DBF versions have IDX and MDX files (I'm not very familiar
with MDX files). The Fox data engine takes care of keeping CDX indexes
updated if they exist.
a few program details:
The program I am creating imports various data types into
datasets/tables, then processes ithe information within the
dataset/tables, then exports as a dbf file. Such as, the way microsoft
access does when you import various file types, and then export as a
dbf file. The only difference is my program has data intelligence that
will determine the length and data type for each column then add a few
columns if needed. This should reduce mistakes, and reduce processing
time.
Another task, is opening a dbf file (an existing dbf file), filter
through each record and seperate residents from companies. Some of our
clients do not want to mail information to companies, so I set up an
xml file with various key words which will be used as filters, I want
to alter the existing dbf file (pull out company names or if needed
create a new dbf file) and I also want to create a new dbf file with
just company names.
It's really a shame that you're trying to replace a Fox app of this type
with a VB app. Since FoxPro has a built in data engine, the kinds of data
handling that you describe are about 10 times easier in FoxPro than they are
any non-data centric language like VB. Also, Even the latest versions of
FoxPro (Visual FoxPro 9) can export data in the Dbase III/IV compatible
format.

Don't get me wrong - I like VB, but for data manipulation (Visual) FoxPro is
so much easier.

--
Cindy Winegarden MCSD, Microsoft Most Valuable Professional
ci***@cindywinegarden.com
Sep 5 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.