View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
dok112[_83_] dok112[_83_] is offline
external usenet poster
 
Posts: 1
Default Security Across Applications


Hey everyone, I have a Access Database a user has to log in to when
viewing the database based on security settings. I have the below code
whish is accessing the database to dump info into from a Excel Form, but
now it is giving an error message b/c of the security. I need to put
the security in force b/c I had someone try to corrupt the database.
How can I make the below code provide their login info so it will open
the database and dump the data in?

Public gcnAccess As ADODB.Connection

Sub OpenAccessConnection()

Dim sConnect As String
Dim sPath As String
sPath = ThisWorkbook.Path
If Right$(sPath, 1) < "\" Then sPath = sPath & "\"
sConnect = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & sPath & "CARS.mdb;"

Set gcnAccess = New ADODB.Connection
gcnAccess.ConnectionString = sConnect
gcnAccess.Open
End Sub


--
dok112
------------------------------------------------------------------------
dok112's Profile: http://www.excelforum.com/member.php...o&userid=10581
View this thread: http://www.excelforum.com/showthread...hreadid=513398