set rs=dbs.openrecord("select password from pass")
if text1.text=表pass中password字段记录 (请问这里的代码怎么写) then 
  form1.hide 
  form2.show
end if 
改成:
set rs=dbs.openrecord("select password from pass where password='" & text1.text & "'")
'RecordCount大于0表示有此密码在数据库中
if rs.RecordCount>0 then 
  form1.hide 
  form2.show
end if 

解决方案 »

  1.   

    表pass中password字段可以用rs.fields(0) 或者rs.fields("password")来得到
      

  2.   

    if adodc1.recordset("passwd")=textbox.text then
    form2.enabled = ture
    form2.show
    else
    unload.me
    end if 
      

  3.   

    sub private command1_click()
    dim dbs as database
    dim rs as record
    set dba=opendatabase("d:\data.mdb")
    set rs=dbs.openrecord("select password from pass")
    rs.movefirst
    do while not rs.recordset.eof then
        if text.text= rs("pssword") then
           form1.hide 
           form2.show
           exit do 
        end if
        rs.movenext
    loop
    end sub
      

  4.   

    set rs=dbs.openrecord("select password from pass")
    if text1.text=表pass中password字段记录 (请问这里的代码怎么写) then 
      form1.hide 
      form2.show
    end if 
    改成:
    set rs=dbs.openrecord("select password from pass where password='" & trim(text1.text) & "'")
    if not rs.eof then 
      form1.hide 
      form2.show
    end if