用VB.NET2005安装Firebird数据库驱动
来源:优易学  2011-12-10 20:37:11   【优易学:中国教育考试门户网】   资料下载   IT书店
  这段子程序的可靠性还有待验证。但是,在程序里自己写(装)驱动,其意义可不光是装装驱动那么简单。
  Private Sub RegODBCDriver(ByVal ODBCDriverName As String, ByVal DllPathAndName As String)
  Dim r As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.LocalMachine
  Dim s As Microsoft.Win32.RegistryKey = r.OpenSubKey("SOFTWAREODBCODBCINST.INI", True)
  s.CreateSubKey(ODBCDriverName)
  Dim d As Microsoft.Win32.RegistryKey = s.OpenSubKey(ODBCDriverName, True)
  d.SetValue("Driver", DllPathAndName)
  d.SetValue("Setup", DllPathAndName)
  d.SetValue("APILevel", "1")
  d.SetValue("SQLLevel", "1")
  d.SetValue("ConnectFunctions", "Y")
  Dim f As Microsoft.Win32.RegistryKey = s.OpenSubKey("ODBC Drivers", True)
  f.SetValue(ODBCDriverName, "Installed")
  End Sub

责任编辑:小草

文章搜索:
 相关文章
热点资讯
资讯快报
热门课程培训