Microsoft Access Developer Level 33 is 2 hours, 21 minutes long, and is available on my web site at [ Ссылка ]
TOPICS COVERED
Relinking Back-End Files
Auto Send and Relink Access, SQL Server
File System Object, Part 1
Early v. Late Binding
Create a Folder, Subfolders
Determine Size of Folder
File / Folder Properties & Attributes
Today's class begins with automatically relinking back-end files (with VBA, of course). We'll start out reviewing the Linked Table Manager, and then we'll learn how to determine whether or not our back-end file needs to be relinked. If so, we will relink a single back-end file using VBA. Then we'll learn how to relink multiple back-end files. I'll also cover how to relink to ODBC sources including SQL Server (even online databases).
Then, we'll learn about the File System Object to work with files and folders. We started learning about File I/O in Developer 30. Today we'll continue with a more powerful method. We'll learn about Early v. Late Binding of objects, how to create a folder, loop to create multiple folders, determine the size of a folder (and subfolders/files) and how to read and change the properties and attributes of folders and files.
Find out more at [ Ссылка ]
KEYWORDS
microsoft access, ms access, #msaccess, #microsoftaccess, #help, #howto, #tutorial, #instruction, #learn, #lesson, #training, #database, access developer 33, relinking back end files, file system object, fso, early late binding, createfolder, size of folder, properties, attributes
OUTLINE
01. Linked Table Manager (9:10)
How to Use Linked Table Manager
Relink Files
Relink Using Same Names
Runtime Error 3024
Runtime Error 3044
02. Relink Single Backend File (18:52)
Check if Tables Linked
Prompt User for Location, One Backend File
TableDef, TableDefs, PickFile
03. Relink Multiple Backend Files (17:54)
Loop Thru TableDefs
Check Each Linked Table
Determine if Table is Linked
Prompt For Specific Backend File
TableDef Attributes
04. Relink ODBC Backend Files (26:37)
Relink SQL Server Tables
Setup LinkedTableT
Function to Link to SQL Server Tables
ODBC Connection String
LinkODBCTable
Modify Function to Test Link
Use dbOpenSnapshot
Load in Timer Event not OnOpen
05. File System Object, Part 1 (32:03)
Early v. Late Binding
FileSystemObject
Windows Script Host
Only in Access 2000 and up
Drive, Folder, File, TextStream
Set MyFolder Location
CurrentProject.Path
Copy Database for Late Binding
Early Binding
Reference to FSO
Microsoft Scripting Runtime
Dim FSO As New FileSystemObject
CreateObject("Scripting.FileSystemObject")
Pros and Cons of Early v Late Binding
CreateFolder
Notice the IntelliSense
Run Create Folder a 2nd Time
File Already Exists Error
Error Handling OR Check if Folder Exists
FolderExists
Create 5 Subfolders with For Loop
06. File System Object, Part 2 (30:42)
GetFolder
SubFolders Collection
Folder Properties: Name, DateCreated
Notice With Late Binding no .DateCreated
Size of Folders (Very Handy!)
Includes Size of All Subfolders and Files
Format for Thousands Separator
Format(SubFL.Size, "#,0")
File and Folder Properties
File and Folder Attributes
Apply to both Files and Folders
Some are read only, others read/write
Normal (0), ReadOnly (1), Hidden (2), System (4)
Volume (8) RO, Directory (16) RO, Archive (32),
Alias / Shortcut / Link (1024) RO, Compressed (2048) RO
DateCreated, DateLastAccessed, DateLastModified
Drive, IsRootFolder, ParentFolder, Path
ShortName, ShortPath, Type
Old 8.3 File and Folder Names
Changing File / Folder Attributes
Ещё видео!