Access数据库查询取值问题,为毛查询条件老被固定在一个值上面?
我的Access下面表里面ProdID1字段下面有:10000000000001 记录
在查询的时候为啥老是提示空值呢?
在监视中查看生成的SQL,条件的值怎么一直是111111??
: SQL : "SELECT TextTable.shuzi
FROM TextTable
WHERE ProdID="11111111";
" : String : Form1.Command1_Click
代码如下:
=====================================================
Dim DBdate As Database数据库 Access VB 查询 变量
Dim MemDate As Recordset
Private Sub Form_Load()
Set DBdate = DBEngine.Workspaces(0).OpenDatabase(App.Path & "\Text.mdb")
End Sub
Private Sub Command1_Click()
Dim prodid3 As String
prodid3 = "10000000000001"
Set MemDate = DBdate.OpenRecordset("select * from TextTable where ProdID1 = "" & prodid3 & """)
Text3.Text = MemDate!prodid1
End Sub