function CheckOpen(Status: DBIResult): Boolean; begin
case Status of DBIERR_NONE: Result := True; DBIERR_NOTSUFFTABLERIGHTS: begin if not Session.GetPassword then DbiError(Status); Result := False; end; else DbiError(Status); end;end;
function TAsciiDelimTable.CreateHandle: HDBICur; const
OpenModes: array[Boolean] of DbiOpenMode = (dbiReadWrite, dbiReadOnly); ShareModes: array[Boolean] of DbiShareMode = (dbiOpenShared, dbiOpenExcl);var
STableName: array[0..SizeOf(TFileName) - 1] of Char; SDriverType: array[0..12] of Char;begin
if TableName = '' then DBError(SNoTableName); AnsiToNative(DBLocale, TableName, STableName, SizeOf(STableName) - 1); StrPCopy(SDriverType, 'ASCIIDRV-'+Quote+'-'+Delim); Result := nil; while not CheckOpen(DbiOpenTable(DBHandle, STableName, SDriverType, nil, nil, 0, OpenModes[ReadOnly], ShareModes[Exclusive], xltField, False, nil, Result)) do {Повтор};end;
Procedure TAsciiDelimTable.SetQuote(newValue :Char); Begin
If Active Then { DBError(SInvalidBatchMove); }; fQuote := newValue;End; Procedure TAsciiDelimTable.SetDelim(newValue :Char); Begin
If Active Then { DBError(SInvalidBatchMove); }; fDelim := newValue;End;