Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
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
 
Old November 4th, 2004, 07:11 PM
Authorized User
 
Join Date: Sep 2004
Location: , , .
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default Access Database connection

My database asp.mdb was used to be on O:/inetpub/wwwroot directory.I use to have this server.map method and everything is fine.

Set objConn = Server.CreateObject("ADODB.Connection")
Set objRS = Server.CreateObject("ADODB.Recordset")

strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & Server.MapPath("asp.mdb") & ";"
objConn.Open strConn

Now this has been changed to a new location O:/databases( step above cauz somebody can download my entire entire database)

I am having a trouble to connect to the databse.

i ahve used this

objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
                          "Data Source=O:\databases\asp.mdb;"

I know that we have to use DBQ="...............method but i need your help with syantax.

Pls help.

Thanks,
widad

 
Old November 4th, 2004, 09:36 PM
Friend of Wrox
 
Join Date: Sep 2003
Location: Mentiri, Muara, Brunei.
Posts: 363
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hello,

  That is not good way of specifying the database path. It indicates physical path. If you access from any other system not from the hosted system, it will not work. Coz, the other system cannot identify the location and file. It searches in the current system if you specify physical path.

Store the mdb file anywhere in the virtual folder. Better have db folder and store. Then follow path rules.

Ex: myasp is virtual folder
    DB is the folder in myasp and have mdb file.
    scripts is the folder to have asp scripts

form the connection string like...

conn.provider="Microsoft.Jet.oledb.4.0"
conn.open server.mappath("../db/asp.mdb")



---------
Rajani

 
Old November 5th, 2004, 12:33 AM
Authorized User
 
Join Date: Sep 2004
Location: , , .
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Rajani,
          What if the db folder is a level up to my virtual folder myasp.How do you implement your code.Thanks.

Widad

 
Old November 5th, 2004, 05:24 AM
Friend of Wrox
 
Join Date: Sep 2003
Location: Mentiri, Muara, Brunei.
Posts: 363
Thanks: 0
Thanked 1 Time in 1 Post
Default

How come it possible.

 Generally speaking your application(developed in ASP) is capable of running on any system in your LAN and as well in any browser if it hosted.
Ofcourse, its possible to have DB folder up to vitual folder. Then what is the use of developing in ASP. At that situation you must give physical path. If you access from other system can not find that DB.

Hope you got this.

If not have a look of ASP documentation once.


---------
Rajani





Similar Threads
Thread Thread Starter Forum Replies Last Post
Connection to Access Database in .Net KarthikR BOOK: ASP.NET Website Programming Problem-Design-Solution 1 January 16th, 2007 11:56 AM
How to make a connection with access database arshad mahmood Classic ASP Professional 1 April 18th, 2006 03:53 AM
access database connection problem shaileshk ADO.NET 6 July 5th, 2005 03:30 AM
Connection DataGrid to Access database Rado C# 1 April 25th, 2005 04:59 AM
Connection to a Access database aadz5 ASP.NET 1.0 and 1.1 Basics 2 October 13th, 2003 06:35 AM





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