1、等号不能用大写,用小写。 2、如果字段ID是字符型就写成:"SELECT * from Image where id='" & trim(form1.text1.text) & "'"
"SELECT * from Image where id='" & trim(form1.text1.text) & "'"
Form1 中:Public Function GetTextValue() As String GetTextValue = text1.Text End FunctionForm2 中:"SELECT * from Image where id = '" & Form1.GetTextValue () & "'"
呵呵,大家都说了,我补充一点吧,记得对 text 的内容作点处理,不然 ' (单引号)可能会闹事。"SELECT * from Image where id='" & replace(form1.text1.text,"'","''") & "'"
2、如果字段ID是字符型就写成:"SELECT * from Image where id='" & trim(form1.text1.text) & "'"
GetTextValue = text1.Text
End FunctionForm2 中:"SELECT * from Image where id = '" & Form1.GetTextValue () & "'"