[AccessD] Password Problem

Rocky Smolin rockysmolin at bchacc.com
Tue Jan 18 12:43:53 CST 2011


Gustav:

I put some code in the open to check that the password entered by the user
matches the password in the link.  

When it doesn't I have a loop to refresh the link, but it's generating an
Error 3001 - invalid argument.

    For Each tdf In db.TableDefs
        txtLink = ";DATABASE=" & gstrDatabaseName & ";MS ACCESS;pwd=" &
gstrPWD
        tdf.Connect = ";DATABASE=" & gstrDatabaseName & ";MS ACCESS;pwd=" &
gstrPWD
        tdf.RefreshLink
    Next tdf

The tdf.Connect string is:

;DATABASE=C:\Clients\PEDS\PEDS-DATA.mdb;MS ACCESS;pwd=pend0909;

gstrDatabaseName and gstrPWD have the correct values.

Can you see what the invalid argument might be?

MTIA

Rocky

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock
Sent: Tuesday, January 18, 2011 9:50 AM
To: accessd at databaseadvisors.com
Subject: Re: [AccessD] Password Problem

Hi Rocky

No that is read-only for info. You have to go via the RefreshLink route
passing the full (and modified) connection string including the parameter
  PWD=NewPassword;
in this.

/gustav


>>> rockysmolin at bchacc.com 18-01-2011 18:33 >>>
So on starting the app, after the user inputs the password (assuming the
password is correct) could I modify your query to an update query and change
the password that way?

Rocky
 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock
Sent: Tuesday, January 18, 2011 8:53 AM
To: accessd at databaseadvisors.com
Subject: Re: [AccessD] Password Problem

Hi Rocky

It is not "somehow" in the link -  it _is_ in the link information.
Run this query:

SELECT
  MSysObjects.Name AS TblNameLinked,
  MSysObjects.ForeignName AS TblNameSource,
  RTrim([Database]) AS DbsFile,
  RTrim([Connect]) AS DbsType
FROM
  MSysObjects
WHERE
  MSysObjects.Type=6
ORDER BY
  RTrim([Database]),
  MSysObjects.Name;

/gustav


>>> rockysmolin at bchacc.com 18-01-2011 17:20 >>>
Using a constant would work even though this is an mdb, except that  the
user wants to change the password from time to time and I don't want him to
have to come back for a code change every time. 

However, that only applies to opening the mdb with dbengine or currentdb -
manipulating recordsets.  My problem is that I can't even open a query that
uses a linked table.  That password is somehow, I think, in the link.  

Rocky



--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list