私はこれとまったく同じ問題を抱えています。少し前のことで、正確な詳細を忘れてしまいましたが、問題は、Pervasive.SQLが&H0(つまりゼロ)を使用して欠落している日付を表しているのに、&H0がODBCの日付フィールドに対して無効であるということです。
私の解決策は、フィールドをSQLの文字列にキャストすることだったので、QueryStringでこれを使用します:CONVERT(datefield、SQL_CHAR)
次に、それを日付に戻すために次の関数を作成しました(&H0は新しい日付になります)。
''' <summary>
''' Enables a Btrieve Date column that contains 0x0 values to be accessed. Use 'SELECT CONVERT(datefield, SQL_CHAR)' to access the field, then this function to convert the result back to a date. A New Date is returned if the record has a 0x0 date
''' </summary>
''' <param name="Expression"></param>
''' <returns></returns>
''' <remarks></remarks>
Public Function SQL_CHAR2Date(ByVal Expression As String) As Date
'check Expression is in the correct format
Dim strMap As String = ""
For i As Integer = 0 To Expression.Length - 1
Select Case Expression.Substring(i, 1)
Case "0" To "9" : strMap &= "0"
Case "-" : strMap &= "-"
Case Else : strMap &= Expression.Substring(i, 1)
End Select
Next i
Select Case strMap
Case "0000-00-00"
Case Else
Throw New ApplicationException("SQL_CHAR2Date: invalid input parameter")
End Select
Dim y As Integer = CInt(Expression.Substring(0, 4))
Dim m As Integer = CInt(Expression.Substring(5, 2))
Dim d As Integer = CInt(Expression.Substring(8, 2))
If y = 0 And m = 0 And d = 0 Then
Return New Date
Else
Return DateSerial(y, m, d)
End If
End Function