Mandy
08-07-2008, 10:40 PM
Hi there
Can some one tell me how i can make connection between excel and Access.
What i have done so far is this:
i have added one login form in the excel sheet. I wanted to authenticate the user before he/she can use the workbook. user name and password for different users are stored in a Accessdatabase(login table having two field username and password).
here is the code that i had written so far.
Private Sub Workbook_Open()
Dim conn As Connection
Dim cmd As Command
Dim rs As Recordset
On Error Resume Next
Set conn = New ADODB.Connection
conn.ConnectionString = "provider = Microsoft.Jet.OLEDB.4.0;Date Source=C:\Users\Mandeep\Desktop\testing.mdb"
conn.Open
If Err.Number <> 0 Then
MsgBox "Connection error: " & Err.Description
Exit Sub
End If
Set cmd = New ADODB.Command
Set cmd.ActiveConnection = conn
Login.Show
End Sub
:banghead:
can any one advise.:dunno
Thanks
Mandeep
Can some one tell me how i can make connection between excel and Access.
What i have done so far is this:
i have added one login form in the excel sheet. I wanted to authenticate the user before he/she can use the workbook. user name and password for different users are stored in a Accessdatabase(login table having two field username and password).
here is the code that i had written so far.
Private Sub Workbook_Open()
Dim conn As Connection
Dim cmd As Command
Dim rs As Recordset
On Error Resume Next
Set conn = New ADODB.Connection
conn.ConnectionString = "provider = Microsoft.Jet.OLEDB.4.0;Date Source=C:\Users\Mandeep\Desktop\testing.mdb"
conn.Open
If Err.Number <> 0 Then
MsgBox "Connection error: " & Err.Description
Exit Sub
End If
Set cmd = New ADODB.Command
Set cmd.ActiveConnection = conn
Login.Show
End Sub
:banghead:
can any one advise.:dunno
Thanks
Mandeep