 |
| Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

August 20th, 2003, 02:18 PM
|
|
Authorized User
|
|
Join Date: Aug 2003
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
mapping a database.
Hey,
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.
|
|

August 20th, 2003, 02:33 PM
|
|
Authorized User
|
|
Join Date: Aug 2003
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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"
|
|

August 20th, 2003, 03:11 PM
|
|
Authorized User
|
|
Join Date: Aug 2003
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

August 21st, 2003, 03:26 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
|
|
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?
|
|

August 21st, 2003, 04:18 AM
|
|
Authorized User
|
|
Join Date: Aug 2003
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|
|

August 21st, 2003, 04:45 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
|
|
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.
|
|

August 21st, 2003, 10:06 AM
|
|
Registered User
|
|
Join Date: Aug 2003
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|
|

August 21st, 2003, 11:01 AM
|
|
Authorized User
|
|
Join Date: Aug 2003
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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" %>
|
|

August 21st, 2003, 11:04 AM
|
|
Authorized User
|
|
Join Date: Aug 2003
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|
|

August 21st, 2003, 11:11 AM
|
|
Authorized User
|
|
Join Date: Aug 2003
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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?
|
|
 |