Re: ADO connectstring for SQLServer not port 1433
- From: Ross McKay <rosko@xxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 27 May 2005 23:23:02 GMT
On Mon, 23 May 2005 20:36:15 -0500, "Owen Corpening" wrote:
>right now I am using this connect string:
>"DRIVER={SQL
>Server};SERVER=myserver;DATABASE=mydatabase;Trusted_Connection=yes;"
>or
>"DRIVER={SQL
>Server};SERVER=myserver;DATABASE=mydatabase;Trusted_Connection=no;UID=userna
>me;PWD=password;"
>
>but what if my sqlserver is not on the default port (1433)?
Given a port of 1234, just add ",1234" to the server name:
"DRIVER={SQL Server};SERVER=myserver,1234;..."
With a named instance,
"DRIVER={SQL Server};SERVER=myserver\instance,1234;..."
NB: I've struck a product installer that automated the running of
scripts against the database, and failed to connect with this form of
connection string. The only way around that is to create an alias in SQL
Server Client Network Utility, specifying the port and instance.
--
Ross McKay, Toronto, NSW Australia
"Let the laddie play wi the knife - he'll learn"
- The Wee Book of Calvin
.
- References:
- ADO connectstring for SQLServer not port 1433
- From: Owen Corpening
- ADO connectstring for SQLServer not port 1433
- Prev by Date: ADO recordset, Oracle and Windows2000
- Next by Date: Re: Connection object question
- Previous by thread: Re: ADO connectstring for SQLServer not port 1433
- Next by thread: DataGrid and colum caption
- Index(es):
Relevant Pages
|
|