Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel and Access User Level Security 1

Status
Not open for further replies.

sabloomer

Technical User
Aug 8, 2003
153
US
I hope I have a quick question. I have an Excel 2000 spreedsheet that has the following code...

strDatabase = "F:\My Client.mdb"
'Delete the existing selected group
Set dbs = OpenDatabase(strDatabase)
sql = "DELETE * FROM tbl_temp_selected_group"
dbs.Execute sql, dbFailOnError

It worked like a champ until I needed to add User Level security to the Access database. I found several postings on database passwords, but not User Level Security. I found something on the Microsoft site ...


but it is for Visual Basic and not VBA.

In the help for OpenDatabase Method it talks about using and ODBC connection to open a (SQL Server) database. I have a File DSN established that holds the security file, login name, and password, but I can not seem to get the synatax for that to work. Can anyone tell me how to open a database connection in Excel to an Access database that uses User Level Security?

Thank you to anyone taking the time to help me.

sabloomer
 
heres how i do it in one my routines

Dim wk_Income As DAO.Workspace
Dim db_Income As DAO.Database

Dim str_db As String
Dim str_user As String
Dim str_pass As String

str_user = "txfdss"
str_pass = "hdf8sfsdf32"
str_db = "g:\Correspondence\Income Database\Back_end\Income_Distribution.mdb"

DBEngine.SystemDB = "g:\Correspondence\Income Database\Back_end\SERC.mdw"
Set wk_Income = DBEngine.CreateWorkspace("New", str_user, str_pass)
Set db_Income = wk_Income.OpenDatabase(str_db)

Chance,

Filmmaker, gentlemen and Cavalier
,
 
Chance,

Thank you. It worked like a charm.

sabloomer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top