PDA

View Full Version : DSN-less Connection to MS-Access 2000 Using Classic ASP


adsc
03-03-2007, 08:25 AM
We just moved our site to discountasp.net, & trying to change the site database connection to what the site requires but it's not working

We are using DSNless connection, we changed our code as follow:
[[start]]
Set myConn = Server.CreateObject("ADODB.Connection")
myConnStr = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("..\_database\ticker.mdb")
myConn.ConnectionString = myConnStr
myConn.Open
[[end]]

But still not getting the data, I think we have something wrong in the database path syntax, could you please help us, also the main page home.asp showing another error "script time out...", I am not sure if this also related to the database.

Please advice
Thnaks for the help
Ahmad.

bruce
03-05-2007, 07:07 AM
where is your database located?

If it is in the _database directory under the root, try the following connection string.

myConnStr = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("\_database\ticker.mdb")

What error are you getting? You should get an error very quickly if the path is wrong.

Bruce

DiscountASP.NET
www.DiscountASP.NET (http://www.DiscountASP.NET)

adsc
03-06-2007, 07:14 AM
Hi Bruce,

Many thnaks to you, the fany think is I tried many thinks except this one "\_"

Thanks again,
Ahmad.