Click here to Skip to main content
Licence 
First Posted 9 Aug 2004
Views 43,593
Bookmarked 15 times

Dynamic connection string

By | 9 Aug 2004 | Article
Creating dynamic connection string on a remote site.

Introduction

Well, often I hear the problem of creating a connection sting on a remote site, because people don't have physical path to the location of their site database or any other thing for that method.

Over here, I will show how to create a connection string. This tutorial is for beginners and intermediate web developers, and the advance developer will know this already.

First, always use relative paths to make a site, and the paths to the database used in your website should also be relative. There is a built-in function in ASP and also in ASP.NET since it's a server method.

server.mappath("relative path") method is used to create physical path for the required file.

For example, I have a file called sitedata.mdb which is in a folder site_assert, and I am creating a path in a page which is in the parent folder. Then, this should be done:

strconn = server.mappath("site_assert/sitedata.mdb")

This assigns the physical path to the variable strconn, which you can further use.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

x_scripterx



Pakistan Pakistan

Member

well i am just a intermediate programmer and will like to help people out coz i am stuffed with stupid little things

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
QuestionSo simply!? Pinmemberfigofuture20:39 9 May '06  
GeneralPls Help me Emergently! HTML WYSIWYG Editor Using ASP/VBScript/JScript PinmemberAlexDa0:13 13 Mar '06  
Questionhow to create an html editor Application(internet Explorer -Editing) PinmemberAlexDa0:11 13 Mar '06  
GeneralNEVER put dBs within your site path! Pinmemberbenhereb417:36 3 Aug '05  
QuestionWhat is the use? Pinmembersinus-c3:09 10 Aug '04  
Generalf u c k you, spam maker Pinmemberrgf56723:40 9 Aug '04  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web03 | 2.5.120517.1 | Last Updated 10 Aug 2004
Article Copyright 2004 by x_scripterx
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid