请问SQL SERVER2000 的 ODBC驱动文件在哪啊 怎么找???
请详细介绍谢谢大家了

解决方案 »

  1.   

    各位朋友 我说的不是  : bhhxd(天外来客)  说的那个啊
    而是类式 ODBC驱动(Driver)  c:\sqlany50\win32\wod50t.dll
    我想找那个文件
    另外加一个问题就是
    可以在一个SQL SERVER2000数据库中在建立其他的数据库么???
    例如: 我现在在 数据库A 中进行操作,我想通过A再建立一个B数据库,可以实现么???
      

  2.   

    1.sqlsrv32.dll在c:\winnt\system32下2.可以,一个服务器中允许建立多个数据库的。
      

  3.   

    我的最终意图是想用语句进行ODBC配置
    不知道可行否
      

  4.   

    可以。不过我建义你用连接字符串来做。不要用ODBC的dsn文件来做。你的信箱??我发一个例程给你。
      

  5.   

    两个例子(W2K Server)
    如果需要在其它的系统或配置其它的数据库,可以自己分析注册表[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC]下的内容,并实现自己的需求。'SQL Server
    Option Explicit
    Const HKEY_CLASSES_ROOT = &H80000000
    Const HKEY_CURRENT_USER = &H80000001
    Const HKEY_LOCAL_MACHINE = &H80000002
    Const HKEY_USERS = &H80000003
    Const HKEY_PERFORMANCE_DATA = &H80000004
    Const HKEY_CURRENT_CONFIG = &H80000005
    Const HKEY_DYN_DATA = &H80000006
    Const REG_NONE = 0
    Const REG_SZ = 1
    Const REG_EXPAND_SZ = 2
    Const REG_BINARY = 3
    Const REG_DWORD = 4
    Const REG_DWORD_BIG_ENDIAN = 5
    Const REG_MULTI_SZ = 7Private Declare Function RegSetValueEx Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, lpData As Any, ByVal cbData As Long) As Long
    Private Declare Function RegCreateKey Lib "advapi32.dll" Alias "RegCreateKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
    Private Sub Command1_Click()
    Dim hKey As Long
    Dim DSNName, strDriver, strServer, strDatabase, strLastUser, strDBType As StringDSNName = "MYSQLODBC"strDriver = "C:\\WINNT\\System32\\sqlsrv32.dll" 'SQL Server的驱动,如果用VFP可以改成相应的文件
    strServer = "SERVER"
    strDatabase = "test"
    strLastUser = "sa"
    strDBType = "SQL Server"RegCreateKey HKEY_LOCAL_MACHINE, "SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources", hKey
    RegSetValueEx hKey, DSNName, 0, REG_SZ, ByVal strDBType, Len(strDBType) + 1RegCreateKey HKEY_LOCAL_MACHINE, "SOFTWARE\ODBC\ODBC.INI\" & DSNName, hKey
    RegSetValueEx hKey, "Driver", 0, REG_EXPAND_SZ, ByVal CStr(strDriver), Len(strDriver) + 1
    RegSetValueEx hKey, "Server", 0, REG_SZ, ByVal CStr(strServer), Len(strServer) + 1
    RegSetValueEx hKey, "Database", 0, REG_SZ, ByVal CStr(strDatabase), Len(strDatabase) + 1
    RegSetValueEx hKey, "LastUser", 0, REG_SZ, ByVal CStr(strLastUser), Len(strLastUser) + 1
    End Sub'VFP 目录
    Option Explicit
    Const HKEY_CLASSES_ROOT = &H80000000
    Const HKEY_CURRENT_USER = &H80000001
    Const HKEY_LOCAL_MACHINE = &H80000002
    Const HKEY_USERS = &H80000003
    Const HKEY_PERFORMANCE_DATA = &H80000004
    Const HKEY_CURRENT_CONFIG = &H80000005
    Const HKEY_DYN_DATA = &H80000006
    Const REG_NONE = 0
    Const REG_SZ = 1
    Const REG_EXPAND_SZ = 2
    Const REG_BINARY = 3
    Const REG_DWORD = 4
    Const REG_DWORD_BIG_ENDIAN = 5
    Const REG_MULTI_SZ = 7Private Declare Function RegSetValueEx Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, lpData As Any, ByVal cbData As Long) As Long
    Private Declare Function RegCreateKey Lib "advapi32.dll" Alias "RegCreateKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
    Private Sub Command1_Click()
    Dim hKey As Long
    Dim DSNName, strDriver, strDBType As String
    dim strSourceDB,strDescription,strSourceType,strBackgroundFetch,strExclusive,strNull,strDeleted,strCollate,strSetNoCountOn as stringDSNName = "MYVFPODBC"strDriver="C:\\WINNT\\System32\\vfpodbc.dll"
    strSourceDB="c:\\VFPDB"
    strDescription="VFP DB"
    strSourceType="DBF"
    strBackgroundFetch="Yes"
    strExclusive="No"
    strNull="Yes"
    strDeleted="Yes"
    strCollate="Machine"
    strSetNoCountOn="No"
    strDBType = "Microsoft FoxPro VFP Driver (*.dbf)"RegCreateKey HKEY_LOCAL_MACHINE, "SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources", hKey
    RegSetValueEx hKey, DSNName, 0, REG_SZ, ByVal strDBType, Len(strDBType) + 1RegCreateKey HKEY_LOCAL_MACHINE, "SOFTWARE\ODBC\ODBC.INI\" & DSNName, hKey
    RegSetValueEx hKey, "Driver", 0, REG_EXPAND_SZ, ByVal CStr(strDriver), Len(strDriver) + 1
    RegSetValueEx hKey, "SourceDB", 0, REG_SZ, ByVal CStr(strSourceDB), Len(strSourceDB) + 1
    RegSetValueEx hKey, "Description", 0, REG_SZ, ByVal CStr(strDescription), Len(strDescription) + 1
    RegSetValueEx hKey, "SourceType", 0, REG_SZ, ByVal CStr(strSourceType), Len(strSourceType) + 1
    RegSetValueEx hKey, "BackgroundFetch", 0, REG_SZ, ByVal CStr(strBackgroundFetch), Len(strBackgroundFetch) + 1
    RegSetValueEx hKey, "Exclusive", 0, REG_SZ, ByVal CStr(strExclusive), Len(strExclusive) + 1
    RegSetValueEx hKey, "Null", 0, REG_SZ, ByVal CStr(strNull), Len(strNull) + 1
    RegSetValueEx hKey, "Deleted", 0, REG_SZ, ByVal CStr(strDeleted), Len(strDeleted) + 1
    RegSetValueEx hKey, "Collate", 0, REG_SZ, ByVal CStr(strCollate), Len(strCollate) + 1
    RegSetValueEx hKey, "SetNoCountOn", 0, REG_SZ, ByVal CStr(strSetNoCountOn), Len(strSetNoCountOn) + 1
    End Sub
      

  6.   

    发送者 chenyu5188 发送时间 2003-4-24 8:25:04 删除  回复  
    内容 用连接字符串来连接数据库就是说你的数据库连接不用ODBC配置的DSN文件来连接,在程序中字符串方式来做。
    比如:
    strcon = "Provider=SQLOLEDB;Driver={SQL Server};Server=Server;Uid=sa" & _
                ";Pwd=1;Database=data"
    adoCN.Open strcon
    说明:strcon中存放的就是连接数据库的字符串,这个要比ODBC方便多了。