Wrox Programmer Forums
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." 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 Basics 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 February 8th, 2006, 01:45 PM
Authorized User
Join Date: Nov 2005
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to x_ray
Default Change in connection string

hello all,
i need help on couple of things,
1-first of all i have a website, built using asp and javascript,and connected to a database,i have a DSN object to connect to database using the user sa and password 123, i need to change this to use the Integrated NT security, to access the database depending on the username and password of the server computer.
2-how can should i change the connection string based on the above, ie from
var odbc="dsn=mydb;uid=sa;pwd=123";
to an odbc that access the database based on the integrated security authentication.
3- is there a way to make the connection string in one file, rather than changing it in multiple scripts, this will be very much helpful.

NB:help is needed very urgently.

Old February 14th, 2006, 06:15 AM
Registered User
Join Date: Feb 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts

ya there are ways in which you can create a connection string
1. create connection string in Session_onStart in global.asa
    but open only when required. in doing this the connection string will be available to all the pages and opened only when needed. This is most safe method.
2. open the connection in an include file and include that file in your asp where ever you require DB connectivity
3. open inline connection each time but do not forget to close it each time you open.

Old February 21st, 2006, 05:10 PM
Authorized User
Join Date: Nov 2005
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to x_ray

thanks a lot for your reply, but can you give me an example about the first method?also how it will be closed once open?( i think a simple example will be enough)

also i have tried the the 2.method but it didn't work and i dont know why(i posted it earlier in the forum, i will search for the error and reply back with it).
for the 3rd one, did you mean to open a connection the simple and easy way(as i am doing)?
thanks again.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Vba to Change Pass Through Query Connection Coby Access VBA 1 April 25th, 2011 09:12 AM
Help with change postgreSQL connection to MySQL chadneiro PHP How-To 2 July 7th, 2010 12:37 PM
string change in jsp rajesh_css Pro JSP 6 October 19th, 2008 09:24 PM
Change database connection song Visual Basic 2005 Basics 4 November 30th, 2007 01:22 AM
change element by string pravind XSLT 1 February 13th, 2006 09:00 AM

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