首页上一页 1 下一页尾页 1 条记录 1/1页
数据
发表在VB答疑区
2010-09-21
是否精华
是
否
版块置顶:
是
否
Private Sub Command1_Click()
Dim ADOrs As New Recordset
Dim strAccess As String
Dim strÐÔ±ð As String
ADOrs.ActiveConnection = ADOcn
ADOrs.Open "select 学号 from 学生
If Not ADOrs.EOF Then
MsgBox”存在”.1+32
Else
If Option1.Value Then
Str性别=“男”
Else
Str性别=“女”
End If
rtrAccess = "insers into 学生(学号,姓名,性别)“
rtrAccess = rtrAccess + " values('" + Text1 + "','"
rtrAccess = rtrAccess + Text2 + "','" + str性别+ "')"
ADOcn.Execute strAccess
MsgBox "已添加新记录"
End If
End Sub
为什么会显示无效的SQL语句,期待'DELETE'、'INSERT、'PROCEDURE'、或'SELECT、或'UPDATE'.
亲爱的老师。帮帮你那可爱徒弟 吧
Dim ADOrs As New Recordset
Dim strAccess As String
Dim strÐÔ±ð As String
ADOrs.ActiveConnection = ADOcn
ADOrs.Open "select 学号 from 学生
If Not ADOrs.EOF Then
MsgBox”存在”.1+32
Else
If Option1.Value Then
Str性别=“男”
Else
Str性别=“女”
End If
rtrAccess = "insers into 学生(学号,姓名,性别)“
rtrAccess = rtrAccess + " values('" + Text1 + "','"
rtrAccess = rtrAccess + Text2 + "','" + str性别+ "')"
ADOcn.Execute strAccess
MsgBox "已添加新记录"
End If
End Sub
为什么会显示无效的SQL语句,期待'DELETE'、'INSERT、'PROCEDURE'、或'SELECT、或'UPDATE'.
亲爱的老师。帮帮你那可爱徒弟 吧