Solved

Opendatabase method

Posted on 2003-12-02
12
769 Views
Last Modified: 2008-03-17
Im using the Opendatabase method in excel VBA and i'm running into problems.  Here is my connection string

dim dbs as Database
dim rs as recordset

set dbs = opendatabase("c:\sun.mdb", , ,"PWD=tester")

When it reaches the opendatabase line, it gives me an error..."INVALID PASSWORD" when the password is right?  If i disable the password it works?  Any ideas?

0
Comment
Question by:lucas911
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 6
12 Comments
 
LVL 39

Accepted Solution

by:
stevbe earned 45 total points
ID: 9860830
have you tried setting exclusive and read only parameters explicitly?
"tester" needs to be the same case as the real password

Set dbs = opendatabase("c:\sun.mdb", False,False ,"PWD=tester")

Steve
0
 
LVL 13

Author Comment

by:lucas911
ID: 9860915
I can't open this database exclusively because other people will be using it.  The password is all in lower case.

if i put in false, false, as the parameters up there its complaining that its an invalid ODBC connection.

HMMM...
0
 
LVL 39

Expert Comment

by:stevbe
ID: 9861276
and if you dbl click on C:\sun.mdb from windows explorer you enter tester and all is good?
0
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 
LVL 13

Author Comment

by:lucas911
ID: 9861728
yes sir
0
 
LVL 39

Expert Comment

by:stevbe
ID: 9861823
and you have a reference to the Microsoft DAO 3.6 Object Library?
0
 
LVL 13

Author Comment

by:lucas911
ID: 9861895
Yes sir...DAO is referenced properly
0
 
LVL 39

Expert Comment

by:stevbe
ID: 9861963
can you clear out your data, repair/compact and zip to me? spmazzola AT hotmail.com?

steve
0
 
LVL 13

Author Comment

by:lucas911
ID: 9861979
If i try to use this one:

Set dbs = OpenDatabase("", dbDriverComplete, False, "ODBC;DSN=test;UID=admin;PWD=tester;")

I get this error:

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

And yes i did create an ODBC connection called Test
0
 
LVL 39

Expert Comment

by:stevbe
ID: 9861995
as the message says you cannot connect from one access database to another via DSN.
0
 
LVL 13

Author Comment

by:lucas911
ID: 9862023
I see...but im doing it in Excel 2000 VBA and im just trying to extract the values from that database into excel
0
 
LVL 13

Author Comment

by:lucas911
ID: 9862083
I figure it out.  Man what a crock......

set dbs = Opendatabase("c:\sun.mdb", false, false, ";PWD=tester")

it needs a semicolong in front of the PWD since the UID is default to admin.  Thanks for your help.
0
 
LVL 39

Expert Comment

by:stevbe
ID: 9866027
I guess it is one of thos situations where if you pass the last argument you need to add placeholders for the other, just like you need to for OpenDatabase.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question