' 定义注册表API函数 Private Declare Function RegEnumKeyEx Lib "advapi32.dll" _ Alias "RegEnumKeyExA" _ (ByVal hKey As Long, _ ByVal dwIndex As Long, _ ByVal lpName As String, _ lpcbName As Long, _ ByVal lpReserved As Long, _ ByVal lpClass As String, _ lpcbClass As Long, _ ByVal lpftLastWriteTime As String) As Long
Private Declare Function RegOpenKeyEx Lib "advapi32.dll" _ Alias "RegOpenKeyExA" _ (ByVal hKey As Long, _ ByVal lpSubKey As String, _ ByVal ulOptions As Long, _ ByVal samDesired As Long, phkResult As Long) As Long
Private Declare Function RegCloseKey Lib "advapi32.dll" _ (ByVal hKey As Long) As Long
Private Declare Function SQLConfigDataSource Lib "odbccp32.dll" _ (ByVal hwndParent As Long, _ ByVal fRequest As Integer, _ ByVal lpszDriver As String, _ ByVal lpszAttributes As String) As Long
Function Check_SDSN()
' 查看我们要的系统数据源(DSN)是否存在。 ' 如果存在,正好;否则,我们就创建一个。
Dim lngKeyHandle As Long Dim lngResult As Long Dim lngCurIdx As Long Dim strvalue As String Dim classvalue As String Dim timevalue As String Dim lngvalueLen As Long Dim classlngvalueLen As Long Dim lngData As Long Dim lngDataLen As Long Dim strResult As String Dim DSNfound As Long Dim syscmdresult As Long