????????? ????? 2000 ??? ?? Schema.ini ????? ????? ?? ??? ???? ????

???? ?????? ???? ??????
???? ID: 210001 - ?? ???????? ?? ?????? ??? ?? ?? ???? ???? ???? ??.
???? Microsoft Access 97 ?? ??????? ?? ??? ?? ????, ?????155512.
Moderate: ??? ??????, ??????, ?? ?????????????? ??????? ?????? ???

?? ???? Microsoft Access ??????? (.mdb) ?? ??? ???? ???? ???? ???

??? ?? ??????? ???? | ??? ?? ??????? ????

??????

?? ???? ???? ?? ????????? ???? ??????? ??? ??? ?????? ???? ?? ?????? Schema.ini ????? ????? ?? ?? ????? ?? ??? ???? ?????? ???

???? ???????

Microsoft ???????????? ?????? ???? ???????? ?? ??? ??? ???? ??, ???? ??? ??? ?? ?????? ?? ?????????? ??? ??? ?????? ???? ?? ????.. ?????? ???????? ?????? ?? ???? ????? ???????? ?? ??? ???????? ????? ??? ?? ???? ?? ????? ???? ???.. ?? ??? ????? ?? ?? ?? ????? ?? ?? ??? ???????????? ???? ?? ?? ??????? ?? ?????? ??? ????? ????? ???????????? ?? ????? ?? ???? ???? ?? ??? ???? ?? ??? ??.. Microsoft ?????? ???????? ?? ????? ????????? ?? ???????????? ?? ?????? ??? ?????? ?? ???? ???, ??, ?? ?? ???????? ?? ???? ??????? ?????????? ?? ?????? ???? ?? ??? ???????? ??????????????? ?? ?????? ?? ???????????? ????? ?? ??? ??????? ???? ??????..
???:: ????? ??? ??? ?? ???? ????? Microsoft ???? ?????? ????????? ??? ?? ????? ?? ??? ?? ??? ?? ??? ?? Microsoft DAO ?????? ?????? 3.6 ???????? ?????????? ??? ???? ?? ???, ????? ??????????????? ????????????? Visual Basic ?????? ???, ?? ????????? ???? ?? ??Microsoft DAO 3.6 ???????? ???????????? ????? ????? ???

Microsoft Access 2000 ??? ?? ???? ?? ?? ?? ???? ???? ?? ???????? ?? ???????-?????? ??? ??????? ?????? ????? ?? ???? ?? ??? ????? ????, ?? ??? ????, ???? ?? ????? ???, ????? ????? ?? ???? ?????? ?? ????????? ?? ???????? ???? ?? ??? ?? Schema.ini ??? ?? ??????? ????? ?? ????? ?? ???? ???? Schema.ini ????? ???? ?????? ?? ?? ?? ???? ?? ???????-?????? ??? ??????? ?????, ???????? ??? ??????? ?? ??? ???????? ??? Schema.ini ????? ?? ??? ??????? ??? ??? ????? (?? ???????) ?? ??? ??? ?? ?? ????? ?? ?? ???? ??????

????? ?????? ??? ????????? ??? ???????? ?? ??????? ???? ??:
   Parameter        Value
   ------------------------------------------------------------------------
   bIncFldNames     True/False, stating if the first row of the text file
                    has column names

   sPath            Full path to the folder where Schema.ini resides

   sSectionName     Schema.ini section name; must be the same as the name
                    of the text file it describes

   sTblQryName      Name of the table or query for which you want to
                    create a Schema.ini file
				
