BENOIT
Offline
Last seen: 5 years 3 weeks ago
Joined: 11/29/2018 - 11:25
it crash again.
I wrote :
newFieldName = checkIfFieldNameExists("ECARTDATES", dbname)
field.Name = newFieldName
the internal error focuses on the instruction "field.Name = newFieldName"
Sometimes you just have to delete a portion of script and just rewriting it, looks like this is what is happening here. Make sure that field has been properly dimensioned and there is no other variables or functions that could be screwing up that section.
After several hours of research, I found my mystake !
I souldn't wrote "exercice = Mid(nomfichier,13,8)" because NomFichier is a function !
Function NomFichier
Dim temp_length As String, a As Integer, i As Integer
sfilename2 = sfilename
temp_length = Len(sFilename2 )
For i = temp_length To 1 Step -1
If Mid(sfilename2,i,1) = "\" Then Exit For
Next
For a = temp_length To 1 Step -1
If Mid(sfilename2,a,1) = "." Then Exit For
Next
NOMFICHIER = Mid(sfilename2,i+1,a-i-1)
exercice = Mid(nomfichier,13,8)
End Function
Pages