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)

kyootepuffy August 20th, 2003 02:18 PM

mapping a database.

I have been testing my asp pages locally. I have been using a connection string
<% strConnect = Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\sbdc.mdb;Persist Security Info=False %> and then just do as an include# file on my other pages. So it has been working fine.

Now i uploaded it on my server that is on another machine basically testing it on a browser, I dont know how to set up the connection to the database. I read that I should use a map path, but i dont how.

kyootepuffy August 20th, 2003 02:33 PM

Do i just use this ?? Change out scservices.mdb and list.mdb to name of my database?

'strConnect="DBQ=" & Server.Mappath("scservices.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};"

'strConnect = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=database/list.mdb"

kyootepuffy August 20th, 2003 03:11 PM

Another weird thing is that when i try to load up the ASP page, it keeps popping up a dialog box asking if i want to open or save it to my computer?!! im clueless! =p

pgtips August 21st, 2003 03:26 AM

The format of the connection string does not need to change, just the path in the DataSource part. For ASP, you should definitely use the Jet OLEDB provider (your first version) not the Access ODBC driver (your second version).

Did you move your ASP to the new server too, or are you now trying to connect from ASP on one machine to an Access db on another server?

kyootepuffy August 21st, 2003 04:18 AM

yea, i basically uploaded everything to the server. So, what you're saying is that i should just use this:

'strConnect="DBQ=" & Server.Mappath("scservices.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};"

If that is the case then something is wrong with my server, because it keeps prompting me "if i want to save the file or open it because opening files may damaged your computer... etc". Im using dreamweaver by the way.

pgtips August 21st, 2003 04:45 AM

No, do not use that driver, use the OLEDB driver.
<% strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\sbdc.mdb;Persist Security Info=False" %>

Maybe you'd better post some more code - simply connecting to your db should not cause it to be downloaded to the client. A separate issue is that your db should always be located outside of the web root so that it cannot be downloaded by the client.

mm111mm222 August 21st, 2003 10:06 AM

You need to make sure that IIS is configured to server asp documents. If not the server does not know what to do with the file and sends it to the client.

kyootepuffy August 21st, 2003 11:01 AM

Microsoft JET Database Engine error '80004005'

Could not find file 'C:\sbdc.mdb'.

/!new/form2.asp, line 7

I dont understand why it keeps on saying c:\... Its not even in my string connection...
<% strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=sbdc.mdb;Persist Security Info=False" %>

kyootepuffy August 21st, 2003 11:04 AM

The error is from when I am trying to view it in the browser from my server....

I fixed the other error how my server was not configured to look at ASP pages, and it kept on showing me just play ASP code when i was trying to load up asp pages. thanks for catching it.

kyootepuffy August 21st, 2003 11:11 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)};"

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 %>

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)};"

3. So whats this for????
'strConnect = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=database/list.mdb"

4. I can also connect using a DSN right, but i need the admin to set that up for me?

All times are GMT -4. The time now is 11:41 AM.

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