weixin_45671945 2020-06-25 15:14 采纳率: 0%
浏览 275

至少一个参数没有被指定值是怎么回事?

图片说明图片说明
其中问号是han'zi
详细代码:
Private Sub cmdCancel_Click()
DoCmd.Close
End Sub

Private Sub cmdOk_Click()
Dim rs As New ADODB.Recordset
Dim txtSQL As String
If IsNull(txtName) = True Or IsNull(txtPwd1) = True Then
MsgBox "?????????????????", vbExclamation, "????"
txtName.SetFocus
Exit Sub
ElseIf txtPwd1 <> txtPwd2 Or IsNull(txtPwd2) = True Then
MsgBox "??????£???????????", vbExclamation, "????"
txtName.SetFocus
Exit Sub
Else
txtSQL = "select * from ????? where ??????? = ' " & txtName & " ' "
rs.Open txtSQL, CurrentProject.Connection, adOpenStatic, adLockReadOnly
If rs.RecordCount <> 0 Then
MsgBox "????????", vbExclamation, "????"
txtName.SetFocus
rs.Close
Exit Sub
Else
txtSQL = "select * from ?????"
rs.Close
Set rs = New ADODB.Recordset
rs.Open txtSQL, CurrentProject.Connection, adOpenStatic, adLockPessimistic
rs.AddNew
rs!????? = txtName
rs!???? = txtPwd1
rs.Update
MsgBox "?????", vbInformation, "?????"
txtName = ""
txtPwd1 = ""
txtPwd2 = ""
txtName.SetFocus
End If
End If
End Sub

  • 写回答

1条回答 默认 最新

  • threenewbee 2020-06-25 15:19
    关注

    sql里面用户名称=后面的两个引号,应该用英文半角的。并且中间不要有多余的空格。

    问题解决的话,请点下采纳。

    评论

报告相同问题?

悬赏问题

  • ¥15 Excel发现不可读取的内容
  • ¥15 UE5#if WITH_EDITOR导致打包的功能不可用
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题
  • ¥20 yolov5自定义Prune报错,如何解决?
  • ¥15 电磁场的matlab仿真
  • ¥15 mars2d在vue3中的引入问题
  • ¥50 h5唤醒支付宝并跳转至向小荷包转账界面
  • ¥15 算法题:数的划分,用记忆化DFS做WA求调
  • ¥15 chatglm-6b应用到django项目中,模型加载失败
  • ¥15 CreateBitmapFromWicBitmap内存释放问题。