Web Hosting Canada Logo
 

Creating database connections from ASP pages

Further information may be found on the Microsoft support site

General Information

In order for your asp pages to get and save information in a database, you must tell the webserver how to connect to your database.

Additionally, if you intend to write to the database, we must manually set the permissions on the server to do this.

For best security, we recommend that you create a directory on the same level as the www\ directory, and place your database in there. Choose whatever name you wish, 'database' is a good choice

Once you have created the directory and uploaded your database, email support@wedohosting.com with your domain name and the location of your database, and we will set the permissions correctly.
If you are not going to write to the database, you may omit this step

The full server path to your database will be, assuming you named the directory 'database':

d:\web\yourdomain.com\database\mydatabase.mdb

DSN vs. DSN-less connections.

A DSN is a Data Source Name, and is a shortcut form used to connect to a database.
Microsoft is currently recommending that you use DSN-less connections. If you must have a DSN (for instance, if you're using ColdFusion) then please email support@wedohosting.com and we will set up the connection for you. You will need to provide the path to the database, and your connection will generally be named yourdomain_com (ie your domain name, with dashes and periods replaced with the underscore character)

DSN-less connections allow you to start working with your data immediately, and allow you to create unlimited databases for your use.

Sample Connection Strings

Microsoft Access Without DSN
<%
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=d:\web\mydomain.com\database\mydatabase.mdb"
%>
Microsoft Access With DSN
<%
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.open "DSNname"
%>

SQL Server databases require you to be on a web package that supports it.

If you require a database, you will need to email support@wedohosting.com and we will set up your database, and email you instructions once we have completed the setup.

Microsoft SQL Server Without DSN

<%
Set Conn = Server.CreateObject("ADODB.Connection")
DSNtest="DRIVER={SQL Server};SERVER=vader.wedohosting.com;UID=USER;PWD=password;DATABASE=mydatabase"
Conn.open DSNtest
%>
Microsoft SQL Server With DSN
<%
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.open "DSN=MyDSN;UID=user;PWD=password;DATABASE=mydatabase"
%>

Proudly Providing Web Hosting From Canada, For The World.

Web Hosting Services From Canada

WeDoHosting Canada: Virtual Web Hosting | Dedicated Servers | Server Colocation | Ecommerce Hosting | Specials
Linux Web Hosting: Linux | Dedicated Servers | High Storage | Virtual Dedicated Servers
Windows Web Hosting: ASP.Net | ColdFusion | Dedicated Windows Servers
Additional Services: Email Only Web Hosting | Managed Services | Private Label Hosting | Affiliate Program | Canada Domain Registration | Value Added Services | Canada-based Hosting Services | Premium Packages | Website Templates
Regional: Main | Canada | US

WeDoHosting Canada Corporate Information:
WeDoHosting Canada Home | Contact Us | Award Winning | Services Map | Online Resources | Internet Resources | Facilites in Canada | Privacy Policy | Large File Sending

 

WeDoHosting's SEO for "web hosting canada", "virtual hosting", and more
provided by Beanstalk Search Engine Positioning, Inc.

WeDoHosting.com Inc. #101-4226 Commerce Circle, Victoria BC Canada V8Z 6N6
Phone: 1-250-479-1595 Toll Free: 1-888-647-9336 Fax: 1-250-479-1517
A Division of FroZen Dirt Media Corp.

Terms of Service and Acceptable Use Policy