Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Please help with DSN-Less connection code
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

mspaul
Starting Member

Australia
3 Posts

Posted - 15 January 2005 :  03:10:04  Show Profile
Hi Guys,

I've just managed to set up a DSN-less connection for my first project

But unfortunately I can't seem to figure out where to specify the database password in the code and so I can't connect to the database.

My password for the database is : test

This is my code :

<%
Dim userConnectString, userconn

userConnectString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("suppliers.mdb")
Set userconn = Server.CreateObject("ADODB.Connection")
userconn.open userConnectString
%>


Where do I specify the username and password in this connection?

Any help with be greatly appreciated. Thanks in advance.

Hamlin
Advanced Member

United Kingdom
2386 Posts

Posted - 15 January 2005 :  06:19:40  Show Profile
userConnectString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("suppliers.mdb") & ";User Id=userid;Password=pass;"

Should do the trick.
Go to Top of Page

mspaul
Starting Member

Australia
3 Posts

Posted - 15 January 2005 :  07:26:04  Show Profile

Thanks very much Hamlin.

Go to Top of Page

Podge
Support Moderator

Ireland
3775 Posts

Posted - 15 January 2005 :  09:24:59  Show Profile  Send Podge an ICQ Message  Send Podge a Yahoo! Message
If you ever forget (which I often do) I go here - http://www.connectionstrings.com/

Podge.

The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)

My Mods: CAPTCHA Mod | GateKeeper Mod
Tutorial: Enable subscriptions on your board

Warning: The post above or below may contain nuts.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.33 seconds. Powered By: Snitz Forums 2000 Version 3.4.07