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
  #1 (permalink)  
Old October 4th, 2005, 01:37 AM
Authorized User
 
Join Date: Aug 2005
Location: Mumbai, Maharashtra, India.
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to abhisheksud Send a message via Yahoo to abhisheksud
Default How make an automatic dsn less connection

I have a microsot access database file which is stored in the same directory as rest of the website file...Now the current database connection is made specifying the full path of file..now when the file is uploaded on to the server the address changes and hence the connection is broken..could someone suggest a modification to this code which could make the connection automatic even if the website directory is moved...

StrConnect = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
             " Data Source = C:\Inetpub\IT Security\Security.mdb;" & _
             " Persist Security Info=True"

Also if i want to make this file password protected how can i access that file automatically....

Thanks
  #2 (permalink)  
Old October 5th, 2005, 05:57 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Melbourne, Vic, Australia.
Posts: 308
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Use Server.MapPath
For example
Code:
StrConnect = "Provider=Microsoft.Jet.OLEDB.4.0;" & _ 
  "Data Source = " & Server.MapPath("Security.mdb") & ";" & _
  "Persist Security Info=True"




I am a loud man with a very large hat. This means I am in charge
  #3 (permalink)  
Old October 6th, 2005, 11:26 PM
Authorized User
 
Join Date: Aug 2005
Location: Mumbai, Maharashtra, India.
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to abhisheksud Send a message via Yahoo to abhisheksud
Default

Hi Steven
Thanks for the reply....earlier also i hv tried to use the server.MapPath command but then it used to give that end of statement expected...but on using your code it is giving error that "INVALID CHARACTER"....what could be the problem please help me out ...
Thnxs
  #4 (permalink)  
Old October 7th, 2005, 04:51 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

abhishek,

Can you post the exact error here along with the line number and which line it denotes in the code, etc...

Cheers.

_________________________
- Vijay G
Strive for Perfection


Similar Threads
Thread Thread Starter Forum Replies Last Post
ODBC DSN connection atoyot BOOK: Beginning Visual Basic 2005 Databases ISBN: 978-0-7645-8894-5 2 December 14th, 2006 06:40 PM
DSN Connection mred2nice Visual Studio 2005 0 October 31st, 2006 11:58 AM
DSN Connection problem patwadd Classic ASP Basics 4 February 9th, 2005 04:26 AM
Security Error Using DSN Connection Adir Rovner ASP.NET 1.0 and 1.1 Basics 7 August 24th, 2004 09:30 AM
dsn-less connection problem Justine SQL Server ASP 3 March 8th, 2004 01:45 PM





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