|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
HOST_NAME() oddnessDoes this make any sense?? SELECT HOST_NAME() gives correct workstation name when run within QueryAnalyzer on my workstation, BUT.... We have a stored proc which uses HOST_NAME() to store a logon record. When the stored proc is called from VBA code (we have to pass it a User ID), the stored proc is saving completely the wrong workstation name. Doh!!! Is this a known 'feature', or am I missing something (grey cells?) TIA Steve HOST_NAME (aka workstatioID) is set by the client application. Most APIs (to my knowledge) will set
it automatically if you don't define it. Apparently, the one you are using doesn't do this. Try setting it in the connection string. The attribute to set can possibly be called WSID (the named in ADO.NET, classic ADO, which is what I guess you are suing, can possibly have some different name). -- Show quoteTibor Karaszi, SQL Server MVP http://www.karaszi.com/sqlserver/default.asp http://www.solidqualitylearning.com/ "CyberDwarf" <steve.in***@lineone.net> wrote in message news:ObmC%23NUvGHA.416@TK2MSFTNGP04.phx.gbl... > Hi y'all > > Does this make any sense?? > > SELECT HOST_NAME() > gives correct workstation name when run within QueryAnalyzer on my workstation, BUT.... > > We have a stored proc which uses HOST_NAME() to store a logon record. > > When the stored proc is called from VBA code (we have to pass it a User ID), the stored proc is > saving completely the wrong workstation name. Doh!!! > > Is this a known 'feature', or am I missing something (grey cells?) > > > TIA > > Steve > Hi Tibor
I am using:- DoCmd.RunSQL "Exec dbo.SetLogon " & UserID where SetLogon is the SP containing the call to HOST_NAME(). So, no ADO..... A quick Google search indicates that DoCmd.RunSQL is some Access thingy. I suggest you post to an
Access forum for information on how to set the hostname when using DoCmd.RunSQL. -- Show quoteTibor Karaszi, SQL Server MVP http://www.karaszi.com/sqlserver/default.asp http://www.solidqualitylearning.com/ "CyberDwarf" <steve.in***@lineone.net> wrote in message news:uwHQhBVvGHA.2436@TK2MSFTNGP06.phx.gbl... > Hi Tibor > > I am using:- > DoCmd.RunSQL "Exec dbo.SetLogon " & UserID > where SetLogon is the SP containing the call to HOST_NAME(). > > So, no ADO..... > |
|||||||||||||||||||||||