- UID
- 293214
- 帖子
- 382
- 精华
- 0
- 威望
- 1
- 阅读权限
- 100
- 注册时间
- 2005-6-14
|
7#
发表于 2007-6-28 14:30
| 只看该作者
我看了下。可能是这个错。
CREATE TABLE [dbo].[userinfo] (
[UID] [char] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[PWD] [char] (10) COLLATE Chinese_PRC_CI_AS NULL ,
[user_Des] [char] (10) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]
你压缩包里的userinfo这个表的建立sql是这个,注意黑体字
Private Sub cmdOK_Click()
Dim mrc As ADODB.Recordset
Dim strmsg As String
txtSQL = "select uid from userinfo where UID='" & Trim(txtUserName.Text) & "'"
Set mrc = ExecuteSQL(txtSQL, strmsg)
If mrc.EOF = True Then
MsgBox " 用户名错误!", vbExclamation + vbOKOnly, "警告"
txtUserName.SetFocus
txtUserName.SelStart = 0
txtUserName.SelLength = Len(txtUserName.Text)
Exit Sub
End If
UserName = mrc.Fields(0)
txtSQL = "select UID from userinfo where PWD='" & Trim(txtPassword.Text) & "'"
Set mrc = ExecuteSQL(txtSQL, strmsg)
If mrc.EOF = True Then
MsgBox " 密码错误!", vbExclamation + vbOKOnly, "警告"
txtPassword.SetFocus
txtPassword.SelStart = 0
txtPassword.SelLength = Len(txtPassword.Text)
Exit Sub
End If
OK = True
frmMain.Show
Unload Me
End Sub
你的cmdok_Click事件下面的sql里是select uid from userinfo 大小写问题。
把txtSQL = "select uid from userinfo where UID='" & Trim(txtUserName.Text) & "'"这句里的uid改成UID(大写)试试
[ 本帖最后由 tenshinx 于 2007-6-28 14:32 编辑 ] |
|