PDA

View Full Version : Using SQLDMO in DevStudio, how do I....



sgrebey
11-07-2003, 10:49 AM
...get the name of the local machine? Sorry, kind of new to SQL Server and DevStudio. Trying to connect to use a named Instance, in my case it is:

strServer = "VBDev\\MedWare";

but how do I get the VBDev part (mahcine name)? I tried:

strServer = "(LOCAL)\\MedWare"; but it didn't like that.

sgrebey
11-07-2003, 01:41 PM
In case anybody is interested....

GetEnvVar("COMPUTERNAME",strCompName);

LewisQ
11-07-2003, 02:04 PM
There is also a property named ComputerName that can be retrieved via MSIGetProperty().