Re: ADO connectstring for SQLServer not port 1433



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
.



Relevant Pages

  • Re: Migrating from VB6 and Printer object
    ... You can use the GetPrinter API call to get all the information (such as Port name) - e.g. ... ByRef phPrinter As Int32, _ ... Public pServerName As String ... Dim dmOut As New DEVMODE ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Serial port error statistics - any comparable data?
    ... Alas - the port in question is the native legacy motherboard port. ... The "cluster" in all the cases observed is the loss of exactly one character, ... "The quick brown fox jumps over the lazy dog 0123456789" ... the string from a port unblocked with fcntl - and the throw away python ...
    (comp.lang.python)
  • Re: How to convert array to string, and vice versa
    ... and converting it to a single string: ... then I have a string I can write to the database record. ... information about the port optics. ... to have a set of port-records, pointing to the interface card. ...
    (comp.lang.php)
  • Re: How Do I Find The Name of the Root Node
    ... send it out a dynamic send port. ... a string and then doing a string search for CIDS, if I find CIDS then I ... to enlist/start which means my orchestration is bound and needs to be ... BizTalk Deploymen Wizard to extract a new bindings file. ...
    (microsoft.public.biztalk.general)
  • Re: MSCOMM Troubles
    ... only contains the first 7 characters or the string. ... Private Sub MSComm1_OnComm ... Static Buffer As String ... code but none are dealing with a serial port. ...
    (microsoft.public.dotnet.languages.vb)