???????? ?? Access 2002 ??? ???? ????? ????? ?? ????? ???? ????

???? ?????? ???? ??????
???? ID: 279508 - ?? ???????? ?? ?????? ??? ?? ?? ???? ???? ???? ??.
???? Microsoft Office Access 2003 ?? ??????? ?? ??? ?? ????, ?????824272.
?????: ?????? ???????? ??????, ?????????????? ?? multiuser ???? ???

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

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

??????

?? ???? ???? ????? ?? ?? ????? ???? ????FileDialog?????????? ???? ????? ????? ????????? ???? ?? ??? ?? ???? ????? ?????????? ?????? ?? ????????? ???? ?? ??? Microsoft Access ??? ?????? ???

???::FileDialog???? ???? Microsoft Access ?? ?? ????? ????? ??????? ??? ??? ???? ??? This method does not work in a Microsoft Access run-time application.

???? ???????

In earlier versions of Microsoft Access, you could not display the file dialog box without using either the Microsoft Common Dialog ActiveX Control or by making calls to the Windows API.

In Microsoft Access 2002, theFileDialogmethod allows you to display the file dialog box used by Microsoft Access and to determine what files were selected by the user. TheSelectedItemscollection of theFileDialogobject contains the paths to the files selected by the user. By using aFor...Eachloop, you can enumerate this collection and display each file. The following example loops through theItemsSelected?????? ?? ??????? ?? ???? ???? ????? ??? ????????? ???? ???

Microsoft ???????????? ?????? ???? ???????? ?? ??? ??? ???? ??, ???? ??? ??? ?? ?????? ?? ?????????? ??? ??? ?????? ???? ?? ????.. ?????? ???????? ?????? ?? ???? ????? ???????? ?? ??? ???????? ????? ??? ?? ???? ?? ????? ???? ???.. ?? ??? ????? ?? ?? ?? ????? ?? ?? ??? ???????????? ???? ?? ?? ??????? ?? ?????? ??? ????? ????? ???????????? ?? ????? ?? ???? ???? ?? ??? ???? ?? ??? ??.. Microsoft ?????? ???????? ?? ????? ????????? ?? ???????????? ?? ?????? ??? ?????? ?? ???? ???, ??, ?? ?? ???????? ?? ???? ??????? ?????????? ?? ?????? ???? ?? ??? ???????? ??????????????? ?? ?????? ?? ???????????? ????? ?? ??? ??????? ???? ??????..
  1. ????? ??????? Northwind.mdb ??????
  2. ?????? ????? ??? ?? ??? ????? ??????? ??? ???
  3. ??????? ?? ??? ????? ???????? ?????:
    
       Command button
       --------------------------
       Name: cmdFileDialog
       Caption: Add Files
       OnClick: [Event Procedure]
    
       List box
       -------------------------
       Name: FileList
       RowSourceType: Value List
    					
  4. ????? ????????????? ??,???:????? ?? ??? ??????? ??????? Visual Basic Editor ????
  5. ????? ????????????? ??,??????.
  6. ?? ??? ???? ?? ??? ????? ????Microsoft Office 10.0 ???????? ???????????? ?????.
  7. ????? ????,OK??? ???? ?? ?????????????? ????? ?? ??????? ?? ??? ?? ..
  8. ??????? ??????? ??? ????? ??? ??????:
    Option Compare Database
    Option Explicit
          
    Private Sub cmdFileDialog_Click()
    
    'Requires reference to Microsoft Office 10.0 Object Library.
    
       Dim fDialog As Office.FileDialog
       Dim varFile As Variant
    
       'Clear listbox contents.
       Me.FileList.RowSource = ""
    
       'Set up the File Dialog.
       Set fDialog = Application.FileDialog(msoFileDialogFilePicker)
       With fDialog
          'Allow user to make multiple selections in dialog box
          .AllowMultiSelect = True
                
          'Set the title of the dialog box.
          .Title = "Please select one or more files"
    
          'Clear out the current filters, and add our own.
          .Filters.Clear
          .Filters.Add "Access Databases", "*.MDB"
          .Filters.Add "Access Projects", "*.ADP"
          .Filters.Add "All Files", "*.*"
    
          'Show the dialog box. If the .Show method returns True, the
          'user picked at least one file. If the .Show method returns
          'False, the user clicked Cancel.
          If .Show = True Then
             'Loop through each file selected and add it to our list box.
             For Each varFile In .SelectedItems
                Me.FileList.AddItem varFile
             Next
          Else
             MsgBox "You clicked Cancel in the file dialog box."
          End If
       End With
    End Sub
    					
  9. ?????? ?? Form1 ?? ??? ??? ??????, ?? ???? ??? ??? ?????
  10. ??????? ????? ??? Form1 ??????? ?? ??????
  11. ????? ????,??????? ??????. ?? ???????? ?? ?? ???? ?????? ?? ??? ????????? ?????,.
  12. ?? ?? ???? ?????? ?? ??? ????, ?? ???? ??? ????? ????OK, ?? ????? ???????? ????.
??? ???? ?????? ????? ?? ?? ???? ??????? ???, ????? ??? ?? ?? ????? ????? ??? ???? ????? ?????? ??? ???????? ????, ????? ??? ?? ???? ?? ????? ?? ????? ???? ?? ???????? ????.

??????

?? ???? ?? ???? ???? ????? ????? ???, Visual Basic ?????? ???, ?? ???? ??? ???? ??????? ?? ??? ????? ????Microsoft Visual Basic ??????????? ???????????, ??????filedialog ????????Office ????? ?? ????? ????????, ?? ???? ?????????? ?? ??????

???

???? ID: 279508 - ????? ???????: 17 ??????? 2011 - ??????: 4.0
???? ???? ???? ??:
  • Microsoft Access 2002 Standard Edition
??????: 
kbprogramming kbhowto kbmt KB279508 KbMthi
???? ?????? ????????
??????????: ?? ???? ?? ???? ??????? ?? ????? ?? Microsoft ????-?????? ?????????? ?????? ?????? ???? ??? ??. Microsoft ???? ??? ????-???????? ?? ????-???????? ????? ?????? ?? ???? ???????? ???? ?? ???? ????? ????? ??? ?? ??? ?????? ?? ???? ???? ???? ??? ????? ??. ???????, ????-???????? ???? ????? ???? ???? ???? ???. ?????, ????????, ?????-???? ?? ??????? ?? ???????? ?? ???? ???, ???? ?? ??? ?????? ???? ???? ??? ????? ??? ?? ???? ??. Microsoft ??????? ??? ???? ?? ?????? ?? ??????????, ????????? ?? ??? ?????? ?? ???? ????? ?? ???? ???????? ?? ??? ???? ????? ?? ??? ????????? ???? ??. Microsoft ????-?????? ?????????? ?? ????? ?????? ?? ?? ??? ??.
?????????? ?? ??????? ????????? ??????? ??:279508

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

 

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