Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hack VFP Database format

Status
Not open for further replies.

MarkButler

Programmer
Feb 22, 2001
83
0
0
US
I was wondering if anyone has documented the internals of the .DBC fields. I want to copy a database programatically and convert all local tables and local views. The tables would be used to generate a program containing the MS SQL "CREATE TABLE" to define the tables to SQL. The local views would be copied and then point them at the remote database.

Anyone know how to do this or where to look for documentation?
 
Look in fox help file at:
../FOXHELP.CHM::/html/contable_file_structure_lp.dbfrp.htm

../ backtracks to the location of your foxpro help file's location.


* This is the start of text you are interested in

Table File Structure (.dbc, .dbf, .frx, .lbx, .mnx, .pjx, .scx, .vcx)
See Also

Visual FoxPro uses tables to store data that defines different file types. The file types that are saved as table files are:

Table (.dbf)

Database (.dbc)
<snip>...

A little more of what you're looking for:

Table Header Record Structure
Byte offset Description
0 Type of file
0x02FoxBASE
0x03FoxBASE+/dBASE III PLUS, no memo
0x30Visual FoxPro
0x43dBASE IV SQL table files, no memo
0x63dBASE IV SQL system files, no memo
0x83FoxBASE+/dBASE III PLUS, with memo
0x8BdBASE IV with memo
0xCBdBASE IV SQL table files, with memo
0xF5FoxPro 2.x (or earlier) with memo
0xFBFoxBASE
1 – 3 Last update (YYMMDD)

<snip>...



Darrell 'We all must do the hard bits so when we get bit we know where to bite' :)
 
Oh sorry!

Just search on .dbc in the help file.

Or at MSDN online.

Darrell 'We all must do the hard bits so when we get bit we know where to bite' :)
 
have you concidered using the gendbc.prg file that comes with fox?

* Creates MYDATA.prg which contains code to
* re-create the database MyDatabase.
*
OPEN DATABASE MyDatabase
DO gendbc WITH 'MyData.prg'
*

*
* Creates Main.prg in the C:\VFP folder which
* contains code to re-create the database Main.
*
SET DATABASE TO Main
DO gendbc WITH 'c:\vfp\main'

Located in the Visual FoxPro Tools\Gendbc folder, this tool generates a program that can re-create a database. Use this program to:

Generate code you can analyze to learn how a database is created via program code.


Generate code that can be placed in your program code eliminating the need to ship your databases with your application.


Generate code that can be placed in your program code to re-create the database if a customer’s data is corrupt

would provided you with the code to do the grunt work. Attitude is Everything
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top