Ich habe ein Re-Cord wie folgt aus:Was ist der Unterschied zwischen "Null" und "Nichts" in VB6?
Dim rs as Recordset
Set rs as New Recordset
'... a lot of coding ...
if Err.Number <> 0 Then ' oops, something gone wrong!
If rs.State <> adStateClosed Then rs.Close
Set rs = Nothing
end if
' I want to evaluate if rs is Nothing, or Null
if rs is Nothing then
' this doesn't throw errors, and works well :D
end if
if rs is Null then
' this throws an error of "types not compatible"
end if
if rs = Null then
' this throws an error of "types not compatible"
end if
if isNull(rs) then
' never enters here, isNull(rs) evaluates to False
end if
ich, dass selten in VB6 heraus, dass ich „Null“ verwenden (Ich benutzte es für leeres Re-Cord-Schema Namen Auswertung), aber ich benutze „Nichts“ für Sachen wie Bilder , adodb.connections oder recordsets. Für Strings habe ich vbNullString. Ich lese es ist ein Zeiger auf eine Null-Zeichenfolge.
Ist "Null" wie ein "unbekannter Variablenwert" und "Nothing" ein echter Nullwert?
Dort ist 'Empty', ein anderer Variant-Wert. – Bob77
... was im Wesentlichen "nicht initialisiert" bedeutet. –