where 前面要有空格!
语句中字段“可借数量”是文本类型吗?
如果是的话:
sql3 = "update tb_cxsb set 可借数量='" & w & "' where (tb_jcsb.设备名称='" & Text1.Text & "')"
如果不是的话,不需要加单引号
sql3 = "update tb_cxsb set 可借数量=" & w & " where (tb_jcsb.设备名称='" & Text1.Text & "')"
就这一段代码来看,最可疑的是:
Adodc1.RecordSource = "select*from 库存 where " & condition & "=" & Text1.Text & ""
这句,改成:
Adodc1.RecordSource = "select * from 库存 where " & condition &"='" & Text1.Text & '"
试试看。
不知你查询的数据是文本型还是数字型
查询为文本型
sql = "select * from 双色球 where 期号='" & List1.Text & "'"
数据型
strSql = "select * from 存包记录 where 箱子号=" & Val(Text3)
有2句RS.Open strSql, conn, 1, 1,哪一句出错?
strSql = "select * from 系统用户表 where 用户名 ='" & txtUserName.Text & "' and 密码 ='" & txtPassword.Text & "'"
注意空格,and 字符的前面应该有一个空格。
sql语句有误。
1、如果密码是掩码的话,应该改为value。
2、如果所有都是文本的话,应该加上单引号,修改后大概如下:
sql1
=
"
insert
into
登陆
(用户,密码,权限)
values
('"
&
Trim(Text1.Text)
&
"','"
&
Trim(Text2.Value)
&
"','"
&
Combo1.Text
&
"')"
conn.Execute
(sql1)