ASP / ODBC info

Date: December 26th, 2011 | Category: Windows Hosting

How can I create and use a File DSN?

The following is an example of a file DSN. They are easy to setup, and in most cases faster than a system DSN:

Set DSNConn = Server.CreateObject(“ADODB.Connection”)
DSNConn.Open “DBQ=” & Server.MapPath(“database.mdb”) & “;Driver={Microsoft Access Driver (*.mdb)};DriverId=25;MaxBufferSize=8192;Threads=20;”, “admin”, “”

What are Active Server Pages (ASP)?

Active Server Pages is a fairly new programming language designed to run active content on the server and then display the result on the viewer’s browser. It is used extensively for such tasks as managing and querying on-line databases and building intuitive forms. Unlike JavaScript, which downloads the actual code into your browser and then activates, ASP pages run strictly on the server. The user triggers a request from the web page, the ASP processes it, and then sends back the requested info in purely HTML format- i.e. no actual ASP coding leaves the server and it is protected from being plagiarized. ckeck out for great ASP resources.

What server side scripting languages are supported?

At the moment we support VBScript and JavaScript, Perl/CGI, PHP, ColdFusion and more.

Where can I place my ASP files?

Your ASP files can be placed anywhere in your web. The root directory is a good location. If there is a global.asa file it must be in the root directory.
If you will be using multiple “applications” in different subwebs then you can use multiple global.asa files but you must contact and have your subwebs set up this way or set these up in the control panel for Windows OS plans.

What types of databases are supported with ODBC?

We are currently supporting MS Access. MS SQL is also supported for a more advanced database option on Pro plans.

What 3rd party ASP components have already been installed which I can use?

Component list: AspMail by Stephen Genusa lets you send Email from an ASP page. More info at ASPChart – This ASP components creates professional looking charts on the fly, so your charts remain dynamically linked to whatever information you provide them with. ASP-db PRO – Using ASP-db you can publish your Microsoft Access databases, Excel spreadsheets, SQL Server Database, or any other “ODBC” data source across the World Wide Web. If you want us to install a specific component for you, please contact .

What should my connection string look like for a system DSN?

This will work…
Session(“DataConn_ConnectionString”) = “DSN=mydsn” so will this… Session(“DataConn_ConnectionString”) = “DSN=mydsn;UID=;PWD=” If you are trying to use a file DSN it probably won’t work.

How do I use the same DSN setup on my local development computer?

You will also need to add a system DSN on your local computer for seamless operation. This can be done in your ODBC control panel.

1. Open the control panel, then double-click on the ODBC icon.
2. Select the System DSN tab. Click add for a new DSN.
3. Choose the appropriate driver (MS Access).
4. The Data Source Name should be the DSN. It should be the DSN we already set up for you.
5. Click on Database, select and choose the database file on you computer.
6. Click OK to exit.

I need to read/write files. How do I find the correct path for my site?

The correct way to do this would be using Server.MapPath. This would map the virtual path to a physical location on the disk. Ex. If you have a file in your root web called visitor.txt and you use Server.MapPath(“/visitor.txt”) and the physical path to you root web was “F:websyourweb” then it would return: “F:websyourwebvisitor.txt” If you use this method you should never have to worry about the physical paths.

Where can I find more information about programming in ASP?

ASPHole is a great site for ASP resources! Another good place to look is at where you will find many good links and components. is another great resource for Active Server Pages information. Finally, another great resource.

If I have multiple domains pointing to the same web, can I use ASP to find out which domain they used to reach my site?

This information is useful when you have multiple domains pointing to your IP and you want to redirect to the proper page according to domain name. You can use the following command in an ASP script to find the domain name used: Request.ServerVariables(“HTTP_HOST”) The following page shows a simple way to redirect to each domain name:

<% Dim HTTPHost HTTPHost = Lcase(Request.ServerVariables("HTTP_HOST")) If HTTPHost = "" then Response.Redirect (") End If If HTTPHost = "" then Response.Redirect (") End If %>

You can place this script as your default.asp and place your web content in sub-webs or subdirectories. If your domain name is and someone types in their browser, they will be redirected to The content for would be in that directory. If you also had pointing to your IP and someone typed in the browser, they would be redirected to You can see how this can be very useful.

Can I register a custom or 3rd party component on the server?

Since certain components can cause major security and stability problems on our Windows servers, they must all be approved prior to installation. You should upload the component to your directory along with it’s documentation for 3rd party components and source code for custom components. Send an email to Support with your IP address and default username along with the specific details of the component. If we approve the component, we will install it in MTS or with regsvr32.exe. If we are installing a custom component, it should be fully debugged and tested. If any component is found to compromise the system, it will be removed. There is a $25 setup fee for each registration and you must be on CorpWeb or above. The component must not be in a setup package. We will not run setup programs on our servers in order to install components due to the fact that they sometimes overwrite newer DLL’s. Please allow 1 to 2 weeks for registering components.

Do you support VB6 webclass DLL’s?

Yes. Although the runtime is installed on most of our servers, in some cases where it is not installed, we may need to install it. We will install it when we register your component.

Do you support remote debugging of ASP?

We currently do not support remote debugging of ASP.

Do you support the VB Package and Deployment Wizard?

We do not support deployment with the PDW. You can still use your components, but not deploy them with the PDW.

Article published on Sibername Help Center -

Print this article!