Microsoft Access and ASP connection script for Windwos 2008 / 2012 shared hosting

If your website is hosted on our Windows 2008 or Windows 2012 shared hosting server, you will have to use the following database connection string to use Microsoft Access database with ASP script.

Sample 1

<%
strCN = "DRIVER={Microsoft Access Driver (*.mdb)};" & _
            "DBQ="& server.mappath("database.mdb") &""
Set objCN = Server.CreateObject("ADODB.Connection")
objCN.Open strCN
response.write("connection successful")
%>

Sample 2

Dim objConn
Set objConn=Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\domains\your-user-name\your-website-name\data\database-file-name.mdb;"
objConn.Open

  • 0 Users Found This Useful

Was this answer helpful?

Related Articles

Sample script for CDO email

CDO (Collaboration Data Objects) is an inbuilt ASP component used to send emails via ASP. It is...

How to create ASPNETDB database using aspnet_regsql tool?

What is ASPNETDB? Microsoft has introduced a new and powerful default database schema in...

How to use Dundas Chart?

How to create a Basic Pie Chart with Dundas Chart To use this control in a web site, you will...

FormMail script for Windows 2008 / 2012 customers

We have developed the formmail script for our Windows shared hosting customers. This script can...

How to send emails through JMail?

We have installed JMail on our Windows shared servers. You can use following sample script to...