Running SQL 2000...I'm writing some VB code (actually VBA) using ADO to
connect to SQL. I want to override the regular SQL Hostname -- which
normally displays the workstation ID -- with my own string, specified as
an arg to ADO's ConnectionString property. I wasn't sure if I use HOST
or WSID, so I used both:
strConnection = "Provider=SQLOLEDB.1;" & _
"User ID=XXXX;" & _
"Password=YYYYY;" & _
"Initial Catalog=BBBBB;" & _
"Host=ADO_SPECIAL;" & _
"WSID=ADO_SPECIAL;" & _
"Data Source=ZZZZZ"
However, when I do SP_WHO in Query Analyzer, HOSTNAME still displays the
name of the computer rather than my string. Any thoughts? Thanks much.
Mark J. McGinty - 28 Oct 2007 13:50 GMT
> Running SQL 2000...I'm writing some VB code (actually VBA) using ADO to
> connect to SQL. I want to override the regular SQL Hostname -- which
[quoted text clipped - 12 lines]
> However, when I do SP_WHO in Query Analyzer, HOSTNAME still displays the
> name of the computer rather than my string. Any thoughts? Thanks much.
Try:
Workstation ID=ZZZZZ;
(Hint: after a connection is opened, the connection object's
ConnectionString property value will often be a groomed and augmented
variation of its initial assignment.)
-Mark