我将下面这句话写到程序里,为什么回提示错误说,你至少有一个参数未指定啊?
……RA.open "select ID from biao where ID=" &str,cnn,adOpenDynamic,adLockOptimistic,1
其中str 是一个String的变量,ID是字段,文本的!
请问各位哪儿错了啊!!!???

解决方案 »

  1.   

    RA.open  "select ID from biao where ID='" & str & "'", cnn, adOpenDynamic, adLockOptimistic检查字段名或表名是否书写正确。
      

  2.   

    字符串变量组合成 sql 语句时,必须用 ' 括起。
    比如 ... where id='abc'...
    如果是变量,就是 ... where id='" & str & "'" ...
      

  3.   

    Private Sub Command1_Click()
        Dim s As String
        Open "d:\test.txt" For Input As #1
        Open "d:\out.txt" For Output As #2
        Do While Not EOF(1)
            Line Input #1, s
            s = Replace(s, "0.00", "")
            Print #2, s
        Loop
        Close
    End Sub这是我在别的帖上摘来得  ,用于替换!