Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connection string to a secure Access DB 2

Status
Not open for further replies.

AncientTiger

Programmer
Joined
Jul 5, 2001
Messages
238
Location
US
Ok, I'm familiar with the standard ado connection method of:
.........
dbsrc = "Provider=Microsoft.JET.oledb.4.4;Data Source='c:\mydb.mdb'"
Set cnn = createobject("ADODB.RECORDSET")
cnn.Open "Select * from sometable",dbsrc
..........

and have used this extensively, but now I'm faced with a secured Access database (using the Workgroup wizard), and am not sure what the connection string should be. I'm getting an "unable to find installable ISAM.." errors...

Let's say that I have a database located at c:\mydb.mdb
and it's secured with the secureddb.mdw workgroup file in the same location. There's a user : Tiger : and his password is : mypassword : .... could someone give me a script example of how I'd connect to that database?

Thanks!!
------------------------------------
[yinyang] 18 years of programming, and still learning every day! [yinyang]
 
Hi,

dbsrc = "Provider=Microsoft.JET.oledb.4.4;Data Source='c:\mydb.mdb;uid=Tiger;pwd=mypassword'

Have a good one!
BK
 
BlackKnight- Tried that...it didn't work. First, it couldn't find the "specified provider", so I tried changing the version to 4.0... then it gave the error "Couldn't find the file c:\mydb;uid=Tiger;pwd=mypassword".

Any ideas???
------------------------------------
[yinyang] 18 years of programming, and still learning every day! [yinyang]
 
I suggest using the UDL Wizard to construct your connection string that way you can test it before including it in your program.

Here is how you invoke the udl wizard. Do this on your desktop.

1. create a blank notepad file.
2. save the file.
3. rename the file by adding a new extention of .udl
make sure you save as all files not txt or some other
file type.
4. the icon for the file should change from notepad to a
little computer - it has now become the wizard.
5. double click on the file and it will bring up a dialog
box with multipule tabs.
6. use the microsoft Access provider – this will be Jet 4.0.
7. look under the ALL tab and there will be parameter settings which you can change if necessary. There is a test
button, press to test the connection.
8. close the file.
9. open the file from notepad or wordpad instead of double clicking the icon. You will see the connection string which you can copy and paste into your program.

LOOK under the ALL tab to see keyword syntax. You will see that the syntax for user id is "User ID=yourid"; Also, the different provider parameters are separated by a semi colon.
 
WOW cmmrfrds! I've often wondered how to determine connection strings, and this blew that ship right outta the water!! Thanks for THAT at least.... however, it's not connecting ot the secure database. It gives the error "Test connection failed because on an error in initializing provider. Cannot start your application. The workgroup information file is missing, or opened exclusively by another user."

The workgroup file is in the same directory, and was NOT open.... is there a certain place I'm supposed to place this file, or do I need to register it? Is there a setting I'm not using with the connection string?

Boy....tons 'o fret-n-fuss over one little string of text... heheh
------------------------------------
[yinyang] 18 years of programming, and still learning every day! [yinyang]
 
In the UDL Wizard:
Click the All tab.
Select the field labeled Jet OLEDB.System database.
Click Edit Value.
In the Property Value box, type the path to the SYSTEM.mdw file:
Windows NT 4: C:\winnt\system32\System.mdw
Windows 2000: C:\Program Files\Common Files\System\System.mdw
Click OK in the Edit Property Value window.
Select the field labeled Jet OLEDB:Database Password.
Click Edit Value.
In the Property Value box, type the password for the System database.
Click OK in the Edit Property Value window.

HERE IS A LINK THAT covers the above information - good stuff.


Let me know if this works for you, as I want to file away for future reference.
 
By JOVE I'VE GOT IT!!!!!!!!!!!!!

Thanks a million cmmrfrds!!!!
------------------------------------
[yinyang] 18 years of programming, and still learning every day! [yinyang]
 
You are welcome.

It is good to know it worked for you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top