Connection Strings (MSSQL 2005, MSSQL 2008, MySQL5, MS Access Database)

MSSQL2005
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "Provider=SQLOLEDB; Data Source =mssql.yourdomain; Initial Catalog = Yourdatabase; User Id = USER; Password=PASSWORD; Network Library=dbmssocn;"
If conn.errors.count = 0 Then
Response.Write "Connected OK"

MSSQL 2008
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "Provider=SQLOLEDB; Data Source=mssql.yourdomain,1433;Network Library=DBMSSOCN;Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword;"
If conn.errors.count = 0 Then
Response.Write "Connected OK"

 

MySQL5 - MySQL Connector/ODBC 3.51

Driver={MySQL ODBC 3.51 Driver};Server=myServerAddress;Port=3306;Database=myDataBase;User=myUsername; Password=myPassword;Option=3;

To Know more about Connection Strings open the following link
http://www.connectionstrings.com/

  • 1 Users Found This Useful
Was this answer helpful?

Related Articles

How do I use an Access database on my site?

Microsoft Access is part of the Microsoft Office suite of applications and is a database that is...

Import Export MySQL database using PhpMyAdmin

Do the following steps for import/export mysql database: Open phpMyAdmin.by going to...

What is MySQL?

MySQL is an open source database server, much like Microsoft SQL Server or Oracle. You can store...

What connection parameters do I use to connect to my database

Connection information : You can connect to your database either via a dns name ie...