If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Visual Basic > FOXPRO 2.5 Table Created From VB6 - Not a Database File Error

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-22-11, 03:17
andyxis andyxis is offline
Registered User
 
Join Date: Feb 2011
Posts: 3
FOXPRO 2.5 Table Created From VB6 - Not a Database File Error

Hi experts, I've tried using DAO and ADOX to create dbase tables from VB6. The problem with these is that I can't manipulate the width and decimal places of the fields with a numeric data type. I guess, this is because "Jet DB engine that VB uses tends to translate field types and sizes into what it 'thinks' are correct for a field", as stated from a post.

So I'm trying to create tables directly in Foxpro 2.5 from VB6 using the codes below:
Code:
Global fx As New FoxApplication

Set fx = Nothing

fx.OleRequestPendingTimeout = 900000
fx.OleServerBusyTimeout = 900000

fx.DefaultFilePath = LPath

fx.DoCmd "CLOSE DATABASES"
fx.DoCmd "USE customer.dbf"
fx.DoCmd "COPY STRUCTURE TO TEST"
fx.DoCmd ("USE")
Also this,
Code:
fx.DoCmd ("CREATE TABLE TEST.dbf (FNAME C(12))")
The program runs w/o errors, and I can also see from the files that the table TEST.dbf is created. But I can't open it in Foxpro. The error says, "Not a Database file".

I have also tried using the SQL statement:
Code:
rs.open "CREATE TABLE TEST (col1 char(6), col2 int(2))", conn, adOpenStatic, adLockOptimistic, adCmdText
which displays the same error from Foxpro 2.5.

I've also searched from the net about this error and had found some codes that checks and repairs the no. of records in the header. Still, to no avail. If you want to see the codes I found, I'll post it here. It's kinda long.

Please, if anyone has some ideas about this, kindly share it to me.. Please shed some light..

Or if there are other solutions on how to create dbase III tables from vb6 (where I can manipulate the width and decimal places of the numeric fields), please post it here.. Thank you all in advance!
Reply With Quote
  #2 (permalink)  
Old 02-22-11, 14:00
kitaman kitaman is offline
Papabi's friend
 
Join Date: Sep 2009
Location: Ontario
Posts: 629
There may be some help here. xHarbour.org
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On