vb标准表达式中数据类型不匹配
PrivateSubCmdguihuan_Click()'归还Iftxt_userid(1)=""Then:MsgBox"请输入读者编号":txt_userid(1).S...
Private Sub Cmdguihuan_Click() '归还
If txt_userid(1) = "" Then: MsgBox "请输入读者编号": txt_userid(1).SetFocus: Exit Sub
If txt_userid(0) = "" Then Call Cmdgh_search_Click
Dim i As Integer
For i = 4 To 6
If txt_bookid(i) <> "" And Check1(i - 3).Value = 1 Then
If rds_jieyue.State = adStateOpen Then rds_jieyue.Close
rds_jieyue.Open "SELECT 图书借阅.图书编号, 图书.书名 FROM 图书借阅 INNER JOIN 图书 ON 图书借阅.图书编号=图书.图书编号 where 图书.书名='" + txt_bookid(i) + "'", conn, adOpenKeyset, adLockOptimistic, 1
conn.Execute "delete * from 图书借阅 where 读者编号='" + txt_userid(1) + "' AND 图书编号='" + rds_jieyue.fields(0) + "' AND 借书日期='" + lbl_lenddate(i) + "'"
rds_jieyue.Close
Check1(i - 3).Value = 0
txt_bookid(i) = ""
txt_bookid(i - 3) = ""
txt_bookid(i - 3).Locked = False
txt_bookid(i - 3).ForeColor = vbBlack
txt_bookid(i - 3).BackColor = vbWhite
lbl_lenddate(i) = Date
lbl_lenddate(i - 3) = Date
lbl_msg(0) = ""
lbl_msg(1) = ""
End If
Next i
Cmdjieyue.Enabled = True
End Sub
这段代码中conn.Execute "delete * from 图书借阅 where 读者编号='" + txt_userid(1) + "' AND 图书编号='" + rds_jieyue.fields(0) + "' AND 借书日期='" + lbl_lenddate(i) + "'"
这句话会出现数据类型不匹配的问题?不知道怎么改?我看的别人的代码,别人可以运行的啊。。。是不是数据库的问题???该怎么改呢?
还是那样啊~~不对啊 展开
If txt_userid(1) = "" Then: MsgBox "请输入读者编号": txt_userid(1).SetFocus: Exit Sub
If txt_userid(0) = "" Then Call Cmdgh_search_Click
Dim i As Integer
For i = 4 To 6
If txt_bookid(i) <> "" And Check1(i - 3).Value = 1 Then
If rds_jieyue.State = adStateOpen Then rds_jieyue.Close
rds_jieyue.Open "SELECT 图书借阅.图书编号, 图书.书名 FROM 图书借阅 INNER JOIN 图书 ON 图书借阅.图书编号=图书.图书编号 where 图书.书名='" + txt_bookid(i) + "'", conn, adOpenKeyset, adLockOptimistic, 1
conn.Execute "delete * from 图书借阅 where 读者编号='" + txt_userid(1) + "' AND 图书编号='" + rds_jieyue.fields(0) + "' AND 借书日期='" + lbl_lenddate(i) + "'"
rds_jieyue.Close
Check1(i - 3).Value = 0
txt_bookid(i) = ""
txt_bookid(i - 3) = ""
txt_bookid(i - 3).Locked = False
txt_bookid(i - 3).ForeColor = vbBlack
txt_bookid(i - 3).BackColor = vbWhite
lbl_lenddate(i) = Date
lbl_lenddate(i - 3) = Date
lbl_msg(0) = ""
lbl_msg(1) = ""
End If
Next i
Cmdjieyue.Enabled = True
End Sub
这段代码中conn.Execute "delete * from 图书借阅 where 读者编号='" + txt_userid(1) + "' AND 图书编号='" + rds_jieyue.fields(0) + "' AND 借书日期='" + lbl_lenddate(i) + "'"
这句话会出现数据类型不匹配的问题?不知道怎么改?我看的别人的代码,别人可以运行的啊。。。是不是数据库的问题???该怎么改呢?
还是那样啊~~不对啊 展开
1个回答
TableDI
2024-07-18 广告
2024-07-18 广告
VLOOKUP函数在Excel中主要用于垂直查找数据,但无法直接一次性匹配多行数据。若要实现这一功能,可以采取以下方法:1. 使用辅助列和数组公式,通过IF函数结合TE电商平台TJOIN函数将多个匹配值合并到一个单元格中。2. 利用VLOO...
点击进入详情页
本回答由TableDI提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询