Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2005

    Unanswered: create dbase table with vb6

    Hello !

    I want to creat and fill an Widget.dbf file using vb6.
    I know that is possible to update (fill) the table only if I use Ms Dao 3.51 Object library (not 3.6) reference.

    this is the code

    Dim myWS As Workspace
    Dim mydb As Database
    Dim myTDef As TableDef
    Dim myRS As Recordset
    Dim myFld As Field
    Set mydb = OpenDatabase("C:\Temp\", False, 0, "DBase 5.0;")
    Set myTDef = mydb.CreateTableDef("Widget.dbf")
    With myTDef
    .Fields.Append .CreateField("PartDesc", dbText, 8)
    .Fields.Append .CreateField("inv1", dbInteger, 4)
    .Fields.Append .CreateField("inv2", dbInteger, 4)
    End With

    mydb.TableDefs.Append myTDef
    Set SQL = mydb.CreateQueryDef("")
    SQL.SQL = "select * from Widget.dbf;"
    Set myRS = SQL.OpenRecordset()
    With myRS
    !PartDesc = "Widget"
    !inv1 = 4
    !inv2 = 3
    End With

    The problem:
    1)if I use dao 3.6 debugger stops on ".AddNew" with error :
    "Cannot update. Database or object is read-only."
    2)if I use dao 3.51 debugger stops on "Set mydb = OpenDatabase("C:\Temp\", False, 0, "DBase 5.0;")"
    with error:"Couldn't find installable ISAM"

    Any suggestion or help ?

    Thank you very much !

  2. #2
    Join Date
    Jan 2005


    I had had to install jet4.0 sp8

Posting Permissions

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