通过MS SQL Server访问注册表


使用扩展存储过程 xp_regread 和 xp_regwrite 来访问注册表。

举例说明:

 1   
 2Dim cnn   
 3Dim rs   
 4dim strSQL   
 5Set cnn = Server.CreateObject("ADODB.Connection")   
 6cnn.Open "provider=sqloledb;data source=.;initial catalog=master;user id=sa;password=;"   
 7strSQL = "xp_regread 'HKEY_LOCAL_MACHINE'," &_   
 8'SOFTWAREMicrosoftWindowsCurrentversion','CommonFilesDir'"   
 9Set rs = cnn.Execute(strSQL)   
10Response.Write "Common files Path : " & rs("data")   
11rs.Close   
12Set rs = Nothing   
13cnn.Close   
14Set cnn = Nothing   
Published At
Categories with 数据库类
comments powered by Disqus