????? ????? ????? ?????? ODBC ??? ????? ?????????

?????? ????????? ?????? ?????????
???? ???????: 123008 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

?? ??? ??????

??????

?????? ??? ??????? ????? ?????? ??????? ?????? ???? ?????? ODBC ??? ???????:
  • ????? ODBC
  • RegisterDatabase
  • ODBC api
  • ????? ??? INI ?????

??????? ????

??????? ????????

??? ?? ??? ????? ??????? ??????? ?? ??????? ????? ?? ?? ???? ??????? ODBC. ??? ??????? "????? ???????" ?????? ????? ??????? ? ???? ?? ?? ??????? ???????? ??????? ?? ????? ???????. ??? ????? ???? ??????? ??????? ?? ???? \WINDOWS\SYSTEM.

??? ?????? ?????? ???? ??????? ??????? (SQL Server ?? Oracle) ???????? ????? (*).
File                  Description
----------------------------------------------------------------------
ODBC.DLL              The ODBC Driver Manager. This DLL is called by the
                      Microsoft Jet database engine when performing ODBC
                      operations. The Driver Manager handles loading the
                      correct ODBC driver and dispatching ODBC function
                      calls to the driver.

ODBCINST.DLL          The ODBC Driver Installation library. This DLL
                      contains Driver installation specific functions.
                      The ODBC Administrator (ODBCADM.EXE) calls functions
                      exported from this DLL when installing ODBC
                      drivers. You may also call functions in this DLL
                      to automate driver installation.

ODBCADM.EXE           The ODBC Administrator program. This program
                      allows a user to install ODBC drivers and
                      set up or modify Data Sources.

ODBCINST.HLP          The ODBC Administrator help file.

COMMDLG.DLL           The Common Dialog DLL. This DLL is used by the
                      ODBC Administrator program.

CTL3D.DLL             The 3D Control DLL. This DLL is used by the ODBC
                      Administrator program. If you are using ODBC.DLL
                      version 1.05 or greater, you need to distribute
                      CTL3DV2.DLL.

PDSODBC.DLL           Crystal Reports Physical Server DLL for ODBC. This
                      DLL is required only if your application uses Crystal
                      Reports to access an ODBC data source.

<driver>.DLL          The ODBC driver(s) that the application will use
                      to connect to specific Data Sources.

                      SQL Server:  SQLSRVR.DLL*
                      Oracle 6:    SQORA.DLL*

<netlib>.DLL          The network library file(s). This file is used
                      to access the Data Source when using a specific
                      network protocol.

                      Named Pipes: DBNMP3.DLL*
                      TCP/IP (Sybase SQL Server): WDBNOVTC.DLL*
                      IPX/SPX (Sybase SQL Server): WDBNOVSP.DLL*
                      SQL*Net Interface: ORA6WIN.DLL*

INSTCAT.SQL*          SQL Server Catalog Stored Procedures script.

DRVSSRVR.HLP*         SQL Server ODBC Driver help file.

ORASETUP.DLL*         Oracle ODBC Driver setup functions.

DRVORACL.HLP*         Oracle ODBC Driver help file.

ORACLE.TXT*           Oracle ODBC Setup "read me" file.

ODBC.INI              Initialization file containing information
                      about specific Data Sources. The DSN parameter
                      in the Connect property of the data control or
                      the OpenDatabase statement corresponds to an
                      entry in the ODBC.INI. This file must also be
                      created or modified on the client computer.

ODBCINST.INI          The Initialization file that contains
                      information about installed ODBC drivers. The
                      RegisterDatabase statement and ODBC Administrator
                      use the information contained in this file to
                      set up Data Sources. Entries in ODBCINST.INI
                      are created either by running an ODBC driver
                      setup or through the ODBC API. This file must
                      also be either created or modified on the client
                      computer.

?????? ????? DSN ????? ????????? ??? ODBC.INI ??? ODBCINST.INI

????? ??????? .INI ??????? ??? ?????? (?????) ??????? ODBC "?" ????? ?????? ODBC. ?????? ????? ??? ?????--?????? ?????? ?? ????? ??????? ?? ?????? \WINDOWS. ?? ???? ??? ODBC.INI blindly ODBCINST.INI ??? ???? ????????? ????? ????????? ?? ???????? ??? ????? ????? "????? ??????" ??????.

???? ??? ????? ???????? ???? ????? ????????? ?????? ??? ??????? DSN ???????? ODBC.INI ? ODBCINST.INI ???????.

????? ODBC

