小弟寫程式遇到兩個蠻棘手的問題,可否請各位大大幫忙!
首先是我要如何呼叫access中資料項目內容?
再者 如何引用資料庫中內容作加減乘除之計算?
煩請站長大人幫忙,麻煩之處 甚感歉意.
Private Sub Form_Activate()
Dim Counters As Integer
Dim strname As String
Dim strword As String
Dim strname1 As String
Dim strword1 As String
strname = InputBox("請輸入使用者姓名:", "使用者姓名")
strword = InputBox("請輸入使用者密碼:", "使用者密碼")
password.Recordset.FindFirst "使用者姓名 = " & "'" & strname1 & "'" '此處為什麼沒有反應
' password.Recordset.FindFirst "使用者密碼 = " & "'" & strword1 & "'" '此處為什麼沒有反應
If (strword = strword1) + (strword = strword1) Then
Call user_Click
Else
MsgBox "登入資料錯誤,請重新啟動本系統 !"
End If
End Sub
煩請各位大大幫忙解決小弟疑惑,感恩!
首先是我要如何呼叫access中資料項目內容?
再者 如何引用資料庫中內容作加減乘除之計算?
煩請站長大人幫忙,麻煩之處 甚感歉意.
Private Sub Form_Activate()
Dim Counters As Integer
Dim strname As String
Dim strword As String
Dim strname1 As String
Dim strword1 As String
strname = InputBox("請輸入使用者姓名:", "使用者姓名")
strword = InputBox("請輸入使用者密碼:", "使用者密碼")
password.Recordset.FindFirst "使用者姓名 = " & "'" & strname1 & "'" '此處為什麼沒有反應
' password.Recordset.FindFirst "使用者密碼 = " & "'" & strword1 & "'" '此處為什麼沒有反應
If (strword = strword1) + (strword = strword1) Then
Call user_Click
Else
MsgBox "登入資料錯誤,請重新啟動本系統 !"
End If
End Sub
煩請各位大大幫忙解決小弟疑惑,感恩!
文章標籤
全站熱搜

>如何呼叫access中資料項目內容? 全文檢索 "access",有很多相關討論 >作加減乘除之計算? 取得資料內容,代入變數,再以變數直接去作加減乘除 >strname = InputBox("請輸入使用者姓名:", "使用者姓名") >password.Recordset.FindFirst "使用者姓名 = " & "'" & strname1 & "'" '此處為什麼沒有反應 資料庫內容有這個欄位名稱嗎? "使用者姓名",如果有建議欄位名稱最好用英文 上面輸入變數是strname,下面搜尋變數是strname1,怎麼找得到? >If (strword = strword1) + (strword = strword1) Then 如果是合併(同時)判斷,應將"+"改為"And" 站長當兵去,小弟濫竽充數!!
感謝大大回覆 首先是strname是用Input()函數去讓使用者輸入的 strname1是從資料庫裡要取回作比對的 strword是用Input()函數去讓使用者輸入的 strword1是從資料庫裡要取回作比對的 小弟現在的問題是無法將資料庫裡的使用者姓名(strname1)的內容以 及使用者密碼(strword1)與使用端所輸入的資料作比對 ,因為資 料庫裡 ,所記載的資料不只一筆. 至於大大所提搜尋的部分,恕小弟愚昧,我真的看了快一個星期, 仍然未有所獲,所以不得不求救的,學到老前輩希望能體諒小弟 的提問,仍請解答小弟的問題,再次感恩!
去收信看看範例吧!
去收信看看範例吧!
去收信看看範例吧!
Sorry! 網頁重整,不小心多按了二下
ADO 裡好像沒有 RECORDSET.FINDFIRST 只有 RECORDSET.FIND
FindFirst, FindLast, FindNext, FindPrevious Methods Locates the first, last, next, or previous record in a dynaset- or snapshot-type Recordset object 以上節錄自msdn文件說明 你的問題不在ADO或DAO,變數觀念及語法應用就不對了; 引用資料庫方法好幾種,別人只能先提示或提供一種方法讓你應急先處理問題,剩下的得自己去研究,細節不懂的問題才提出請教他人。
感謝代理站長大大所寄回之範例程式, 出現了 objRec.Open "passwd", objConn, adOpenKeyset, adLockPessimistic SQL語法錯誤 所以 我正積極在尋找SQL與這行程式問題點 ,不過仍是感謝
ㄝ~?!原來學兄是代理站長嗎?!?
Sorry! 我不是,別搞錯! 小弟還沒這能耐! (快快澄清一下) -_-!!
忘了問你是否裝了sp5 ?