UK WEB HOSTING FORUM FOR DISCUSSION ON WEB HOSTING SERVICE AND SUPPORT
LINUX HOSTING WINDOWS HOSTING PACKAGES SHOPPING CART OSCOMMERCE ZEN CART AGORA
ECOMMERCE HOSTING ASP MSSQL FRONTPAGE HOSTING PHP MYSQL HOSTING DISCUSSION FORUM
CPANEL RESELLER HOSTING DEDICATED SERVER VPS HOSTING PLESK VIRTUOZZO
Quick Search
Your forum announcement here!

  UK Web Hosting | Dedicated Server Windows and Linux VPS Forum > Technical Support > Windows Reseller Hosting

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-07-2007, 21:06
System Administrator
 
Join Date: Dec 2006
Location: localhost
Posts: 633
Lightbulb MSSQL 2000 connection strings

Hi,

I find a lot of people not very much comfortable with connection strings. It's a string passed in code that specifies connection information directly to the Driver Manager and driver.

SQL Server 2000

This is a compiled connection strings reference list on how to connect to SQL Server.
ODBC Standard Security
Quote:
Driver={SQL Server};Server=myServerAddress;Database=myDataBase ;Uid=myUsername;Pwd=myPassword;
Trusted connection
Quote:
Driver={SQL Server};Server=myServerAddress;Database=myDataBase ;Trusted_Connection=Yes;
Prompt for username and password
This one is a bit tricky. First you need to set the connection object's Prompt property to adPromptAlways. Then use the connection string to connect to the database.
Quote:
oConn.Properties("Prompt") = adPromptAlways

Driver={SQL Server};Server=myServerAddress;Database=myDataBase ;
OLE DB, OleDbConnection (.NET)
Standard Security
Quote:
Provider=sqloledb;Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;
Trusted connection
Quote:
Provider=sqloledb;Data Source=myServerAddress;Initial Catalog=myDataBase;Integrated Security=SSPI;
Use serverName\instanceName as Data Source to use a specific SQL Server instance. Please note that the multiple SQL Server instances feature is available only from SQL Server version 2000 and not in any previous versions.

Prompt for username and password
This one is a bit tricky. First set the connection object's Provider property to "sqloledb". Thereafter set the connection object's Prompt property to adPromptAlways. Then use the connection string to connect to the database.
Quote:
oConn.Provider = "sqloledb"
oConn.Properties("Prompt") = adPromptAlways

Data Source=myServerAddress;Initial Catalog=myDataBase;
Connect via an IP address
Quote:
Provider=sqloledb;Data Source=192.168.0.1,1433;Network Library=DBMSSOCN;Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword;
DBMSSOCN=TCP/IP. This is how to use TCP/IP instead of Named Pipes. At the end of the Data Source is the port to use. 1433 is the default port for SQL Server.

SqlConnection (.NET)
Standard Security
Quote:
Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;
Standard Security alternative syntax
This connection string produce the same result as the previous one. The reason to include it is to point out that some connection string keywords have many equivalents.
Quote:
Server=myServerAddress;Database=myDataBase;User ID=myUsername;Password=myPassword;Trusted_Connecti on=False;
Trusted Connection
Quote:
Data Source=myServerAddress;Initial Catalog=myDataBase;Integrated Security=SSPI;
Trusted Connection alternative syntax
This connection string produce the same result as the previous one. The reason to include it is to point out that some connection string keywords have many equivalents.
Quote:
Server=myServerAddress;Database=myDataBase;Trusted _Connection=True;
Use serverName\instanceName as Data Source to use a specific SQL Server instance. Please note that the multiple SQL Server instances feature is available only from SQL Server version 2000 and not in any previous versions.
Connect via an IP address
Quote:
Data Source=192.168.0.1,1433;Network Library=DBMSSOCN;Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword;
DBMSSOCN=TCP/IP. This is how to use TCP/IP instead of Named Pipes. At the end of the Data Source is the port to use. 1433 is the default port for SQL Server.

Specifying packet size
Quote:
Server=myServerAddress;Database=myDataBase;User ID=myUsername;Password=myPassword;Trusted_Connecti on=False;Packet Size=4096;
By default, the Microsoft .NET Framework Data Provider for SQL Server sets the network packet size to 8192 bytes. This might however not be optimal, try to set this value to 4096 instead.