????? ?????? ????? ODBC ?????? ??? ???? ???????? ODBC ???? ????? ??????? ??? ???????? ?? Visual Basic ??? ??????? ?????? \VB\ODBC ??? ??? ????? ??????.

??? ???? ? ????? ????? ????? ????? ?? ?? ?????? SETUP.EXE ?? ????? ?????. ???????? ??? ???? ????? ?????? ???????? ?????? ??? ??? ODBC, ?????????? ?? ????? Shell Visual Basic ??? shell ??? SETUP.EXE.

????? ??????? ??? ?????? SETUP1.MAK ??? SETUP1A.MAK ????? ????? ????? ????? ???????. ???? ???? SETUP1A.MAK ??? SETUP1.EXE ???? ???? ? ??? ??? ????? ???????. ??? ????? SETUP.EXE ??? ????? ??????? ??? ??? ??????? ?? SETUP.LST ??? ????????? ??????. ?? ??? ????? ????? SETUP1.EX_ ???? ??????? ???? ??? ??????? ?? ??????? ?????? ??? ????????? ??????.

?? ?????? ?? ????? SETUP1A.MAK ????? ????? SETUP1.EXE ? ??? ???? ?? ????? ??? ????? ???????. ?????? ?? ?? ??? ????? ??????? ?????? ??? ??? ??? ????? ??? ?? ??? ??????? ?? ????????? ???????? ??? ????? "????? ???????". ?? ????? ????? ????????? ???????? ??? ????????? ?? ????? ?????? ?????? ????? ???????? ????? ????? ODBC. ??? EXE ?????? ?????? ?? ??????? ??? ??? ??? ??? ???????.

????? SETUP1.FRM ?? ?????? \VB\SETUPKIT\SETUP1 ?????? ?????? ?????? ???????? ??? ????? ?????? ???????. ??? ??? ??? ????? ??? SETUP1A.MAK ????? ????? "????? ???????".

??????: ?? ????? ????? ?????? ?? Microsoft ??????? ?? ????? "???????" ?? ?? ?? ????? ???????. ??? ????? ??? ????? ??????? ???????? ???? ??? "??? ??" ???? ???.

???? ??? ???? ???????:

  1. ?? ?????? Visual Basic ?? ?? ??????? "???" ? ???? "??? ???????". ??? SETUP1.MAK ?? ?????? \VB\SETUPKIT\SETUP.
  2. ??? SETUP1.FRM ?? ???? ???????. ???? ??????? F7 ???? ????????? ????????.
  3. ?? ????? Form_Load ??????? ?????? ???????? ???????? ??????? ?? ExitSub: ????? ??? ??? RestoreProgMan ???? ????? ?????:
          Dim tmpK As String
          Dim tmpS As String
          Dim I As Long
          tmpK = "dummy"
          For I = 1 To 1000
             tmpS = Mid$(tmpK, 1, 2)
             tmpS = Mid$(tmpK, 1, 2)
             tmpS = Mid$(tmpK, 1, 2)
             tmpS = Mid$(tmpK, 1, 2)
             tmpS = Mid$(tmpK, 1, 2)
             tmpS = Mid$(tmpK, 1, 2)
             tmpS = Mid$(tmpK, 1, 2)
             tmpS = Mid$(tmpK, 1, 2)
             tmpS = Mid$(tmpK, 1, 2)
             tmpS = Mid$(tmpK, 1, 2)
             tmpS = Mid$(tmpK, 1, 2)
             tmpS = Mid$(tmpK, 1, 2)
             tmpS = Mid$(tmpK, 1, 2)
             tmpS = Mid$(tmpK, 1, 2)
             tmpS = Mid$(tmpK, 1, 2)
             tmpS = Mid$(tmpK, 1, 2)
             tmpS = Mid$(tmpK, 1, 2)
             tmpS = Mid$(tmpK, 1, 2)
             tmpS = Mid$(tmpK, 1, 2)
             tmpS = Mid$(tmpK, 1, 2)
          Next I
  4. ??? ??????? (ALT F? ???????).
  5. ????? "????? ?????" ?????? ????? ???????.
