You could use the File System Controls. Put the Directory Tree and File
List Box on a form. This would get you pretty close to Windows Explorer.
Then use the getproperty command inside the custom eep of the File List Box
to get the currently selected file. Then insert the value into your table.
Following is a simple example. The command file gets the location of the
current directory before calling the form because once you select a file the
directory you are running in changes so the cd .vCurrDir at the end of the
command file returns to where you started from.
Damian Voigt
The command file:
set variable vTest text
set variable vCurrDir = (cval('currdir'))
edit using <your formname>
insert into <your table> (<your column>) values .vtest
cd .vCurrDir
return
Create a variable form and paste the following into it. Just highlight
starting with object RBitBtn2: to the end of the email and do a ctrl v on
your form and then size and position the objects to your liking. I have the
variable vTest displayed on the form showing the exact filename that will be
pasted into the table.
object RBitBtn2: TRBitBtn
Tag = 84166940
Left = 535
Top = 385
UseByRForm = False
HideOnStartup = False
ParentFont = False
Caption = 'Done'
Font.Charset = DEFAULT_CHARSET
Font.Color = clBlack
Font.Height = -13
Font.Name = 'Arial'
Font.Style = []
ParentShowHint = False
ShowHint = True
TabOrder = 3
EEPNum = 6
end
object RBEdit1: TRBEdit
Tag = 45880700
Left = 215
Top = 305
Width = 331
Height = 24
UseByRForm = False
HideOnStartup = False
ParentFont = False
HighlightFocus = False
HighlightFocusColor = clBlack
Font.Charset = DEFAULT_CHARSET
Font.Color = clBlack
Font.Height = -13
Font.Name = 'Arial'
Font.Style = []
TabOrder = 2
Text = 'vTest'
SuppressPopUpErrorMessage = False
Formatted = False
UseDynamicWhere = False
CompID = 'vTest'
RecalcVar = False
VarName = 'vTest'
PMType = ptSingle
PMAccess = False
PMAuto = False
PMCust = False
PMSkip = False
PMLines = 5
Distinct = False
TitleBackColor = clBtnFace
ListBackColor = clWindow
TitleFont.Charset = DEFAULT_CHARSET
TitleFont.Color = clWindowText
TitleFont.Height = -11
TitleFont.Name = 'MS Sans Serif'
TitleFont.Style = []
ListFont.Charset = DEFAULT_CHARSET
ListFont.Color = clWindowText
ListFont.Height = -11
ListFont.Name = 'MS Sans Serif'
ListFont.Style = []
end
object FileBox1: TFileBox
Tag = 96126746
Left = 335
Top = 25
Width = 211
Height = 246
UseByRForm = False
HideOnStartup = False
ItemHeight = 18
TabOrder = 1
CompID = 'cFileName'
DefaultDirectory = 'D:\dcs\Invoices'
RestoreDirectory = True
CustomClickEEP.Strings = (
''
''
'getproperty cFileName longfilename '#39'vTest'#39
'property vTest textvalue .vTest'
'return')
end
object DirTree1: TDirTree
Tag = 35931420
Left = 50
Top = 25
Height = 246
UseByRForm = False
HideOnStartup = False
FileList = FileBox1
OpenCurrentDir = True
HideSelection = False
Indent = 19
SelectionPen.Color = clBtnShadow
TabOrder = 0
end