View Full Version : VB Database
hangglide
01-05-2002, 05:48 PM
I am making a database for my photos (1000,s of them). I want to make a VB program that will help me automatically enter the photos into the Access database. So far I can get it to add the file name automatically (With name.Text = filList.FileName) but I dont know how to access the date, time, file size, and type to enter that into the database. Any suggestions. I am new to VB but it looks like fun.
Leo Rose
darkness
01-07-2002, 03:36 PM
In an Earlier Post MNINSHDW wrote:
You just need to grab the file with
Set fso = CreateObject("Scripting.FileSystemObject")
Set f2 = fso.GetFile("c:\testfile.txt")
generatefileinformation(f2)
Function GenerateFileInformation(File)
Dim S
S = NewLine & "Path:" & TabStop & File.Path
S = S & NewLine & "Name:" & TabStop & File.Name
S = S & NewLine & "Type:" & TabStop & File.Type
S = S & NewLine & "Attribs:" & TabStop & ShowFileAttr(File)
S = S & NewLine & "Created:" & TabStop & File.DateCreated
S = S & NewLine & "Accessed:" & TabStop & File.DateLastAccessed
S = S & NewLine & "Modified:" & TabStop & File.DateLastModified
S = S & NewLine & "Size" & TabStop & File.Size & NewLine
GenerateFileInformation = S
End Function
for file attribute use the following function
Function ShowFileAttr(File)
Dim S
Dim Attr
Attr = File.Attributes
If Attr = 0 Then
ShowFileAttr = "Normal"
Exit Function
End If
Michael McLaughlin/images/forums/icons/smile.gif
Systems Manager
Minnesota State University Mankato
Powered by vBulletin™ Version 4.1.0 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.