Re: Changing the sql server ports in VB

David Symanowicz <[email protected]> Thu, 14 Nov 2002 10:51:00 -0500
Newsgroups gmane.comp.windows.devel.vbcom
Message-ID <[email protected]>
Manikandan,

If it is a SQL2000 server you can use the Registry2 Object.  For example:

dim pServer as new SqlServer2
dim pReg as Registry2

pServer.Connect "localhost","sa","sapwd"
set pReg = pServer.Registry
Debug.Print "The currrent TCP/IP Port is :" & pReg.TcpPort              'should be 1433
by default

'alter the port
pReg.TcpPort = 1434
Debug.Print "The new TCP/IP Port is :" & pReg.TcpPort

'clean up
pServer.Disconnect
set pReg = nothing
set pServer = nothing

-Dave

-----Original Message-----
From: Technical discussion of VBCOM [mailto:[email protected]]On
Behalf Of P. S. Manikandan
Sent: Wednesday, November 13, 2002 11:54 PM
To: [email protected]
Subject: [VBCOM] Changing the sql server ports in VB


Hi,
      How do i change the sqlserver ports to which its listening using VB
code.. can anyone give me some ideas or sample code.

Thx in advance
Manikandan

You can read messages from the VBCOM archive, unsubscribe from VBCOM, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the VBCOM archive, unsubscribe from VBCOM, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.