1: 我在用DAO对象时,能建立dim a1 as database语句
却不能建立dim a2 as table
请问这是为什么?
2:在sql语句中,能不能在select语句中用字短名用变量表示,比如说:
data1.recordsource="select * from table1 where" _ & "table1.combo1.text=text1.text"
combo1是供选择的字段!

解决方案 »

  1.   

    1。table是什么咚咚,你想要表吗?VB中没有这个类的。
       其实你可以直接用表名的。
       也可以创建一个querydef.
    2。"select * from table1 where " &  table1.combo1.text " & "= '" & text1.text & "'"
      

  2.   

    2。"select * from table1 where " &  table1.combo1.text & "= '" & text1.text & "'"
      

  3.   

    以上征对字符串,如果是数字,则应该是:
    "select * from table1 where " &  table1.combo1.text & "= " & text1.text
      

  4.   

    只听说有TableDef、QueryDef的,从没听说可以定义Table
    你只要用如下语句就行:
    dim a2 as TableDef (就是数据表了)至于字段名可用如下语句:
    data1.recordsoure="select * from table1 where 字段名=" & 字符变量
    就OK了
      

  5.   

    也就是说
    如果字段名不能确定的话,只要加" & ....& "就行了?是把?