Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / Database Access / October 2007



Tip: Looking for answers? Try searching our database.

Override HOSTNAME with ConnectionString property?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rick - 23 Oct 2007 22:02 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
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.