943,590 Members | Top Members by Rank

Ad:
  • ASP Discussion Thread
  • Unsolved
  • Views: 1278
  • ASP RSS
Oct 8th, 2008
0

help:DNSLESS Connection for Password db

Expand Post »
I am new to ASP, and I used to write the connection for my Access Database using DNSLESS Connection like this:

<HTML>
<BODY>
<%
'Actionvar=Request.QueryString("actionvar")
'** Set Up a DSNLESS CONNECTION<BR>
Set conn = server.createobject("adodb.connection")
DSNtemp="DRIVER={Microsoft Access Driver (*.mdb)}; "
'DSNtemp=dsntemp & "DBQ=" & server.mappath("Record.mdb")
DSNtemp=dsntemp & "DBQ=" & server.mappath("MyWeb/MyRecord/Record.mdb")
conn.Open DSNtemp
%>

</BODY>
</HTML>


My question is:

1.Here, Record.mdb is kept inside my web Folder. If the Data have a password, then how shall I write the Connection String.

2. Is it possible to Connect MySql using ASP, if so, what is the Connection String.

If any one can solved my simple problem, I shall be very glad.
Reputation Points: 10
Solved Threads: 4
Light Poster
K.Vanlalliana is offline Offline
44 posts
since Jul 2008
Oct 8th, 2008
0

Re: help:DNSLESS Connection for Password db

Hi, you can use Jet 4.0 to connect to Access
:
ASP Syntax (Toggle Plain Text)
  1. Set conn = server.createobject("adodb.connection")
  2. DSNTEMP = "provider=Microsoft.Jet.OLEDB.4.0;data source=" & App.Path & "\Record.mdb; Jet OLEDB:Database Password=yourpasswordhere"

For MySQL:
ASP Syntax (Toggle Plain Text)
  1. Set conn = server.createobject("adodb.connection")
  2. DSNTEMP = "driver={MySQL ODBC 3.51 Driver};Server=10.10.10.1;User=USERNAME;Password=PASSWORD;Database=DB_NAME"

I think this should help.
Reputation Points: 11
Solved Threads: 7
Junior Poster in Training
Baradaran is offline Offline
88 posts
since Feb 2007
Oct 8th, 2008
0

Re: help:DNSLESS Connection for Password db

if you want, you can use my script it may help you with this problem.

Cheers
here is link
http://www.daniweb.com/forums/thread147442.html
Last edited by bigb33; Oct 8th, 2008 at 8:24 am.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
bigb33 is offline Offline
6 posts
since Sep 2008
Oct 10th, 2008
0

Re: help:DNSLESS Connection for Password Access DB

Thank to all who reply my problem, but unfortunately the connection which you suggested is not working using this (For MSAccess with Password, using DSNLess Connection):

Set conn = server.createobject("adodb.connection")
DSNTEMP = "provider=Microsoft.Jet.OLEDB.4.0;data source=" & App.Path & "\Record.mdb; Jet OLEDBatabase Password=yourpasswordhere"



The Connection for MS Access without Passwword which I am using is:


Set conn = server.createobject("adodb.connection")

DSNtemp="DRIVER={Microsoft Access Driver (*.mdb)}; "
DSNtemp=dsntemp & "DBQ=" & server.mappath("MyWeb/MyRecord/Record.mdb")
conn.Open DSNtemp

The above is working properly.


Can any one give me the correct Connection for Access with ASP with Password.
Reputation Points: 10
Solved Threads: 4
Light Poster
K.Vanlalliana is offline Offline
44 posts
since Jul 2008
Oct 14th, 2008
0

Re: help:DNSLESS Connection for Password db

I think the problem is with App.Path which, AFAIK, is not supported in ASP. It works in VB.
If the path to your database is fixed, use
ASP Syntax (Toggle Plain Text)
  1. Set conn = server.createobject("adodb.connection")
  2. DSNTEMP = "provider=Microsoft.Jet.OLEDB.4.0;data source= << Full path to your database>>\Record.mdb; Jet OLEDB:Database Password=yourpasswordhere"
Reputation Points: 20
Solved Threads: 10
Junior Poster
aparnesh is offline Offline
193 posts
since Jul 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP Forum Timeline: What to do now ???
Next Thread in ASP Forum Timeline: Constructor





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC