1

Topic: Mass check DBF

All greetings!
The problem was drew ((
There are 4 folders D:\input, D:\fail_name, D:\fail_structure and D:\ouptut
In a folder input a certain amount of files of the different extension lies.
1) It is necessary in the given folder to find files *.dbf and if their name does not correspond to a certain mask (it I think dares) to transfer the regular expression that them to folder D:\fail_name
2) Files *.dbf c the appropriate name are necessary for checking up on a structure correctness (at least presence of certain columns with a certain title) - if all a buzzing to throw in D:\output differently in D:\fail_structure
Suggest an idea. With Access did not work. I can and not there I write (((
We can with the help vba something make.
Indirect software - not a variant. On a computer to install anything it is impossible ((
There is Packet Office and DbfNavigator.
Check on the name and a transfer of files - on  I can write bat-nik.
All thanks for any info.

2

Re: Mass check DBF

Moss;
Here the most difficult that DBF can be at least 5 versions
As them to open without  - here in what a question

3

Re: Mass check DBF

1. Search of files - a cycle with application of function Dir:

strFileName = Dir (*.dbf)
Do While Len (strFileName)> 0
If UCase (strFileName) Like "[A-Z] ##*.dbf" Then ' In the beginning a Latin letter and a minimum of 2 digits.
...
Else
... ' we Move a file, as shown more low.
End If
strFileName = Dir
Loop

2. Structure check (if type of files not VFP 3.0 and above, and Aks not 2013 and above):

strSQL = "SELECT * FROM [" AND strFileName AND "] IN ' D:\input ' [XBASE;] WHERE False"
Set RS = CurrentDB.OpenRecordset (strSQL)
For Each fld In RS.Fields
strNames = strNames AND ";" AND fld. Name
Next
RS.Close
strNames = strNames AND ";"
strFolderTo = "D:\fail_structure \"
If InStr (1, "; 1;", strNames) = 0 Then
ElseIf InStr (1, "; 2;", strNames) = 0 Then
Else
strFolderTo = "D:\ouptut \"
End If
' In VBA there is no method of relocation of a file, but it is possible to copy, and then to delete.
FileCopy "D:\input \" AND strFileName, strFolderTo AND strFileName
Kill "D:\input \" AND strFileName

Also search and relocation of files it is possible by means of library FSO (there is a heap of examples).