???????: ??? ?? ?? ?????? ??? ??? ????? ?? ???? ????, ?? ????? ??????? Northwind.mdb ??????? ????? ?? ????? Northwind.mdb ???? ?? ??????? ?? ?? ????????? ?? ????? ????? ?? ???? ???? ?? ??? ?? ?????

  1. Microsoft Access ?? ??????? ???? ?? ????? ????? ??????? Northwind.mdb.
  2. ?? ??????? ?????, ?? ???? ??? ????? ?????? ???? Declarations ??? ??? ??? ??? ???? ???? ?? ?? ???? ??:
    Option Explicit
  3. ???? ????, ?? ????? ????????? ?? ???????:
    Public Function CreateSchemaFile(bIncFldNames As Boolean, _
                                     sPath As String, _
                                     sSectionName As String, _
                                     sTblQryName As String) As Boolean
       Dim Msg As String ' For error handling.
       On Local Error GoTo CreateSchemaFile_Err
       Dim ws As Workspace, db As DAO.DATABASE
       Dim tblDef As DAO.TableDef, fldDef As DAO.Field
       Dim i As Integer, Handle As Integer
       Dim fldName As String, fldDataInfo As String
       ' -----------------------------------------------
       ' Set DAO objects.
       ' -----------------------------------------------
       Set db = CurrentDB()
       ' -----------------------------------------------
       ' Open schema file for append.
       ' -----------------------------------------------
       Handle = FreeFile
       Open sPath & "schema.ini" For Output Access Write As #Handle
       ' -----------------------------------------------
       ' Write schema header.
       ' -----------------------------------------------
       Print #Handle, "[" & sSectionName & "]"
       Print #Handle, "ColNameHeader = " & _
                       IIf(bIncFldNames, "True", "False")
       Print #Handle, "CharacterSet = ANSI"
       Print #Handle, "Format = TabDelimited"
       ' -----------------------------------------------
       ' Get data concerning schema file.
       ' -----------------------------------------------
       Set tblDef = db.TableDefs(sTblQryName)
       With tblDef
          For i = 0 To .Fields.Count - 1
             Set fldDef = .Fields(i)
             With fldDef
                fldName = .Name
                Select Case .Type
                   Case dbBoolean
                      fldDataInfo = "Bit"
                   Case dbByte
                      fldDataInfo = "Byte"
                   Case dbInteger
                      fldDataInfo = "Short"
                   Case dbLong
                      fldDataInfo = "Integer"
                   Case dbCurrency
                      fldDataInfo = "Currency"
                   Case dbSingle
                      fldDataInfo = "Single"
                   Case dbDouble
                      fldDataInfo = "Double"
                   Case dbDate
                      fldDataInfo = "Date"
                   Case dbText
                      fldDataInfo = "Char Width " & Format$(.Size)
                   Case dbLongBinary
                      fldDataInfo = "OLE"
                   Case dbMemo
                      fldDataInfo = "LongChar"
                   Case dbGUID
                      fldDataInfo = "Char Width 16"
                End Select
                Print #Handle, "Col" & Format$(i + 1) _
                                & "=" & fldName & Space$(1) _
                                & fldDataInfo
             End With
          Next i
       End With
       MsgBox sPath & "SCHEMA.INI has been created."
       CreateSchemaFile = True
    CreateSchemaFile_End:
       Close Handle
       Exit Function
    CreateSchemaFile_Err:
       Msg = "Error #: " & Format$(Err.Number) & vbCrLf
       Msg = Msg & Err.Description
       MsgBox Msg
       Resume CreateSchemaFile_End
    End Function
    					
  4. ?? ?????? ?? ??????? ?? ??? ????? ?????? ???? ?? ??????? ????? ??? Northwind.mdb ?? ??? ??? ?????? ?? ?? ?? ????? ?? ???????, ?? ???? ??? ENTER ?????:
    ? CreateSchemaFile(True,"C:\Program Files\Microsoft Office\Office\Samples\","EMP.TXT","Employees")
  5. ???? ??? ??????, ???? ?????? ?? ???????, ?? ??? ?????? ???? ?? Schema.ini ????? ??????

    ??? ???? ?? ????? ??? ????? ???????:
    [EMP.TXT]
    ColNameHeader ??? =
    CharacterSet = ANSI
    ?????? = TabDelimited
    Col1 EmployeeID ???????? =
    Col2 LastName ???? ?????? 20 =
    Col3 FirstName ???? ?????? 10 =
    Col4 ?????? ???? ?????? 30 =
    Col5 TitleOfCourtesy ???? ?????? 25 =
    Col6 BirthDate ?????? =
    Col7 = ?????? HireDate
    Col8 ??? ???? ?????? 60 =
    Col9 ??? ???? ?????? 15 =
    Col10 ??????? ???? ?????? 15 =
    Col11 PostalCode ???? ?????? 10 =
    Col12 ??? ???? ?????? 15 =
    Col13 HomePhone ???? ?????? 24 =
    Col14 ????????? ???? 4 ????? =
    Col15 ????? OLE =
    Col16 ??? LongChar =
    Col17 ReportsTo ???????? =

??????

Schema.ini ????? ?? ??????? itcontains ?? ???? ??? ???? ??????? ?? ??? ????? ????Microsoft Access ???????? ???????????, ????????? ?? html ???? ??????? ?? ??????? ?? ??? ??Office ????? ?? ????? ????????, ?? ???? ?????????? ?? ??????

???

???? ID: 210001 - ????? ???????: 17 ??????? 2011 - ??????: 4.0
???? ???? ???? ??:
  • Microsoft Access 2000 Standard Edition
??????: 
kbcode kbhowto kbprogramming kbmt KB210001 KbMthi
???? ?????? ????????
??????????: ?? ???? ?? ???? ??????? ?? ????? ?? Microsoft ????-?????? ?????????? ?????? ?????? ???? ??? ??. Microsoft ???? ??? ????-???????? ?? ????-???????? ????? ?????? ?? ???? ???????? ???? ?? ???? ????? ????? ??? ?? ??? ?????? ?? ???? ???? ???? ??? ????? ??. ???????, ????-???????? ???? ????? ???? ???? ???? ???. ?????, ????????, ?????-???? ?? ??????? ?? ???????? ?? ???? ???, ???? ?? ??? ?????? ???? ???? ??? ????? ??? ?? ???? ??. Microsoft ??????? ??? ???? ?? ?????? ?? ??????????, ????????? ?? ??? ?????? ?? ???? ????? ?? ???? ???????? ?? ??? ???? ????? ?? ??? ????????? ???? ??. Microsoft ????-?????? ?????????? ?? ????? ?????? ?? ?? ??? ??.
?????????? ?? ??????? ????????? ??????? ??:210001

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

 

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