Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Mudrake
It was Environ(5) Derek |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|