access数据库已有表Goods(id text(8),...),id是主键,
要新建一个表,goodsprice,字段:id,price,
id是指向goods.id的,price默认值0,
用ado的语句来生成,如何写?xiexie!
谢谢!

解决方案 »

  1.   

    select id,0 as price into goodsprice from goods
      

  2.   

    ado建立表
    Option ExplicitPublic Sub NewTable()       
       Dim tbl As New Table
       Dim cat As New ADOX.Catalog
       cat.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\test.mdb;"tbl.Name = "WorkTable"tbl.Columns.Append "序号", adInteger
    tbl.Columns.Append "姓名", adVarWChar, 10
    cat.Tables.Append tbl 
    End SubPrivate Sub Form_Load()
      Call NewTable
    End Sub对于指向问题也就是access的关系,自行在数据库中间控制就可以了
      

  3.   

    to  Leftie(左手,为人民币服务)
    price 需要 货币类型,如何写?
    :)