Data ShapeMS Data Shape
Quote:
Provider=MSDataShape;Data Provider=SQLOLEDB;Data Source=myServerAddress;Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword;
I'll be posting an article regarding connecting to an MSSQL 2005 database shortly.
__________________

Rock _a.k.a._ Jack L.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
||
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Reply With Quote
  #2 (permalink)  
Old 06-07-2007, 23:42
DPS Computing's Avatar
Premium Member
 
Join Date: Apr 2007
Location: Manchester, United Kingdom
Posts: 4,890
Send a message via ICQ to DPS Computing Send a message via AIM to DPS Computing Send a message via MSN to DPS Computing Send a message via Yahoo to DPS Computing Send a message via Skype™ to DPS Computing
Default

Thanks for that Rock - I'm sure people will find it useful - its been really good to see the amount of tutorials being posted recently!
__________________
David Smith
DPS Computing

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
- New site / new polls / new stories! With many more to follow!
NEW LAUNCH!
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

NEW LAUNCH!
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Reply With Quote
  #3 (permalink)  
Old 07-07-2007, 07:00
System Administrator
 
Join Date: Dec 2006
Location: localhost
Posts: 633
Default

As promised, here's an article for connecting to MSSQL 2005 database from your scripts/web-pages : http://www.eukhost.com/forums/showthread.php?p=16110
__________________

Rock _a.k.a._ Jack L.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
||
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Reply With Quote
  #4 (permalink)  
Old 07-07-2007, 10:44
DPS Computing's Avatar
Premium Member
 
Join Date: Apr 2007
Location: Manchester, United Kingdom
Posts: 4,890
Send a message via ICQ to DPS Computing Send a message via AIM to DPS Computing Send a message via MSN to DPS Computing Send a message via Yahoo to DPS Computing Send a message via Skype™ to DPS Computing
Default

The new tutorial on MSSQL 2005 database connection strings is definitely comprehensive!! Maybe some of these should start getting added to the support section of the website hosting or the knowledgebase - they are really good and helpful.
__________________
David Smith
DPS Computing

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
- New site / new polls / new stories! With many more to follow!
NEW LAUNCH!
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

NEW LAUNCH!
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 06:24.

 

Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by Web Hosting 3.1.0
Copyright © 2001-2008, eUKhost.com. All rights reserved.

 
Site Map

VPS Hosting
VPS Hosting plans

Dedicated Server Hosting
Dedicated Server plans

Business Web Hosting
100% uptime Hosting

Cpanel Hosting
cPanel Shared Hosting

Reseller Hosting
Reseller Web Hosting

Windows Hosting
Windows Shared Hosting

Windows VPS

Windows VPS Hosting

Semi Dedicated Servers
Semi-Dedicated Hosting

Dedicated Server Mirroring
Dedicated Server Mirroring

Webhosting Knowledgebase
Frequently asked Questions

Web Hosting Blog
eUKhost Blog

Web Hosting Support
Support Helpdesk

UK Data Center
eUKhost Datacenter

Web Hosting Forum
eUKhost Forum

Support Tutorials
Online Flash Tutorials

Offsite Back-up Plans
Remote Backup Service

Customer Testimonials
eUK Customer Testimonials


knowledgebase articles

eUKhost.com Services

Pre-Sales Questions
Pre-sales FAQ's

Domain Names
Domain registration FAQ's

cPanel Hosting
cPanel Hosting FAQ's

Windows Web Hosting
Plesk Control Panel

Reseller Hosting
Reseller Hosting FAQ's

VPS Hosting
Virtual Private Server

Semi-Dedicated Servers
Semi-Dedicated FAQ's

Dedicated Servers
Dedicated Server Hosting


popular blog categories


Web Hosting
Website Hosting articles

UK Web Hosting
UK Hosting articles

Dedicated Server Hosting
Dedicated Server guidelines

VPS Hosting
VPS hosting articles

cPanel Hosting
cPanel Hosting articles

Linux Operating System
Linux Operating techniques

Windows Web Hosting
Windows plesk articles