????? ????? ??????? ????? ??? ???????? ??? Visual Basic? ?? ?????? SETUP1A.MAK ?????? ?????? ??????? ???????? ODBC ????? And ??? ???????. ???? ??????? ???????:

  1. ??? ????? Visual Basic.
  2. ??? ??????? SETUP1A.MAK ?? \VB\SETUPKIT\SETUP1 (ALT ? F ? O).
  3. ???? SETUP1A.FRM ?? ???? ??????? F7 ???? ????????? ????????.
  4. ?? ??????? Form_Load ??? ?????? ?????? ?????? ???? ?? ??? ?? ????????? ???????? ????? ?? ?????? ????? ???? ????:
          'Dim tmpK As String
          'Dim tmpS As String
          'Dim I As Long
          'tmpK = "dummy"
          'For I = 1 To 1000
          '   tmpS = Mid$(tmpK, 1, 2)
          '   tmpS = Mid$(tmpK, 1, 2)
          '   tmpS = Mid$(tmpK, 1, 2)
          '   tmpS = Mid$(tmpK, 1, 2)
          '   tmpS = Mid$(tmpK, 1, 2)
          '   tmpS = Mid$(tmpK, 1, 2)
          '   tmpS = Mid$(tmpK, 1, 2)
          '   tmpS = Mid$(tmpK, 1, 2)
          '   tmpS = Mid$(tmpK, 1, 2)
          '   tmpS = Mid$(tmpK, 1, 2)
          '   tmpS = Mid$(tmpK, 1, 2)
          '   tmpS = Mid$(tmpK, 1, 2)
          '   tmpS = Mid$(tmpK, 1, 2)
          '   tmpS = Mid$(tmpK, 1, 2)
          '   tmpS = Mid$(tmpK, 1, 2)
          '   tmpS = Mid$(tmpK, 1, 2)
          '   tmpS = Mid$(tmpK, 1, 2)
          '   tmpS = Mid$(tmpK, 1, 2)
          '   tmpS = Mid$(tmpK, 1, 2)
          '   tmpS = Mid$(tmpK, 1, 2)
          'Next I
  5. ?? ?????? ????????? ???????? ??????? ??? ??????? Form_Load ??????? ????????? ???????? ????????? ??????:
          x% = MsgBox("Do you want to install the ODBC Drivers?", 36,
             App.title)
          If x% = 6 Then
             If Not PromptForNextDisk(2, SourcePath$ + "ODBCADM.EX_") Then
                GoTo ErrorSetup
             End If
             x% = Shell(SourcePath$ &amp; "setup.exe")
          End If
  6. ????? ????? 1 ???? ?? ????? ???????? ?? ????? ??????? ????????. ?? ??? ????? ??????? ?????? ??? ??????? PromptForNextDisk. ?? ??? ?????? ?? ????? ?????? ???????? 2.
  7. ??? ??????? SETUP1A.MAK ??? ?????? ????? ???????? ?? SETUP1.EXE ?? ?????? \VB\SETUPKIT\SETUP1 (ALT F ? K).
  8. shell ??? ???? ????? MS-DOS ?????? ?????? ??? \VB\SETUPKIT\SETUP1. ????? ?? ??? ?? ???? ???????:
    r \VB\SETUPKIT\KITFILES\COMPRESS SETUP1.EXE
  9. ?? ????? ????? ??????? ????? ?? ???? ??????? ??????? ?? ??? SETUP1.EX_ ??? ????? ?????:
    ??? A:\SETUP1.EX_ SETUP1.EX_
????? ????? ??? ????? ????? ??????? ?????? ??????? ???? ???????? ????? ????? ODBC ??????. ????? SETUP.EXE ?? ??? ????? ??? ?? ???? ????? ?????? ????? ODBC ???????? ???????? ??? ?????? "???? ????????" ????????. ??? ???? ????? ??????? ???? ???????.

?????? ??? ???? ?? ????????? ??? ????? SETUP1.EXE ?????? ?????? ??? 25 ????? "????? ??????? ????? ??" ?? ???? ????????? Microsoft Visual Basic.

RegisterDatabase

???? Visual Basic ????? RegisterDatabase ???????? ?? ????? ????? ?????? ODBC ?? ????? ???????. ???? RegisterDatabase ????? ?? ODBCINST.INI ? ODBCINST.DLL ?????? ?????? ??? ?????????. ??? ??? ?? ??? ????? ????? ??????? ??? ????? RegisterDatabase. ??? ??? ????? ????? ???? ??? ?????? ??????? RegisterDatabase ????? ?? ????? ????? ?? ODBC.INI.

??????? ?? ??? ??????? ??? ??? ?? ??? ???? ????????? ?????? ODBC ????? ??? ???? ????????? ODBCINST.INI ? DLL ??? ??? ?????. ?????? ??? ??? ?????? ????? ODBC ??????? ??? ????????? ??? ?? ???? ???? ????? ??? ?? ODBCINST.INI ? ???? RegisterDatabase ????? ?? ?????.

??????? ??? ???? ??????, ??????? ? ?????? ??? ???? ???????? RegisterDatabase ???? ?? ????????? ??????? Visual Basic:

