Unanswered: 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:
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 ("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'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!