PDA

Click to See Complete Forum and Search --> : .MDB Path in Asp


deepaktutaja
Jun 28th, 2000, 07:03 PM
Hi Great ASP Programmers!!
I am a new ASP cub and want your help for my first ASP site. Actually I have an Access database just to display some information based on visitor's selection. The site is working o.k. offline but gives error when I see it online. The error is 'Invalid directory path The database not present at C:\WinNT\System32\ Directory'. I think the problem is with the cn.connectstring-

Conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=thoughts.mdb"

u can see the problem at : http://www.exploredelhi.com/explore

Please Help me (& be quick)
Thanx
Deepak

capone
Jun 28th, 2000, 07:37 PM
I don't know much about OLEDB, but I can tell you how to create the connection using ADO. First you go to control panel, and double click on ODBC. Go to System DSN and add your database (first you choose the generic Access driver, then you give it a name, and select where the database is). The name is what you'll use to create the connection.

<%
Set conn = Server.CreateObject("ADODB.Connection")
conn.open "DSN=YourFilesDSNName","",""
Set Session("YourFilesDSNName_conn") = conn
%>

Hope that helps and was fast enough.

I haven't found anywhere that tells how to do it in OLE, but I'm sure someone around here can tell you how to do that.

Mark Sreeves
Jun 28th, 2000, 08:29 PM
even easier:


dim conn

Set Conn = Server.CreateObject("ADODB.Connection")

Conn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=C:\users.mdb")