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

Link to user-level secured database

Status
Not open for further replies.

GilesForrest

IS-IT--Management
Apr 17, 2002
3
GB
Apologies, but I've also posted this message in the Tables/Relationships forum:

I'm having difficulty finding out how to do a (I think) simple task!

I have tables in a database secured with one workgroup file that I want to use in an unsecured database. The ideal way would be to use the ODBC driver for Access. I've set it up for the database and it's system database and it works fine if I use it in a database query in Excel, for example. I simply used the DSN and supplied the login details.

However, if I try to link it to another Access database, I get the following error message:

"You cannot use ODBC to import from, export to, or link an external Microsoft Jet or ISAM database table to your database"

Hmmmm....

I found I can access the table in code:

Dim strDestWorkgroupFile As String
Dim strDestUserName As String
Dim strDestPassword As String
Dim strDestDatabase As String

strDestWorkgroupFile = "F:\Data\My Databases\Minimum \Secured.mdw"
strDestUserName = "forrestg"
strDestPassword = "test"
strDestDatabase = "F:\Data\My Databases\Database.mdb"

Dim rst As ADODB.Recordset
Dim cnn As New ADODB.Connection

cnn.Provider = "Microsoft.Jet.OLEDB.4.0"
cnn.Properties("Jet OLEDB:System database") = strDestWorkgroupFile
cnn.Open "Data Source=" & strDestDatabase & ";User Id=" & strDestUserName & ";Password=" & strDestPassword & ";"

Set rst = New ADODB.Recordset
rst.Open "Table1", cnn, adOpenStatic, adLockOptimistic

rst.MoveFirst
Do Until rst.EOF
MsgBox rst.Fields("test")
rst.MoveNext
Loop

But that's not the ideal solution, because the data will be volumous and dynamic and we want to use it like a normal table so we can do SQL select queries, etc, etc.

Am I doing something wrong, or is there a way to produce the link in ADOX for example??

Thanks in advance for your help.

Giles
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top