Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2011

    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 "USE customer.dbf"
    fx.DoCmd ("USE")
    Also this,
    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: "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!

  2. #2
    Join Date
    Sep 2009
    Provided Answers: 1
    There may be some help here.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts