by Tom Brennfleck (3 Submissions)
Category: Databases/Data Access/DAO/ADO
Compatability: Visual Basic 3.0
Difficulty: Intermediate
Date Added: Wed 3rd February 2021
Rating:
(11 Votes)
Save binary objects to a DAO database, eg: pictures, exe files, dll's etz. Its a generic class module that allows saving/extracting from any access database. Also gets additional fileds if required for example a persons name if it was stored in the same table
Inputs
KillFile- Kill the file if its present
ObjectKeyFieldName- key field name to the database
ObjectTableName- table name holding the bin object
ObjectKey - binary object key to extract
SubFieldData - other field data to extract/save
SubFieldNames- other field names to extract/save
ObjectFieldName- field holding the binary object
DB- database holding the binary object table
BlockSize- block size to use
FileName- filename to extract to or import from
Code Returns
FileName - returns file name if it was changed
eg: temp file was used
ReturnData - returns a variant array of the aditional database fields that were requested
Side Effects
none known
API DeclarationsPrivate Declare Function GetTempPath Lib "kernel32" Alias "GetTempPathA" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long
Private Declare Function GetTempFileName Lib "kernel32" Alias "GetTempFileNameA" (ByVal lpszPath As String, ByVal lpPrefixString As String, ByVal wUnique As Long, ByVal lpTempFileName As String) As Long