Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Getting WorkstationID

I'm building a DSN connection on the fly in VB
NewPath = "ODBC;DSN=" & sNewDSN & ";Description=" & sNewDSN & ";UID=administrator;APP=Microsoft Office XP;WSID=ServerName;DATABASE=" & sNewDB & ";Network=DBMSSOCN;Trusted_Connection=Yes

However the application needs to be copied to several servers. Therefore I need to work out the WSID part in code, rather than hardcoding it to "Servername" as in the above example

Can anyone tell me how to do this

Thanks in advanc
Derek
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Getting WorkstationID

Have a look at the Environ settings

I have only used these on NT but I beleive they also apply to othe
Window versions

Sub ddd()
Dim i
For i = 1 To 57
Debug.Print "i = " & i & " " & Environ(i)
Next
End Su

--
Message posted from http://www.ExcelForum.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Getting WorkstationID

Thanks Mudrake

It was Environ(5)

Derek
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Getting WorkstationID

It is better to use

environ("Computername")

then you don't get the prefix, it is more descriptive, and will work where
it is not index 5.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Derek" wrote in message
...
Thanks Mudraker

It was Environ(5).

Derek



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 04:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"