Probleme avec ALLOW ZERO LENGTH STRING et NULL:
Bonjour a tous,
Je me sers du code ci-dessous fourni par ce site pour me debarrasser des ZLS(zero length string c-a-d “”) mais cela ne marche pas.
http://allenbrowne.com/bug-09.html
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| Function FixZLS()
Dim db As DAO.Database
Dim tdf As DAO.TableDef
Dim fld As DAO.Field
Dim prp As DAO.Property
Const conPropName = "AllowZeroLength"
Const conPropValue = False
Set db = CurrentDb()
For Each tdf In db.TableDefs
If (tdf.Attributes And dbSystemObject) = 0 Then
If tdf.Name <> "Switchboard Items" Then
For Each fld In tdf.Fields
If fld.Properties(conPropName) Then
Debug.Print tdf.Name & "." & fld.Name
fld.Properties(conPropName) = conPropValue
End If
Next
End If
End If
Next
Set prp = Nothing
Set fld = Nothing
Set tdf = Nothing
Set db = Nothing
End Function |
Après execution du code, la propriete de ALLOW ZERO LENGTH de la table (en mode design)se positionne effectivement sur NO mais cela n’a aucun effet sur mes requetes.
Le code suivant continue par me retourner des resultats alors que je ne devais rien obtenir:
Code:
1 2 3
| Select *
From T1
Where T1.strPrenom = |
Merci de me donner un coup de pouce.