R
rebelscum0000
Dear all,
This has to be simple but something I am doing wrong
I have a Tbl called TempData_Tbl with more than 10000 records
I want to separate the string before the space, the File name and the
extension
In order to update them (separately) in the same Tbl in other field
names
The string before the space does not have the same length
(d4bd504fb63bd00454296a65d283a94c), I only can do this using somehow
The Chr Function (32) or " " but my code is not working this is my
first problem
The second is that some files names has 2 extension (.zip.log) I know
how to use InStrRev Function but I do not know how to deal when my
recodset finds a File name with one or two extensions or dots
This is an example of the entire string.
d4bd504fb63bd00454296a65d283a94c Default.doc
f12cd10a64d9c838de3346e7427f6d07811 accwebfaq-10-10-00-A9.zip.log
45e1f4a0bf8859f02536c6 AccWebFaqv9.mdb
Any idea, suggestion or help is more than welcome
Thanks in advance
Regards,
Antonio Macias
This is my code which is not working
'Initialize Variables
MyCount = 0
MyTempDataCount = DCount("*", "TempData_Tbl")
Set ccgdb = CurrentDb
Set ccgrs = ccgdb.OpenRecordset("TempData_Tbl", dbOpenDynaset)
For V = 1 To MyTempDataCount
MyTempDataID = ccgrs.Fields("ID")
MyDirHashFiles = ccgrs.Fields("DirHashFiles")
HasFilesLen = Len(MyDirHashFiles)
'Debug.Print "ID = " & MyTempDataID & " And DirHashFiles = " &
MyDirHashFiles & " Len: " & HasFilesLen
MyPos = 1
'Do
MyStart = MyPos + MyCount
MidWords = Left(MyDirHashFiles, MyStart)
If MidWords = Chr(32) Then '<- Why this line do not detect an space?
Debug.Print "DO SOMETHING"
Else
MyCount = MyCount + 1
'Infinite Loop check
If MyCount > 20 Then
End
End If
ccgrs.MoveNext
End If
Next V
ccgrs.Close
ccgdb.Close
Set ccgdb = Nothing
This has to be simple but something I am doing wrong
I have a Tbl called TempData_Tbl with more than 10000 records
I want to separate the string before the space, the File name and the
extension
In order to update them (separately) in the same Tbl in other field
names
The string before the space does not have the same length
(d4bd504fb63bd00454296a65d283a94c), I only can do this using somehow
The Chr Function (32) or " " but my code is not working this is my
first problem
The second is that some files names has 2 extension (.zip.log) I know
how to use InStrRev Function but I do not know how to deal when my
recodset finds a File name with one or two extensions or dots
This is an example of the entire string.
d4bd504fb63bd00454296a65d283a94c Default.doc
f12cd10a64d9c838de3346e7427f6d07811 accwebfaq-10-10-00-A9.zip.log
45e1f4a0bf8859f02536c6 AccWebFaqv9.mdb
Any idea, suggestion or help is more than welcome
Thanks in advance
Regards,
Antonio Macias
This is my code which is not working
'Initialize Variables
MyCount = 0
MyTempDataCount = DCount("*", "TempData_Tbl")
Set ccgdb = CurrentDb
Set ccgrs = ccgdb.OpenRecordset("TempData_Tbl", dbOpenDynaset)
For V = 1 To MyTempDataCount
MyTempDataID = ccgrs.Fields("ID")
MyDirHashFiles = ccgrs.Fields("DirHashFiles")
HasFilesLen = Len(MyDirHashFiles)
'Debug.Print "ID = " & MyTempDataID & " And DirHashFiles = " &
MyDirHashFiles & " Len: " & HasFilesLen
MyPos = 1
'Do
MyStart = MyPos + MyCount
MidWords = Left(MyDirHashFiles, MyStart)
If MidWords = Chr(32) Then '<- Why this line do not detect an space?
Debug.Print "DO SOMETHING"
Else
MyCount = MyCount + 1
'Infinite Loop check
If MyCount > 20 Then
End
End If
ccgrs.MoveNext
End If
Next V
ccgrs.Close
ccgdb.Close
Set ccgdb = Nothing