Login | Register   
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: VB7
Expertise: Intermediate
Jul 7, 2003

GetOsqlPath - Get the path of the SQL Server's OSQL.exe utility

' Get the path of the SQL Server's OSQL.exe utility
Function GetOsqlPath() As String
    Dim regKey As Microsoft.Win32.RegistryKey = _
        Microsoft.Win32.Registry.LocalMachine.OpenSubKey( _
        "SOFTWARE\Microsoft\Microsoft SQL Server\80\Tools\ClientSetup")
    If regKey Is Nothing Then
        Return ""
    End If

    Dim osqlPath As String = System.IO.Path.Combine(CType(regKey.GetValue _
        ("SQLPath"), String), "Binn\osql.exe")
    regKey.Close()
    Return osqlPath
End Function
Marco Bellinaso
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap