Subject: Change in connection string
Posted By: x_ray Post Date: 2/8/2006 12:45:50 PM
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.

Reply By: Bhakti_thakkar Reply Date: 2/14/2006 5:15:01 AM
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.

Reply By: x_ray Reply Date: 2/21/2006 4:10:33 PM
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.


Go to topic 40391

Return to index page 363
Return to index page 362
Return to index page 361
Return to index page 360
Return to index page 359
Return to index page 358
Return to index page 357
Return to index page 356
Return to index page 355
Return to index page 354