Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
X002548
Not Just a Number
15586 Posts |
Posted - 2003-05-21 : 13:34:25
|
I'm at a loss...a consultant set up a series of Access dbs, with an mda file. The users have to join to a work group file in order to use the Access interface.Then in their infinite wisdom, created Excel "tools" that reference one of the Access databases. Know I know when using DTS, I have to supply the workgroup file on the advanced tab to get access to the db.But, and I think I'm losing my mind, but it appears the excel vba code doesn't do this. Is this right. Here's a sample of the code: 'Set up the lookup database Dim dbs As database Dim rst1 As recordset Dim rst2 As recordset Dim rst3 As recordset Dim sheetnum As Integer Dim rowss As Integer Dim strsql1 As String Dim strsql2 As String 'These are the variables to store data Dim Account As String Dim FEIN As String Dim Payroll As String Dim Backup As String Dim ProcCenter As String Dim LegalEnt As String Dim statecode As String Dim statecount As Integer Dim fedcount As Integer Set dbs = OpenDatabase("S:\FDCStoFLSImport\FLSLookup.mdb") strsql1 = "Select * from FDCS_SS_ACCTS" strsql2 = "Select * from LOOKUP_TABLE" strsql3 = "Select * from STATE_CODE" Set rst1 = dbs.OpenRecordset(strsql1) Set rst2 = dbs.OpenRecordset(strsql2) Set rst3 = dbs.OpenRecordset(strsql3) Brett8-) |
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2003-05-22 : 07:41:41
|
It's been a while, but I know that the DAO object model has some way of specifying an MDA to use, I believe the Workspace object will have it. Check the Access help file and find the Visual Basic/DAO section, it will have all the details. |
 |
|
SMerrill
Posting Yak Master
206 Posts |
Posted - 2003-05-30 : 16:51:30
|
Slap me if I'm wrong, but I believe the Excel OpenDatabase() method can be called using the following:Set dbs = OpenDatabase("", , ,"Provider=Microsoft.Jet.OLEDB.4.0;" _ & "Password=test;Data Source=S:\FDCStoFLSImport\FLSLookup.mdb;" _ & "Persist Security Info=True;" _ & "Jet OLEDB:System database=S:\FDCStoFLSImport\System.MDW")This will allow you to access the database, but beware that the password is stored in the code.--SMerrillSeattle, WA |
 |
|
X002548
Not Just a Number
15586 Posts |
Posted - 2003-06-02 : 14:24:02
|
OK, But the code I posted works, and I can not find the reference to the Security database (*.mda, actually) anywhere in the code. It's got to be someplace.I had to move the security file to a new file server location, and changed the name at the old location by putting a x in front of the name, and used work group admin to join to the file in the new location.And it works...damned if I know what's going on.Brett8-) |
 |
|
SMerrill
Posting Yak Master
206 Posts |
Posted - 2003-06-02 : 16:18:21
|
MDA is not the same as MDW. Workgroup files (MDW) store Security logins; Add-In's (MDA) store custom functions.So I take it you are trying to locate the reference to the MDA file. This is found within the code. To locate it, click on any form and select View | Code from the menu. Then, select Tools | References from the code window. This brings up a box of all references. The Checked ones are the ones being included in the code.The References collection is the facility for attaching to various DLLs to get specialized object-oriented programming jobs done.The same thing exists in Excel: Type the Alt-F11 key, then choose Tools | References from the menu.If I'm not guessing your intentions correctly, then please tell me why you posted the topic in the first place, since your code works!--Shaun MerrillSeattle, WA |
 |
|
X002548
Not Just a Number
15586 Posts |
Posted - 2003-06-03 : 13:57:05
|
quote: If I'm not guessing your intentions correctly, then please tell me why you posted the topic in the first place, since your code works!
In version 2.0 (and earlier (did you know there was a version 2?) ), the security file was an mda. I had to take over for a buch of overpaid consultants, and I get a feeling that this is a holdover. If you look in the workgroup administrator, you will see a filetype of mda available for a selection option. I belive it's backward compatable.I joined the users to the new location of the mda, and the get the login dialog when going in to the access application.So I know its referening the mda as the security model (what security?)Anyway, I can't find in Excel a reference to the file, or the login or password,Hey at least it works, and hopefully it'll go away soon.Still, it's bugging the hell out of me.Brett8-) |
 |
|
|
|
|
|
|