Etta or Milan ... Q: System mdw and DBEngine

Etta or Milan ... Q: System mdw and DBEngine

Post by John Store » Fri, 23 Oct 1998 04:00:00



Thanks for your postings in this newsgroup, I've been looking for answers to
my problem for a while, and your comments are the closest that I've found to
my work.

Below are two VBScript listings that I've written that are not working.  If
I remove the security related code, the code accesses the db as expected.

Can either of you help me with this problem?

Thanks ... John Storey

*************************************************************
Version 1 results in an error on the "CreateWorkspace" line stating "Not a
valid account name or password."  I'm certain that they are because they
work when using Access.
*************************************************************

 Dim appPath
 Dim appAccess, wsJet, DB, SQL, rstResults

 appPath = "C:\Program Files\Compass\System\"

 Set appAccess = CreateObject("Access.Application")
 appAccess.DBEngine.SystemDB = appPath & "Compass.mdw"
 Set wsJet = appAccess.DBEngine.CreateWorkspace("wsNew", "user", "secret")
 Set DB = AppAccess.DBEngine.Workspaces("wsNew").OpenDataBase(appPath &
"Compass.mdb")
 SQL = "Select FirstName, LastName From Employees Where EmployeeNumber=1234"
 Set rstResults = DB.OpenRecordset(SQL)

*************************************************************
Version 2 results in an error on the "OpenDatabase" line stating "You do not
have the necessary permissions to use the file ..."
*************************************************************

 Dim appPath
 Dim appAccess, wsJet, DB, SQL, rstResults

 appPath = "C:\Program Files\Compass\System\"

 Set appAccess = CreateObject("Access.Application")
 appAccess.DBEngine.SystemDB = appPath & "Compass.mdw"
 Set DB = AppAccess.DBEngine.Workspaces("wsNew").OpenDataBase _
                                (appPath &
"Compass.mdb",False,False,";uid=user;pwd=secret")
 SQL = "Select FirstName, LastName From Employees Where EmployeeNumber=1234"
 Set rstResults = DB.OpenRecordset(SQL)

 
 
 

Etta or Milan ... Q: System mdw and DBEngine

Post by etta » Sat, 24 Oct 1998 04:00:00


John,

Your code looks ok to me, you said it works if you take off the
security code. If you can access the database with out the password
or user name then it must not be set up with in access.

If you have the user and password set up with in Access and you
take off the security code, then you would still get a error and would
not beable to access the database.

The only suggestion I can give you is to declare  your variables,
Dim wsJet As Workspace

etta


>Thanks for your postings in this newsgroup, I've been looking for answers
to
>my problem for a while, and your comments are the closest that I've found
to
>my work.

>Below are two VBScript listings that I've written that are not working.  If
>I remove the security related code, the code accesses the db as expected.

>Can either of you help me with this problem?

>Thanks ... John Storey

>*************************************************************
>Version 1 results in an error on the "CreateWorkspace" line stating "Not a
>valid account name or password."  I'm certain that they are because they
>work when using Access.
>*************************************************************

> Dim appPath
> Dim appAccess, wsJet, DB, SQL, rstResults

> appPath = "C:\Program Files\Compass\System\"

> Set appAccess = CreateObject("Access.Application")
> appAccess.DBEngine.SystemDB = appPath & "Compass.mdw"
> Set wsJet = appAccess.DBEngine.CreateWorkspace("wsNew", "user", "secret")
> Set DB = AppAccess.DBEngine.Workspaces("wsNew").OpenDataBase(appPath &
>"Compass.mdb")
> SQL = "Select FirstName, LastName From Employees Where

EmployeeNumber=1234"

- Show quoted text -

Quote:> Set rstResults = DB.OpenRecordset(SQL)

>*************************************************************
>Version 2 results in an error on the "OpenDatabase" line stating "You do
not
>have the necessary permissions to use the file ..."
>*************************************************************

> Dim appPath
> Dim appAccess, wsJet, DB, SQL, rstResults

> appPath = "C:\Program Files\Compass\System\"

> Set appAccess = CreateObject("Access.Application")
> appAccess.DBEngine.SystemDB = appPath & "Compass.mdw"
> Set DB = AppAccess.DBEngine.Workspaces("wsNew").OpenDataBase _
>                                (appPath &
>"Compass.mdb",False,False,";uid=user;pwd=secret")
> SQL = "Select FirstName, LastName From Employees Where

EmployeeNumber=1234"

- Show quoted text -

Quote:> Set rstResults = DB.OpenRecordset(SQL)


 
 
 

Etta or Milan ... Q: System mdw and DBEngine

Post by John Store » Sat, 24 Oct 1998 04:00:00


Thanks for replying.

First of all, I have an unsecure database that I used just to get the client
access worked out, and then I have a different, secure database, which is
the true objective.  I worked out the simple, unsecure access, but I'm
having difficulty with connecting with the secure db.

Here's where things have really gotten complicated since I posted the
message.  The db is actually Access95.

Thanks for all of your help ... John

 
 
 

Etta or Milan ... Q: System mdw and DBEngine

Post by etta » Sun, 25 Oct 1998 04:00:00


John,

I have never worked with Access95 I went form 2.0 to 8.0, so
I don't know if there's a difference in accessing it through
DAO. So you might have to have all the option on the access
accounted for. ie name,user,password and type.

Set wsJet = appAccess.DBEngine.CreateWorkspace("wsNew", "user", "secret",
"")

The last statement would be for the type of workspace ie. Jet or ODBC.
dbUseJet or dbUseODBC, the default is dbUseJet which is way I used the ""

etta


>Thanks for replying.

>First of all, I have an unsecure database that I used just to get the
client
>access worked out, and then I have a different, secure database, which is
>the true objective.  I worked out the simple, unsecure access, but I'm
>having difficulty with connecting with the secure db.

>Here's where things have really gotten complicated since I posted the
>message.  The db is actually Access95.

>Thanks for all of your help ... John

 
 
 

1. ADO roadblock: Converting system.mda files to system.mdw

I work for an agency that uses quite a lot of Access databases.  They
are all user-level secured.  We recently converted to Access 97 (hey,
that's government speed and efficiency - I figure we'll get Access 2000
around 2014).  Weirdly enough, we are using an old Access 2.0
system.mda as our security file.  There was a personnel change, and the
new person in charge of maintaining Access security (not me) didn't
have permissions/didn't know how to upgrade the system.mda file to a
system.mdw file.  And so the old Access 2.0 file is our system security
file.

I am starting to use ADO, but when I try to access a secured db by
referencing the system.mdw file in the connection string, it tells me
that it can't connect to a db created in a previous version of Access.

How do you convert a system.mda to a system.mdw?  Help!

Sent via Deja.com http://www.deja.com/
Before you buy.

2. dynamic "USE" statement ?

3. Visual Basic Database and Access 97 System.mdw

4. WANTED: Watcom C 8.5 or Microsoft C/C++ 7

5. ADO and SYSTEM.MDW

6. US-MA-PROGRAMMER ANALYST

7. Creating System.mdw

8. hi John!

9. Network of Access 7.0 Users, Where System.MDW?

10. System.mdw

11. Errror 3028, SYSTEM.MDW Missing or Exlusivly Locked

12. System..Mdw and VB4 Pro