Home All Groups Group Topic Archive Search About
Author
11 Aug 2006 12:44 PM
CyberDwarf
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

Author
11 Aug 2006 1:11 PM
Tibor Karaszi
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 quote
"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
>
Author
11 Aug 2006 2:16 PM
CyberDwarf
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.....
Author
11 Aug 2006 2:23 PM
Tibor Karaszi
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 quote
"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.....
>

AddThis Social Bookmark Button