R
rebelscum0000
Dear All,
Windows XP W/SP2, Access 2002 W/SP3
I cannot find this answer:
I have a .CRC File that I can read with the notepad
If I use FSO to read the file and update into a tbl there is not
problem with the special characters (i.e. Chr(32) to Chr(126) [~]) in
this case TM
Example: In my text file, I have this string (FSO):
DIR DVD APPZ X\Appz Pocket\mdm\ZINCâ„¢ V2 Pocket PC Edition\
In my tbl when I search for this record, is identical
But If I use FreeFile to read the file
When I search the same record of the tbl return the following:
DIR DVD APPZ X\Appz Pocket\mdm\ZINC"! V2 Pocket PC Edition\
Why do this?
What I am doing wrong?
Or how do have to code to use FreeFile in order to respect the special
characters, I can not REPLACE, my code does not work, If I use
FreeFile in my code, I will avoid a lot of problems using FSO.
The file is very big and contains data like:
DIR DVD APPZ X\Appz Internet\Windows & Internet Cleaner Pro\Soft\
dcd3a98daf508d5737acd371a1a75380 Desktop.ini
DIR DVD APPZ X\Appz Internet\Windows & Internet Cleaner Pro\Soft\Core
\
dd87eda605f6d222c7498f371f9b3158 License.exe
796afdf9c8f453a9b6e29ed097cb2223 Serial.txt
DIR DVD APPZ X\Appz Internet\Windows & Internet Cleaner Pro\Soft\FFF\
d847bec7efb0ccf5f62fe399a543edfa fff-wi36.exe
DIR DVD APPZ X\Appz Internet\Windows & Internet Cleaner Pro\Soft\
f000aa48ab95e348d50cb4ef7823a10a Downloads.txt
fdc5e503ea5e85b06e871e271d89a0c9 Windows-Internet-Cleaner-
Installer.exe
c544b8293fe86f3b212b341f573a140c Windows-Internet-Cleaner-
Installer.exe.log
->>DIR DVD APPZ X\Appz Pocket\mdm\ZINCâ„¢ V2 Pocket PC Edition\
a3f0e26f6756d1061bdfaf3d1873ad09 Downloads.txt
b9b85ce999d91d09ad8c83689ae86c4b Zinc_v2_PPC_trial_setup.exe
8ae75671f5e9d29ab87bbfcfd96240e7 Zinc_v2_PPC_trial_setup.exe.log
Any help, ideas or suggestions are more than welcome
Regards,
Antonio Macias
This is my code:
'Initialize New Event
intFF = FreeFile()
'Initialize Variables
SearchDate = "Date="
SearchChar = "DIR"
MyCounterDir = 0
'Read CRC and Insert tbl TempData_Tbl
'<Drive>:\<Drive>.CRC OR
'<Drive>\Folder\FirstFolder.CRC OR
'<Drive>:\Folder\Folder...\<Drive> FirstFolder TO LastFolder.CRC
Open strDir For Input As #intFF
'Discard the first seven lines of the file
For i = 1 To 7
Line Input #intFF, ReadText
Next i
Do While Not EOF(intFF)
Line Input #intFF, ReadText
MyDirSelection = InStr(1, ReadText, SearchChar, 1)
If MyDirSelection = 1 Then
LenDir = Len(ReadText)
Debug.Print "LenDir= " & LenDir
'DIR Folder\Folder\...
MySearchDirMid = Mid(ReadText, 1, LenDir)
Debug.Print "MySearchDirMid= " & MySearchDirMid
MyDirResult1 = Trim(MySearchDirMid)
'MyDirResult1 = Trim('" & MySearchDirMid, "'", "''") &
"'" )
'""" & MyReplaceDirFolder & """"
Debug.Print "MyDirResult1= " & MyDirResult1
'Folder\
MyDir = Mid(ReadText, 4, LenDir)
MyDirResult2 = Trim(MyDir)
MyDirRev = InStrRev(MyDirResult2, "\", -1, vbTextCompare)
'Folder\Folder\...
MyDirLeft = Left(MyDir, MyDirRev)
MyDirTrim = Trim(MyDirLeft)
MyDirResult3 = GetFolder & "\" & MyDirTrim
MyCounterDir = MyCounterDir + 1
'Initialize Variables
Set db = CurrentDb
Set rs = CurrentDb.OpenRecordset("TempData_Tbl", dbOpenDynaset)
With rs
.AddNew 'Add a new record
!ID = MyCounterDir
!DirHashFiles = MyDirResult1
'!MyDirectories = MyDirResult2
'!MyDirectoryPath = MyDirResult3
.Update 'Write the new record to the table
.Bookmark = .LastModified
End With
End If
Loop
Close #intFF
rs.Close
db.Close
Set db = Nothing
Windows XP W/SP2, Access 2002 W/SP3
I cannot find this answer:
I have a .CRC File that I can read with the notepad
If I use FSO to read the file and update into a tbl there is not
problem with the special characters (i.e. Chr(32) to Chr(126) [~]) in
this case TM
Example: In my text file, I have this string (FSO):
DIR DVD APPZ X\Appz Pocket\mdm\ZINCâ„¢ V2 Pocket PC Edition\
In my tbl when I search for this record, is identical
But If I use FreeFile to read the file
When I search the same record of the tbl return the following:
DIR DVD APPZ X\Appz Pocket\mdm\ZINC"! V2 Pocket PC Edition\
Why do this?
What I am doing wrong?
Or how do have to code to use FreeFile in order to respect the special
characters, I can not REPLACE, my code does not work, If I use
FreeFile in my code, I will avoid a lot of problems using FSO.
The file is very big and contains data like:
DIR DVD APPZ X\Appz Internet\Windows & Internet Cleaner Pro\Soft\
dcd3a98daf508d5737acd371a1a75380 Desktop.ini
DIR DVD APPZ X\Appz Internet\Windows & Internet Cleaner Pro\Soft\Core
\
dd87eda605f6d222c7498f371f9b3158 License.exe
796afdf9c8f453a9b6e29ed097cb2223 Serial.txt
DIR DVD APPZ X\Appz Internet\Windows & Internet Cleaner Pro\Soft\FFF\
d847bec7efb0ccf5f62fe399a543edfa fff-wi36.exe
DIR DVD APPZ X\Appz Internet\Windows & Internet Cleaner Pro\Soft\
f000aa48ab95e348d50cb4ef7823a10a Downloads.txt
fdc5e503ea5e85b06e871e271d89a0c9 Windows-Internet-Cleaner-
Installer.exe
c544b8293fe86f3b212b341f573a140c Windows-Internet-Cleaner-
Installer.exe.log
->>DIR DVD APPZ X\Appz Pocket\mdm\ZINCâ„¢ V2 Pocket PC Edition\
a3f0e26f6756d1061bdfaf3d1873ad09 Downloads.txt
b9b85ce999d91d09ad8c83689ae86c4b Zinc_v2_PPC_trial_setup.exe
8ae75671f5e9d29ab87bbfcfd96240e7 Zinc_v2_PPC_trial_setup.exe.log
Any help, ideas or suggestions are more than welcome
Regards,
Antonio Macias
This is my code:
'Initialize New Event
intFF = FreeFile()
'Initialize Variables
SearchDate = "Date="
SearchChar = "DIR"
MyCounterDir = 0
'Read CRC and Insert tbl TempData_Tbl
'<Drive>:\<Drive>.CRC OR
'<Drive>\Folder\FirstFolder.CRC OR
'<Drive>:\Folder\Folder...\<Drive> FirstFolder TO LastFolder.CRC
Open strDir For Input As #intFF
'Discard the first seven lines of the file
For i = 1 To 7
Line Input #intFF, ReadText
Next i
Do While Not EOF(intFF)
Line Input #intFF, ReadText
MyDirSelection = InStr(1, ReadText, SearchChar, 1)
If MyDirSelection = 1 Then
LenDir = Len(ReadText)
Debug.Print "LenDir= " & LenDir
'DIR Folder\Folder\...
MySearchDirMid = Mid(ReadText, 1, LenDir)
Debug.Print "MySearchDirMid= " & MySearchDirMid
MyDirResult1 = Trim(MySearchDirMid)
'MyDirResult1 = Trim('" & MySearchDirMid, "'", "''") &
"'" )
'""" & MyReplaceDirFolder & """"
Debug.Print "MyDirResult1= " & MyDirResult1
'Folder\
MyDir = Mid(ReadText, 4, LenDir)
MyDirResult2 = Trim(MyDir)
MyDirRev = InStrRev(MyDirResult2, "\", -1, vbTextCompare)
'Folder\Folder\...
MyDirLeft = Left(MyDir, MyDirRev)
MyDirTrim = Trim(MyDirLeft)
MyDirResult3 = GetFolder & "\" & MyDirTrim
MyCounterDir = MyCounterDir + 1
'Initialize Variables
Set db = CurrentDb
Set rs = CurrentDb.OpenRecordset("TempData_Tbl", dbOpenDynaset)
With rs
.AddNew 'Add a new record
!ID = MyCounterDir
!DirHashFiles = MyDirResult1
'!MyDirectories = MyDirResult2
'!MyDirectoryPath = MyDirResult3
.Update 'Write the new record to the table
.Bookmark = .LastModified
End With
End If
Loop
Close #intFF
rs.Close
db.Close
Set db = Nothing