| | |
help:DNSLESS Connection for Password db
Please support our ASP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jul 2008
Posts: 44
Reputation:
Solved Threads: 3
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.
<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.
•
•
Join Date: Feb 2007
Posts: 66
Reputation:
Solved Threads: 4
Hi, you can use Jet 4.0 to connect to Access
:
For MySQL:
I think this should help.
:
ASP Syntax (Toggle Plain Text)
Set conn = server.createobject("adodb.connection") 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)
Set conn = server.createobject("adodb.connection") DSNTEMP = "driver={MySQL ODBC 3.51 Driver};Server=10.10.10.1;User=USERNAME;Password=PASSWORD;Database=DB_NAME"
I think this should help.
•
•
Join Date: Sep 2008
Posts: 6
Reputation:
Solved Threads: 0
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
Cheers
here is link
http://www.daniweb.com/forums/thread147442.html
Last edited by bigb33; Oct 8th, 2008 at 8:24 am.
•
•
Join Date: Jul 2008
Posts: 44
Reputation:
Solved Threads: 3
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 OLEDB
atabase 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.
Set conn = server.createobject("adodb.connection")
DSNTEMP = "provider=Microsoft.Jet.OLEDB.4.0;data source=" & App.Path & "\Record.mdb; Jet OLEDB
atabase 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.
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
If the path to your database is fixed, use
ASP Syntax (Toggle Plain Text)
Set conn = server.createobject("adodb.connection") DSNTEMP = "provider=Microsoft.Jet.OLEDB.4.0;data source= << Full path to your database>>\Record.mdb; Jet OLEDB:Database Password=yourpasswordhere"
![]() |
Other Threads in the ASP Forum
- Previous Thread: What to do now ???
- Next Thread: Constructor
| Thread Tools | Search this Thread |
archive asp asp.net aspandmssqlserver2005 aspandmssqlserver2005connection aspconnection connection database databaseconnection dreamweaver excel fso iis msmsql mssql2005 mssqlserver2005 mssqlserver2005andasp mssqlserverandasp opentextfile record searchbox selectoption single specfic sqlserver sqlserverconnection windows7





