anchor.diff:    ErrorPtr: TErrorPtr;
   
     RetCode: SQLRETURN;
  -  State: NullString;
  +  State: PChar;
     Native: SQLINTEGER;
  -  Message: NullString;
  +  Message: PChar;
     StringLength: SQLSMALLINT;
   Begin
  -  Result:= TList.Create;
  -  Result.Clear;
  -
  -  Case ARetCode Of
  -    SQL_ERROR,
  -    SQL_SUCCESS_WITH_INFO:
  -    Begin
  -      ErrorNum:= 0;
  -      Repeat
  -        Inc(ErrorNum);
  -
  -        //depreciated RetCode:= _SQLError(FErrHenv, FErrHdbc, FErrHstmt, SqlState, NativeError, ErrorMsg);
  -        RetCode:= SQLGetDiagRec(aHandleType, aHandle, ErrorNum, @State, Native, @Message, SizeOf(Message), StringLength);
  -
  -        If Success(RetCode) Then
  +  State := odbcPChar(DefaultStringCount);
  +  Message := odbcPChar(DefaultStringCount);
  +  try
  +    Result:= TList.Create;
  +    Result.Clear;
  +
  +    Case ARetCode Of
  +      SQL_ERROR,
  +      SQL_SUCCESS_WITH_INFO:
  +      Begin
  +        ErrorNum:= 0;
  +        Repeat
  +          Inc(ErrorNum);
  +
  +          //depreciated RetCode:= _SQLError(FErrHenv, FErrHdbc, FErrHstmt, SqlState, NativeError, ErrorMsg);
  +          RetCode:= SQLGetDiagRec(aHandleType, aHandle, ErrorNum, State, Native, Message, DefaultStringSize, StringLength);
  +
  +          If Success(RetCode) Then
  +          Begin
  +            New(ErrorPtr);
  +            ErrorPtr.FState:= fromOdbcPChar(State);
  +            ErrorPtr.FNative:= Native;
  +            ErrorPtr.FMessage:= fromOdbcPChar(Message);
  +            Result.Add(ErrorPtr);
  +          End;
  +        Until Not Success(RetCode);
  +        If (Result.Count = 0) Or (RetCode <> SQL_NO_DATA) Then
           Begin
             New(ErrorPtr);
  -          ErrorPtr.FState:= State;
  -          ErrorPtr.FNative:= Native;
  -          ErrorPtr.FMessage:= Message;
  +          ErrorPtr.FState:= '';
  +          ErrorPtr.FNative:= 0;
  +          ErrorPtr.FMessage:= 'Unable to Retrieve ODBC Error';
             Result.Add(ErrorPtr);
           End;
  -      Until Not Success(RetCode);
  -      If (Result.Count = 0) Or (RetCode <> SQL_NO_DATA) Then
  +      End;
  +      Else
         Begin
           New(ErrorPtr);
           ErrorPtr.FState:= '';
           ErrorPtr.FNative:= 0;
  -        ErrorPtr.FMessage:= 'Unable to Retrieve ODBC Error';
  +        Case ARetCode Of
  +          SQL_INVALID_HANDLE:
  +            ErrorPtr.FMessage:= 'Invalid ODBC Handle';
  +          SQL_NO_DATA:
  +            ErrorPtr.FMessage:= 'No Data Found';
  +          Else
  +            ErrorPtr.FMessage:= 'ODBC Return Code '+IntToStr(ARetCode);
  +        End;
           Result.Add(ErrorPtr);
         End;
       End;
  -    Else
  -    Begin
  -      New(ErrorPtr);
  -      ErrorPtr.FState:= '';
  -      ErrorPtr.FNative:= 0;
  -      Case ARetCode Of
  -        SQL_INVALID_HANDLE:
  -          ErrorPtr.FMessage:= 'Invalid ODBC Handle';
  -        SQL_NO_DATA:
  -          ErrorPtr.FMessage:= 'No Data Found';
  -        Else
  -          ErrorPtr.FMessage:= 'ODBC Return Code '+IntToStr(ARetCode);
  -      End;
  -      Result.Add(ErrorPtr);
  -    End;
  -  End;
  +  finally
  +    freemem(state);
  +    freemem(message);
  +  end;
   End;
   
   Procedure TODBCErrorHandler.RaiseError(AOwner: TODBCObject; ARetCode: SQLRETURN);
  
positive.code: 
  Begin
    RefreshFields(WhereClause);
  End;
  
  { ActionRows }
  
  Procedure TOdbcStatement.InsertRows;
  Var
    i: Integer;
  Begin
    For i:= 1 To FNumRows Do
      If RowFlag[i] = rfInsert Then
        InsertRow(i);
  End;
  
  Procedure TOdbcStatement.UpdateRows;
  Var
    i: Integer;
  Begin
    For i:= 1 To FNumRows Do
      If RowFlag[i] = rfUpdate Then
        UpdateRow(i);
  End;
  
  Procedure TOdbcStatement.DeleteRows;
  Var
    i: Integer;
  Begin
    For i:= 1 To FNumRows Do
      If RowFlag[i] = rfDelete Then
        DeleteRow(i);
  End;
  
  Procedure TOdbcStatement.RefreshRows;
  Var
    i: Integer;
  Begin
    For i:= 1 To FNumRows Do
      If RowFlag[i] = rfRefresh Then
        RefreshRow(i);
  End;
  
  { DoAction }
  
negative.code: 
  const
    EnterString = #0#0;
  
  Type
    EODBCExpress = Class(Exception);
  
    SQLINTEGERPtr=^SQLINTEGER;
    SQLUSMALLINTPtr=^SQLUSMALLINT;
  