Web Hosting For ASP.NET World Class ASP.NET Hosting For LESS
24/7 Web Hosting For ASP.NET Money back guarantee Web Hosting For ASP.NET
Member Login •
Help Center •
Phone Number
1-214-7744035
Free Toll Call
Skip Navigation Links
Knowledgebase Home Page
Search the Knowledge Base
Keywords:
Search: Page Size:

Classic ASP
Q: ASP to MSSQL connection

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:

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

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

 

Remeber to change the (SERVERNAME) to match your connection string
for example if you mssql hostname is:   sqlserver.webhost4asp.com,777

then you have to change the string from
Server=(SERVERNAME);
to
Server=sqlserver.webhost4asp.com,777;




WebhostforASP.Net Copyright © 2003-2004 | All Rights Reserved |

All trademarks are property of their legal owners.