Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Opendatabase method

Posted on 2003-12-02
12
Medium Priority
?
808 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:Lucas
  • 6
  • 6
12 Comments
 
LVL 39

Accepted Solution

by:
stevbe earned 180 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:Lucas
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 13

Author Comment

by:Lucas
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:Lucas
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:Lucas
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:Lucas
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:Lucas
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
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.
Suggested Courses

927 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