Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where to store connection string for classic ASP?

Tags:

asp-classic

In ASP.NET i can store connection string in the web.config, like wise i need to store connection string or some configuration value in some file for classic ASP.

How can i do this? In order to achieve this do i need to use XML File and store the connection string in this?

What is the best practice???

like image 387
nimi Avatar asked Feb 26 '10 04:02

nimi


People also ask

Where do we store connection string in ASP?

Connection strings can be stored as key/value pairs in the connectionStrings section of the configuration element of an application configuration file.

Where should I store connection string?

Connection strings in configuration files are typically stored inside the <connectionStrings> element in the app. config for a Windows application, or the web. config file for an ASP.NET application.

Where do I put connection string in ASP.NET Core?

The connection string should be added to your application's App. config file (Web. config if you are using ASP.NET). If your connection string contains sensitive information, such as username and password, you can protect the contents of the configuration file using Protected Configuration.


2 Answers

use globa.asa to set a value in the application object.

like image 162
Joost Moesker Avatar answered Oct 05 '22 01:10

Joost Moesker


You can make an ASP file that contains the connection string as a string variable, along with any other configuration information, then include it in files that connect to the database.

like image 22
SLaks Avatar answered Oct 05 '22 01:10

SLaks