You might often need to connect to the SQL Server database say in your classic ASP Application using the ODBC System DSN (Data Source Name). To do this, we need to use the 32-bit application odbcad32.exe under the SysWOW64 folder. The steps are as below: Go to the SystemDSN tab -> Click on Add
Select the SQL Server driver SQLSRV32.DLL:
Give a name and Server details:
Provide the SQL Login details. You can also use Windows Authentication if it serves the purpose.
Select the required database by checking “Change the default database to:”
Click on Finish and Test Connection.
To use this in Classic ASP, add the DSN details in your cnconst file as below:
Geckodriver is an executable that interacts with Firefox installed on the System to run automated tests by running the Firefox instance either fully or in ghost-mode. Geckodriver creates profiles in the Windows temp folder that can be of huge size depending on the Profile created for the Firefox driver. The folder name is of the format “rust_mozprofile*”.
The following Powershell script will delete such folders by searching for this string format under C:\windows\temp and also creates logs for the deleted folders.
ASP is a program based on Microsoft Technologies that runs inside a web server.
Below is the method used for calling a Stored Procedure in MSSQLSERVER using classic ASP scripting.
The variable SystemDSN holds the value of the Data Source Name that is configured using Odbcad.exe under the SysWow64 folder on the Server. Select the required driver for SQL Server for the DSN configuration to connect to your database.
Set cn = Server.CreateObject("ADODB.Connection")
Set cmd = Server.CreateObject("ADODB.Command")
Set cmd.ActiveConnection = cn
cmd.CommandText = "usp_GetJSON"
cmd.CommandType = adCmdStoredProc
cmd.Parameters.Append(cmd.CreateParameter("@ReturnJson", adVarchar, adParamOutput,100000))
'show alert in case of failure.
ReturnValue = cmd.Parameters("@ReturnJson").Value
if ReturnValue <> " " then
jsonObject = ReturnValue
'set the flag as 1 to ensure that JSON has been returned from SP to be used later.
The above example shows the SP takes 3 input parameters and 1 output parameter. The SP returns a jsonObject assigned to the ReturnValue.
The ADO Connection Object is used to create an open connection to a data source which lets you access and manipulate a database. The ADO Command object is used to execute a single query against a database using which you can perform CRUD operations.
The json can be generated in the SP using the “FOR JSON PATH” feature for SQL Server. However, json is used just for this example. The return value can be anything as per your requirement.
This post is based on a setup of an asp.net core application. Configuration is read in the Startup class upon the Application startup. The Configure method in this class calls the ApiBootstrapper to check whether the connection string for Dev or Production is required. This can be further used to call the Stored Procedures or query tables using ADO.Net.
Appsettings.json file is the asp.net core config file. This file contains the Connection Strings is as shown below:
First, you need to access the mailbox on the Microsoft Exchange Server and then get the mailbox statistics for the count of e-mails. The credentials you use should have admin access on the Server to be able to access the mailbox.
The following script uses some credentials stored in a file on the machine where the script is running and connects to a Session on the Microsoft Exchange Server:
Reverse Proxy is an intermediate Server that might be exposed to the Internet that can help secure your incoming traffic from the Client and forwarding the request to a back-end service that might be on a Private network. This returns the response back to the Client and hides your Web Server from the Outside world.
You need the following IIS extensions for configuring IIS Reverse Proxy:
Some non .Net Applications like the ones written in classic ASP are required to be debugged in Visual Studio. Since these are not hosted on IIS Express, but on IIS, you need to identify the worker process running your machine or the Server and attach the w3wp.exe with the Debug tool in Visual Studio.
Enable Debugging under IIS classic ASP section as shown below:
Under the Debug menu in Visual Studio, select “Attach to Process”:
There may be multiple worker processes running on the machine depending on how many applications are running under IIS. Match the right one with the correct ProcessID.
Add the debug points in your Asp file and hit the required Page in the browser.
When it comes to managing your website traffic, one of the things to consider is the availability of your website.
IIS has a idle time-out property that is by default set to 20 minutes. This means that if no request comes for your site for 20 minutes of inactivity, IIS would kill the worker process to free-up resources. This means the memory utilised by loading of classes, session etc. This can be helpful when multiple websites may be hosted on the Server and is resource crunched.
You’ll find the below settings under the AppPool advanced settings:
So, when the next request comes to your site to access something e.g. Login page, IIS Server would again need to initialize the Worker process and load the required resources to serve that request. The first request will be slow to respond to the user because of all the initialization time required. You need to think in these terms that how much traffic usually comes to your site. If your website requires high availability, then you should consider setting the idle time-out to 0 in the App Pool settings. Or if high availability isn’t a concern, you can think for how many minutes you’d usually require your application to be available depending on the traffic.
There have been studies regarding the make or break for websites because of their initial load time. So, please be careful about this setting. Internet facing websites usually require high availability. For Intranet websites, you can think of some number of minutes based on the usage.