p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Classic ASP Databases (http://p2p.wrox.com/forumdisplay.php?f=62)
-   -   mapping a database. (http://p2p.wrox.com/showthread.php?t=3001)

kilika August 21st, 2003 11:15 AM

I usually hard code the page. I am not saying it is the best thing but that is what I do and it works. I'd say use the OLEDB connect string and just hard code the path like so:
Code:

<% strConnect = Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\databases\sbdc.mdb;Persist Security Info=False %>
You will need to set the path to where you have the actual DB and it is the path on the server (physical), not the web path.


Chris

pgtips August 22nd, 2003 03:32 AM

AHhhh.. i finally figured it out. I used this connection string on a server that processes ASP pages and it finally worked.

strConnect="DBQ=" & Server.Mappath("scservices.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};"
I'm glad you got something to work, but as I said before do not use this ODBC driver - it sucks for ASP

Thanks guys.

1. Okay let me get this straight... When i do my site locally I use this: <
% strConnect = Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\sbdc.mdb;Persist Security Info=False %>
Yep thats good.

2. And when my database is on a hosting server the string should be this:
strConnect="DBQ=" & Server.Mappath("scservices.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};"
No that's bad - wrong driver, use
<% strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.Mappath("scservices.mdb") & ";Persist Security Info=False" %>

3. So whats this for????
'strConnect = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=database/list.mdb"
forget this one - that driver sucks :)

4. I can also connect using a DSN right, but i need the admin to set that up for me?
Yep, the you would use <% strConnect = "DSN=whateverTheNameIs" %>

hth
Phil


All times are GMT -4. The time now is 10:37 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.