I'm using a vbs script to query SQL Servers.
And in the connection string, i'm trying transfer the following parameters: Server Name (PKNSQLEXP07\SQLINST7) and Port Number (2890).
Problem is, that i know that parameters in VBScript need to be outside the connection string, but i'm not sure how to accomplish that.
This is my connection string, without the parameters:
strConnection = "Driver={SQL Server};Server=PKNSQLEXP07\SQLINST7,2890;Database=master;Trusted_Connection=TRUE"
And this is with Parameters:
ConnectionString = Wscript.Arguments(0)
TcpPort = Wscript.Arguments(1)
strConnection = "Driver={SQL Server};Database=master;Trusted_Connection=TRUE;Server=" & ConnectionString &,& TcpPort
objCN.Open strConnection
The parameters (ConnectionString and TcpPort) should be with a comma sign between them.
But i have no luck so far, with my current connection string with the parameters.