Portal HomeClient AreaAnnouncementsKnowledgebaseSupport TicketsAvailable Downloads
Please Login or Register

Knowledgebase

How to connect to MSSQL from ASP Coding

Before you can access your MS-SQL Server database from your ASP code , you need to connect to it using one of the following available methods:

1. Connect to a MS-SQL database with OLEDB:

Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open "Provider=SQLOLEDB; Data Source=(serverip); Initial
Catalog=your_database_name; User ID=your_username; Password=your_password"
objConn.Close
Set objConn = Nothing

2. Connect to a MS-SQL Server database with MS-SQL Driver:

Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open "Driver={SQL Server};" & _
"Server=(serverip);" & _
"Database=your_database_name;" & _
"Uid=your_username;" & _
"Pwd=your_password;"
objConn.Close
Set objConn = Nothing

 

PS: change the (serverip) to match your conn string

for example if you mssql hostname is:   127.0.0.1,123

then you have to change the string from
Server=(serverip);

to

Server=127.0.0.1,123;



Was this answer helpful?

Add to Favourites Add to Favourites

Print this Article Print this Article

Also Read

Language:

Quick Navigation

Client Login

Email

Password

Remember Me

Search



 
Services
Get Started
Web hosting
Services
Products
Opportunities
Learn More
What is Web Hosting?
Dedicated Hosting
Virtual Hosting
What is a Shopping Cart?
Web Hosting Services
Email Hosting Services
Front Page Hosting Services
Shared Web Hosting Services
Shopping Cart Hosting Services
Client Resources
Update your Billing Info
Login to Support
Manage your Hosting Services
Manage your Exchange Services
Login to Webmail
Login to Exchange Webmail
Support Articles (Knowledgebase)
Did You Know



Prestige Techologies
on Twitter


Facebook
Prestige Technologies
on Facebook


Copyright © 2002- Prestige Technologies, LLC All Rights Reserved | New Jersey Based Company