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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pblm while connecting database with DSN

Status
Not open for further replies.

sujitopics

Programmer
Oct 9, 2001
69
KR
Hai
i am new to java.
i am trying to connect to the database using asp program.
but i cannot able to connect using dsn based connection, which is like this

con.Open "dsn= accessdsn"

but i am able to connect using dsnless connection using file path ..like this.

DSNtest="DRIVER={Microsoft Access Driver (*.mdb)};"
DSNtest=dsntest & "DBQ=c:\login.mdb"
Con.Open DSNtest

i am using windows 2000 server.

if possible please tell me what may be reason for this ?
do i need to have some other setup to connect with dsnbased connection ?
i am creating dsn using odbc32 adminstrator icon.

If possible please give some information regarding this.

Thanks in advance
Yours
Suji
 
1. make an empty text file called connect.udl
2. Double click on this file and fill out the data (starting with the left tab)
3. In the left tab choose Microsoft OLE DB Simple Profider
4. When you are finished filling out everything open the textfile in notepad

The bottomb line in the textfile is your connection string,
here is a sample:
Provider=MSDAOSP.1;Data Source=Excel Files;Persist Security Info=False
 
Thankyou VeryMuch
Can u please tell me where the MicroSoft OLEDB Provider resides
Sorry. I cannot able to Understand.
I am new to ASP
Thankyou VeryMuch
Yours
Suji
 
If you have your DSN named "accessdsn" and you have the access jet driver installed, try this.

<%
Set Conn = Server.CreateObject(&quot;ADODB.Connection&quot;)
Conn.Open &quot;accessdsn&quot;
%>
Hope this helps
 
Dear Cirrus9,

Thankyou VeryMuch
I am new To ASP
From where can I find JET Driver
I am working on win2k server.
Do I need to install JET Driver externally or by default it will be there for win 2k server
I created dsn name at odbc 32 admin. then i am running.
but it is giving errors.
when i give file full path [dsn less connection] my asp program is connecting to database and working fine.

please tell me from where can i get jet driver
Thanks in advance
Yours
Suji
 
The driver should exist on the server already. If it does not you can install it with disk support. You should find it under ODBC or Data Sources (jet 4.x) . You will have to name the DSN and navigate to the Access DB. In this case the DSN would be named accessdsn.
If the DSNless connection is working and connection is the issue, it works just as well.
Good luck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top