?????:
??????? ???? ????????? ?????? ??? ???? ?????? ODBC ?????? ????????? ?????? ?????? OpenDatabase.
???? ??????:
dsn RegisterDatabase ???? ?????? ? ?????? ?????
???????: ????? RegisterDatabase ????? ??? ??????? ???????:

  • DSN: ????? ????? ???? ???? ??? ???????? ?? OpenDatabase ???? ? ???? ???? ??????? ????? ??? ???? ????????. ??? ???? ??????? ??? ??? ???? ???????? ????? ?????? ODBC ???? ? ????? ??? ??????.
  • ?????? ???????: ????? ????? ???? ???? ??? ?????? ????? ODBC. ??? ??? ??? ??? DLL ?????? ????? ODBC. ??? ???? ??????? "SQL Server" ?? "Oracle" ??? ?????? ??????? ???? "SQLSRVR.DLL" ?? ??? ??? DLL. ??? ?? ???? ???? ODBC ??????? ???????? ????? ??????.
  • ??????: ????? ???? ??? True ??? ?? ??? ???? ??? ?????? ????? ODBC dialogs ???????? ??? ????????? ?????? ??????? ?? False ??? ???? ??? ?????? ???? ?????? ????? ODBC. ?? ???? ?????? ????? ????, ??? ?? ????? ??? ???? ???? ????????? ?????? ??????? ??????? ???????? ?? ???? ???? ?????? ??? ??? ????.
  • ????: ????? ??????? ????? ?? ????? ?? ??????? ???????? ???? ???? ??????? ??? ??? ODBC.INI. ???? ??????? ???????? ?? ????? ???? ??? ?????.
????:
      Sub Command1_Click ()
         Dim att As String
         Dim mydb As Database

         att = "Description = SQL Server on server Texas" & Chr$(13)
         att = att & "OemToAnsi=No" & Chr$(13)   ' Build keywords string.
         att = att & "Server=TEXAS" & Chr$(13)
         att = att & "Network=DBNMP3" & Chr$(13)
         att = att & "Address=\\TEXAS\PIPE\SQL\QUERY" & Chr$(13)
         att = att & "Database=Pubs" & Chr$(13)
         att = att & "LastUser=Stimpy"

         ' Update ODBC.INI.
         RegisterDatabase "Texas", "SQL Server", True, att

         Set mydb = OpenDatabase("Texas", False, False, "ODBC;")
         mydb.Close

      End Sub
??? ?? ?????? ????? ????? ???????? ?? ????? ODBC.INI ? ??? ????? ???????. ?? ???? ??? RegisterDatabase ??? ??? ??? ????? ?? ??????? ??? ????? ODBC.INI ?? ???? ???.

ODBC api

??? ?? ??????? ?????? ????? ?????? ?????? ?? ??????? ?? ???? ???? ??? ?????? ??? ???????? ???? ??? ??? ???? SDK ODBC API ??? ?????????. ???????? ??? ?????? ??? ????? ????? ??????? (SDK) ?? Microsoft ??????? ??? "ODBC Microsoft 2.0 ????????? ???? ? ???? SDK" ?? Microsoft Press.

??? INI

?? ???? ?????? ????? ODBC.INI ????? ODBCINST.INI ??? ?????? ??? ????????? ???????, ???? ?????? ??? ???????. ??? ???? ??? ??? ?????? ???? ?? ??? ???????? ??? ????? ???????; ?????? ???? ?????? ??? ??????? .INI. ??? ???? ??????? ??? ODBC.INI ????? ?????? C:\WINDOWS\SYSTEM\SQLSRVR.DLL ??? ?????? ??????? ?? SQL Server ??? ?? ???? ?? \WIN31 ????? Windows ???????? ?????? ?? ?? ????.

???????

???? ???????: 123008 - ????? ??? ??????: 25/????? ??????/1425 - ??????: 1.2
????? ???
  • Microsoft Visual Basic 4.0 Professional Edition
  • Microsoft Visual Basic 4.0 Professional Edition
  • Microsoft Visual Basic 4.0 16-bit Enterprise Edition
  • Microsoft Visual Basic 4.0 32-Bit Enterprise Edition
  • Microsoft Visual Basic 3.0 Professional Edition
????? ??????: 
kbmt kbdatabase kbhowto KB123008 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????123008
????? ??????? ?? ????? ???? ?? ????? ???????
?? ????? ????? ?????? ???? ???? ???? ??? ??????? ??? ?? ? ?? ??? ??????? Microsoft ??? ????? ??? ??????? ????? ?????? ?????

????? ???????

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com