select count(loginname) from tablename where loginname=text1.text; if recordsetname.fields(0).value>1 then ... else ... endif
select * from table where loginname='"&text1.text&"'and iD='"&text2.text&"' if rs.RecordCount>0 then '''重复 end if
我是这么写的 怎么就不行呢? Dim sql As String Dim rs As New ADODB.Recordset sql = "Select * from login where loginName='" & TxtLoginName Set rs = TransactSql(sql) If rs.EOF = False Then MsgBox "登陆名已经存在!", vbOKOnly + vbExclamation, "警告!" End If
sql = "Select * from login where loginName='" & Trim(TxtLoginName) & "'"
select count(loginname) from tablename where loginname=text1.text;
if recordsetname.fields(0).value>1 then
...
else
...
endif
if rs.RecordCount>0 then
'''重复
end if
Dim sql As String
Dim rs As New ADODB.Recordset
sql = "Select * from login where loginName='" & TxtLoginName
Set rs = TransactSql(sql)
If rs.EOF = False Then
MsgBox "登陆名已经存在!", vbOKOnly + vbExclamation, "警告!"
End If