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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening a Secured Database in Code 1

Status
Not open for further replies.
Aug 11, 2004
1
US
I'm trying to create a switchboard where users can access several different secured databases. Does anyone know a way to do this code? I want it so when the user clicks on the button they access the database through the respective workgroup file and they're prompted to logon. If anyone can help, I'd appreciate it. Thanks.
 
DBName is a list box, with the record source being a table containing the database name (column 0), location (column 1), description (column 2), path (column 3), and MDW file (column 4).

If you double-click a database in the list box, the database opens up. If the "Path" column is "c:", it first places a new copy of the front end on the local computer.

The "Menu" database stays open, so another copy of Access is loaded with the new database.

Hopefully, this makes sense - if you want, I could email you a copy of the database so you could see how it works.

Private Sub DBName_DblClick(Cancel As Integer)
On Error GoTo ErrHandler

Dim sp As String
sp = Chr(34)


If [DBName].Column(3) = "C:" Then
FileCopy [DBName].Column(1) + "\" + [DBName].Column(0), "C:\" + [DBName].Column(0)
End If
Dim stAppName As String

stAppName = "msaccess.exe " + sp + [DBName].Column(3) + "\" + [DBName].Column(0) + sp + "/WRKGRP " + sp + [DBName].Column(4) + sp

Call Shell(stAppName, 1)
Exit Sub
ErrHandler:
MsgBox (Err.Description)
Resume Next
End Sub

 
Great Post GDGarth - Gave you 2 stars...



Thanks

AccessGuruCarl
Programmers helping programmers
you can't find a better site.

I hope this helps...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top