Myrath wrote:
>
> I know this part is right... but after that.. I cannot be certain.
>
> Thanks a million!
>
> mvdmeij@kabelfoon.nl
>
> Private Sub cb_ok_Click()
>
> Dim DBFILE As Database
> Set DBFILE = OpenDatabase("c:\databasefile.mdb")
>
> end sub
So I'll just add what you need
Of course you have selected Project -> References -> Microsoft DAO.....
Private Sub cb_login_Click()
Dim DAO_Workspace As Workspace
Dim DAO_Database As Database
Dim DAO_recordset As Recordset
Dim SQL As String
SQL = "SELECT username,password from usernames where Username='" _
& tb_username.Text & "' and password='" & tb_password.Text & "';"
Set DAO_Workspace = CreateWorkspace("", "admin", "")
Set DAO_Database = DAO_Workspace.OpenDatabase("c:\db1.mdb")
Set DAO_recordset = DAO_Database.OpenRecordset(SQL)
If DAO_recordset.BOF And DAO_recordset.EOF Then
Call MsgBox("You do not have access")
Else
Call MsgBox("Welcome!")
End If
End Sub
--
/Lars
HTML software: <
http://go.to/HTMLEasyColors>
Brug venligst Re: og ikke Sv: ved svar, da beskeder
der begynder med Sv: bliver slettet fra mange servere