rs_changpass.Open("select s_username,s_pass from s_user where s_username='" & UCase(Trim(TextBox2.Text)) & "'", cn, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockOptimistic)
if rs_changpass.RecordCount = 0 Then
rs_changpass.addnew
rs_changpass.Fields("s_pass").Value = TextBox3.Text
rs_changpass.Update()
else
rs_changpass.Fields("s_pass").Value = TextBox3.Text
rs_changpass.Update()
End If
怎么rs_changpass.RecordCount的值为-1呢? 更新数据没问题
再看看下面的.
rs_changpass.Open("select s_username,s_pass from s_user where s_username='" & UCase(Trim(TextBox2.Text)) & "'", cn, ADODB.LockTypeEnum.adLockOptimistic)
if rs_changpass.RecordCount = 0 Then
rs_changpass.addnew
rs_changpass.Fields("s_pass").Value = TextBox3.Text
rs_changpass.Update()
else
rs_changpass.Fields("s_pass").Value = TextBox3.Text
rs_changpass.Update()
End If
这样rs_changpass.RecordCount查出的值就对,但是更新数据rs_changpass.Fields("s_pass").Value = TextBox3.Text
的时侯报错
请问怎样可以得到rs_changpass.RecordCount的值是正确的,又可以更新数据,谢谢!
[此贴子已经被作者于2007-6-22 11:17:50编辑过]

程序人员写程序,又拿程序换酒钱。 奔驰宝马贵者趣,公交自行程序员。 不见满街漂亮妹,哪个归得程序员。