unit uDAADOInterfaces; {----------------------------------------------------------------------------} { Data Abstract Library - Core Library } { } { compiler: Delphi 6 and up } { platform: Win32 } { } { (c)opyright RemObjects Software. all rights reserved. } { } { Using this code requires a valid license of the Data Abstract } { which can be obtained at http://www.remobjects.com. } {----------------------------------------------------------------------------} {$I DataAbstract.inc} interface uses uDAInterfaces, uDAEngine, uROClasses; const stdMSSQL_ConnectionString = 'User ID=%s;Password=%s;Initial Catalog=%s;Data Source=%s'; // OLE DB Services = -2 means we don't want ADO Connection pooling done for us! stdADO_ConnectionString = 'Provider=%s;' + stdMSSQL_ConnectionString + ';OLE DB SERVICES=-2'; MSSQL_DriverType = 'MSSQL'; Access_DriverType = 'Access'; FoxPro_DriverType ='FoxPro'; ODBC_DriverType = '';//'ODBC'; ASA_DriverType = 'ASA'; Sybase_DriverType = 'Sybase'; Informix_DriverType = 'Informix'; DB2_DriverType = 'DB2'; Paradox_DriverType = 'Paradox'; const // Standard OLEDB providers identifiers oledb_UnknownId = '???'; oledb_MSSQLId = 'SQLOLEDB.1'; oledb_JetId = 'Microsoft.Jet.OLEDB.4.0'; oledb_OracleId = 'MSDAORA.1'; oledb_ODBCId = 'MSDASQL.1'; oledb_MSSQL2005Id ='SQLNCLI.1'; oledb_PostgresqlId = 'PostgreSQL.1'; oleDb_VisualFoxProId = 'VFPOLEDB.1'; oledb_MSSQL2008Id = 'SQLNCLI10.1'; type // Standard OLEDB providers enumerated TDAOleDBProviderType = (oledb_Unknown, oledb_MSSQL, oledb_Jet, oledb_Oracle, oledb_ODBC, oledb_MSSQL2005, oledb_Postgresql, oleDb_VisualFoxPro, oledb_MSSQL2008 ); const // Standard OLEDB providers identifier array (useful for lookups) OleDBProviders: array[TDAOleDBProviderType] of string = ( oledb_UnknownId, oledb_MSSQLId, oledb_JetId, oledb_OracleId, oledb_ODBCId, oledb_MSSQL2005Id, oledb_PostgresqlId, oleDb_VisualFoxProId, oledb_MSSQL2008Id ); type { IADOConnection For identification purposes. Implemented by all ADO connections and also those that target MSSQL-only such as SDAC } IDAADOConnection = interface(IDAConnection) ['{979D10CF-FD56-4C16-8074-338CADA9F1CD}'] function GetProviderName: string; {$IFNDEF FPC_SAFECALL_BUG}safecall;{$ENDIF} function GetProviderType: TDAOleDBProviderType; {$IFNDEF FPC_SAFECALL_BUG}safecall;{$ENDIF} property ProviderName: string read GetProviderName; property ProviderType: TDAOleDBProviderType read GetProviderType; function GetCommandTimeout: Integer; {$IFNDEF FPC_SAFECALL_BUG}safecall;{$ENDIF} procedure SetCommandTimeout(const Value: Integer); {$IFNDEF FPC_SAFECALL_BUG}safecall;{$ENDIF} property CommandTimeout: Integer read GetCommandTimeout write SetCommandTimeout; end; TDAMSConnection = class(TDAEConnection,IDACanQueryDatabaseNames) protected fMSSQLSchemaEnabled: Boolean; procedure DoGetTableNames(out List: IROStrings); override; procedure DoGetStoredProcedureNames(out List: IROStrings); override; procedure DoGetStoredProcedureParams(const aStoredProcedureName: string; out Params: TDAParamCollection); override; procedure DoGetViewNames(out List: IROStrings); override; function DoGetLastAutoInc(const GeneratorName: string): integer; override; function CreateMacroProcessor: TDASQLMacroProcessor; override; procedure DoGetTableFields(const aTableName: string; out Fields: TDAFieldCollection); override; procedure DoGetForeignKeys(out ForeignKeys: TDADriverForeignKeyCollection); override; function GetSPSelectSyntax(HasArguments: Boolean): String; override; {$IFNDEF FPC_SAFECALL_BUG}safecall;{$ENDIF} function IdentifierNeedsQuoting(const iIdentifier: string): boolean; override; {$IFNDEF FPC_SAFECALL_BUG}safecall;{$ENDIF} // IDACanQueryDatabaseNames function GetDatabaseNames: IROStrings; public property MSSQLSchemaEnabled: Boolean read fMSSQLSchemaEnabled write fMSSQLSchemaEnabled; end; TDAMSSQLDriver = class(TDAEDriver) protected function GetDefaultConnectionType(const AuxDriver: string): string; override; {$IFNDEF FPC_SAFECALL_BUG}safecall;{$ENDIF} end; function OleDBDriverIdToOleDBProviderType(const anID: string): TDAOleDBProviderType; procedure MSSQL_GetAuxParams(const List: IROStrings); procedure MSSQL_DoGetNames(Query: IDADataset; AList: IROStrings; AObjectType: TDAObjecttype; SchemaEnabled: Boolean); function MSSQL_DoGetLastAutoInc(const GeneratorName: string;Query: IDADataset): integer; function MSSQL_CreateMacroProcessor: TDASQLMacroProcessor; procedure MSSQL_DoGetTableFields(const aTableName: string; Query: IDADataset; out Fields: TDAFieldCollection); procedure MSSQL_DoGetForeignKeys(Query: IDADataset; ForeignKeys: TDADriverForeignKeyCollection; SchemaEnabled: Boolean); function MSSQL_GetSPSelectSyntax(HasArguments: Boolean): String; function MSSQL_IdentifierNeedsQuoting(const iIdentifier: string): boolean; function MSSQL_GetQuoteChars: TDAQuoteCharArray; function MSSQL_GetDatabaseNames(aConnection:TDAEConnection): IROStrings; function MSACCESS_GetFileExtensions: IROStrings; procedure MSSQL_DoGetStoredProcedureParams(const aStoredProcedureName: string; Query: IDADataset; out Params: TDAParamCollection); implementation uses SysUtils, {$IFDEF MSWINDOWS} Windows,{$ENDIF} uDAMacroProcessors; const MSSQL_MasterDatabase = 'master'; MSSQL_GetDatabaseNames_SQL = 'select Name from sysdatabases order by Name'; var ado_reservedwords: array of string; function OleDBDriverIdToOleDBProviderType(const anID: string): TDAOleDBProviderType; var x: TDAOleDBProviderType; begin result := oledb_Unknown; for x := Low(TDAOleDBProviderType) to High(TDAOleDBProviderType) do if SameText(OleDBProviders[x], anID) then begin result := x; Exit; end; end; procedure MSSQL_GetAuxParams(const List: IROStrings); begin List.Add('Integrated Security=SSPI'); List.Add('Schemas=0,1'); end; procedure MSSQL_DoGetNames(Query: IDADataset; AList: IROStrings; AObjectType: TDAObjecttype; SchemaEnabled: Boolean); var fWhere: string; begin try case AObjectType of dotTable: begin if not SchemaEnabled then fWhere:='AND (TABLE_SCHEMA = ''dbo'') '; Query.SQL := 'SELECT TABLE_SCHEMA, TABLE_NAME FROM INFORMATION_SCHEMA.TABLES ' + 'WHERE (OBJECTPROPERTY(OBJECT_ID(TABLE_SCHEMA + ''.'' + TABLE_NAME), ''IsMsShipped'') = 0) ' + 'AND (TABLE_TYPE = ''BASE TABLE'') ' +fWhere+ 'ORDER BY 1, 2'; end; dotProcedure: begin if not SchemaEnabled then fWhere:='AND (ROUTINE_SCHEMA = ''dbo'') '; Query.SQL := 'SELECT ROUTINE_SCHEMA, ROUTINE_NAME ' + 'FROM INFORMATION_SCHEMA.ROUTINES ' + 'WHERE (OBJECTPROPERTY(OBJECT_ID(ROUTINE_SCHEMA + ''.'' + ROUTINE_NAME), ''IsMsShipped'') = 0) AND (ROUTINE_TYPE = ''PROCEDURE'') ' +fWhere+ 'ORDER BY 1, 2'; end; dotView: begin if not SchemaEnabled then fWhere:='AND (TABLE_SCHEMA = ''dbo'') '; Query.SQL := 'SELECT TABLE_SCHEMA, TABLE_NAME FROM INFORMATION_SCHEMA.TABLES ' + 'WHERE (OBJECTPROPERTY(OBJECT_ID(TABLE_SCHEMA + ''.'' + TABLE_NAME), ''IsMsShipped'') = 0) ' + 'AND (TABLE_TYPE = ''VIEW'') ' + 'ORDER BY 1, 2'; end; else end; Query.Open; while not Query.EOF do begin if SchemaEnabled then AList.Add(Format('%s.%s', [Trim(Query.Fields[0].AsString), Trim(Query.Fields[1].AsString)])) else AList.Add(Trim(Query.Fields[1].AsString)); Query.Next; end; Query.Close; finally Query := nil; end; end; function MSSQL_DoGetLastAutoInc(const GeneratorName: string;Query: IDADataset): integer; begin try // Using Ident_Current is not fully safe //if Trim(GeneratorName) <> '' then // Query.SQL := 'SELECT IsNull(Ident_Current(' + QuotedStr(GeneratorName) + '), 0) as LastInc' //else Query.SQL := 'SELECT IsNull(@@Identity, 0) as LastInc'; Query.Open; result := Query.Fields[0].Value; finally Query := nil; end; end; function MSSQL_CreateMacroProcessor: TDASQLMacroProcessor; begin Result := TDAMSSQLMacroProcessor.Create; end; procedure MSSQL_DoGetStoredProcedureParams(const aStoredProcedureName: string; Query: IDADataset; out Params: TDAParamCollection); var lProcName, lSchema: string; lparam: TDAParam; begin Params := TDAParamCollection.Create(nil); try lProcName := aStoredProcedureName; if pos('.', lProcName) = 0 then begin lSchema := '' end else begin lSchema := copy(lProcName, 1, pos('.', lProcName) - 1); Delete(lProcName, 1, pos('.', lProcName)); end; Query.SQL := 'exec sp_sproc_columns '+QuotedStr(lProcName); if lSchema <> '' then Query.SQL := Query.SQL+', '+QuotedStr(lSchema); Query.Open; while not Query.EOF do begin lparam := Params.Add; lParam.Name:= Trim(Copy(Query.FieldByName('COLUMN_NAME').AsString,2,MaxInt)); case Query.FieldByName('COLUMN_TYPE').AsSmallInt of 1: lparam.ParamType := daptInput; 2: lparam.ParamType := daptInputOutput; 5: lparam.ParamType := daptResult; else lparam.ParamType := daptUnknown; end; lParam.Size:= Query.FieldByName('Length').AsInteger; case Query.FieldByName('DATA_TYPE').AsInteger of -150 {sql_variant } : lparam.DataType := datUnknown; // unsupported now! -11 {uniqueidentifier}: lparam.DataType := datGuid; -10 {ntext} : lparam.DataType := datWideMemo; -9 {nvarchar} : lparam.DataType := datWideString; -8 {nchar} : lparam.DataType := datWideString; -7 {bit} : lparam.DataType := datBoolean; -6 {tinyint} : lparam.DataType := datByte; -5 {bigint} : lparam.DataType := datLargeInt; -4 {image} : lparam.DataType := datBlob; -3 {varbinary} : lparam.DataType := datBlob; -2 {binary} : lparam.DataType := datBlob; -1 {text} : lparam.DataType := datMemo; 1 {char} : lparam.DataType := datString; 2 {numeric} : begin lparam.DecimalPrecision:= Query.FieldByName('PRECISION').AsInteger; lparam.DecimalScale:= Query.FieldByName('SCALE').AsInteger; if (lparam.DecimalPrecision <= 19) and (lparam.DecimalScale <= 4) then lparam.DataType := datCurrency else lparam.DataType := datDecimal end; 3 {money} : begin lparam.DataType := datCurrency; lparam.DecimalPrecision:= Query.FieldByName('PRECISION').AsInteger; lparam.DecimalScale:= Query.FieldByName('SCALE').AsInteger; end; 4 {int} : lparam.DataType := datInteger; 5 {smallint} : lparam.DataType := datSmallInt; 6 {float} : lparam.DataType := datFloat; 7 {real} : lparam.DataType := datSingleFloat; 11 {datetime} : lparam.DataType := datDateTime; 12 {varchar} : lparam.DataType := datWideString; else lparam.DataType := datUnknown; end; Query.Next; end; finally Query := nil; end; end; procedure MSSQL_DoGetTableFields(const aTableName: string; Query: IDADataset; out Fields: TDAFieldCollection); var dra: TDAField; begin Fields := TDAFieldCollection.Create(nil); try Query.SQL := 'SELECT * FROM ' + aTableName + ' WHERE 1=0'; Query.Open; Fields.Assign(Query.Fields); Query.Close; Query.SQL := 'exec sp_MShelpcolumns '+QuotedStr(aTableName)+', null, ''id'', 1;'; Query.Open; try while not Query.Eof do begin dra := Fields.FindField(Trim(Query.FieldByName('COL_NAME').AsString)); if Assigned(dra) then begin dra.InPrimaryKey := (Query.FieldByName('COL_FLAGS').AsInteger and $04) = $04; dra.Required := not Query.FieldByName('COL_NULL').AsBoolean; if Query.FieldByName('COL_IDENTITY').AsBoolean then begin if (dra.DataType = datLargeInt) or (dra.DataType = datLargeUInt) then dra.DataType := datLargeAutoInc else dra.DataType := datAutoInc; dra.GeneratorName := aTableName; end; if (AnsiCompareText(Query.FieldByName('COL_BASETYPENAME').asString,'decimal') =0) or (AnsiCompareText(Query.FieldByName('COL_BASETYPENAME').asString,'numeric') =0) then begin dra.DataType := datDecimal; Dra.DecimalScale := Query.FieldByName('COL_SCALE').AsInteger; Dra.DecimalPrecision := Query.FieldByName('COL_PREC').AsInteger; end else if (AnsiCompareText(Query.FieldByName('COL_BASETYPENAME').asString,'uniqueidentifier') =0) then dra.DataType := datGuid else if (AnsiCompareText(Query.FieldByName('COL_BASETYPENAME').asString,'money') =0) or (AnsiCompareText(Query.FieldByName('COL_BASETYPENAME').asString,'smallmoney') =0) then dra.DataType := datCurrency else if (AnsiCompareText(Query.FieldByName('COL_BASETYPENAME').asString,'timestamp') =0) then begin dra.DataType := datBlob; dra.BlobType := dabtTimestamp; dra.LogChanges := false; end; end; Query.Next; end; finally Query.Close; end; finally Query:=nil; end; end; procedure MSSQL_DoGetForeignKeys(Query: IDADataset; ForeignKeys: TDADriverForeignKeyCollection; SchemaEnabled: Boolean); const s_fk = 'SELECT ' + 'KCU1.CONSTRAINT_NAME AS CONSTRAINT_NAME, ' + 'KCU1.TABLE_SCHEMA AS FK_TABLE_SCHEMA, ' + 'KCU1.TABLE_NAME AS FK_TABLE_NAME, ' + 'KCU1.COLUMN_NAME AS FK_COLUMN_NAME, ' + 'KCU2.TABLE_SCHEMA AS PK_TABLE_SCHEMA, ' + 'KCU2.TABLE_NAME AS PK_TABLE_NAME, ' + 'KCU2.COLUMN_NAME AS PK_COLUMN_NAME ' + 'FROM ' + 'INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS RC ' + 'JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE KCU1 ON ' + 'KCU1.CONSTRAINT_CATALOG = RC.CONSTRAINT_CATALOG AND KCU1.CONSTRAINT_SCHEMA = RC.CONSTRAINT_SCHEMA AND KCU1.CONSTRAINT_NAME = RC.CONSTRAINT_NAME ' + 'JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE KCU2 ON ' + 'KCU2.CONSTRAINT_CATALOG = RC.UNIQUE_CONSTRAINT_CATALOG AND KCU2.CONSTRAINT_SCHEMA = RC.UNIQUE_CONSTRAINT_SCHEMA AND KCU2.CONSTRAINT_NAME = RC.UNIQUE_CONSTRAINT_NAME AND KCU2.ORDINAL_POSITION = KCU1.ORDINAL_POSITION '; s_fk_where = ' AND (KCU1.TABLE_SCHEMA = ''dbo'') AND (KCU2.TABLE_SCHEMA = ''dbo'') '; s_fk_Order = 'ORDER BY KCU1.TABLE_NAME, KCU1.CONSTRAINT_NAME, KCU2.TABLE_NAME, KCU1.ORDINAL_POSITION'; var fWhere: String; lCurrConstraint: string; lCurrFK: TDADriverForeignKey; l_name: string; begin lCurrConstraint := ''; lCurrFK := nil; try if not SchemaEnabled then fWhere:= s_fk_where; Query.SQL := s_fk + fWhere + s_fk_Order; Query.Open; while not Query.Eof do begin l_Name := Trim(Query.Fields[0].AsString); if lCurrConstraint <> l_name then begin lCurrConstraint := l_name; lCurrFK := ForeignKeys.Add(); with lCurrFK do begin Name := l_name; FKField := Trim(Query.Fields[3].AsString); PKField := Trim(Query.Fields[6].AsString); if SchemaEnabled then begin FKTable := Format('%s.%s', [Trim(Query.Fields[1].AsString), Trim(Query.Fields[2].AsString)]); PKTable := Format('%s.%s', [Trim(Query.Fields[4].AsString), Trim(Query.Fields[5].AsString)]); end else begin FKTable := Trim(Query.Fields[2].AsString); PKTable := Trim(Query.Fields[5].AsString); end; end; end else begin with lCurrFK do begin FKField := FKField + ';' + Trim(Query.Fields[3].AsString); PKField := PKField + ';' + Trim(Query.Fields[6].AsString); end; end; Query.Next; end; Query.Close; finally Query := nil; end; end; function MSSQL_GetSPSelectSyntax(HasArguments: Boolean): String; begin Result := 'EXEC {0} {1}'; end; function MSSQL_IdentifierNeedsQuoting(const iIdentifier: string): boolean; begin result := TestIdentifier(iIdentifier,ado_reservedwords); end; function MSSQL_GetQuoteChars: TDAQuoteCharArray; begin result[0] := '['; result[1] := ']'; end; function MSSQL_GetDatabaseNames(aConnection:TDAEConnection): IROStrings; begin Result := Engine_GetDatabaseNames(aConnection, MSSQL_MasterDatabase, MSSQL_GetDatabaseNames_SQL); end; { TDAMSConnection } function TDAMSConnection.CreateMacroProcessor: TDASQLMacroProcessor; begin Result := MSSQL_CreateMacroProcessor; end; procedure TDAMSConnection.DoGetForeignKeys( out ForeignKeys: TDADriverForeignKeyCollection); begin inherited; MSSQL_DoGetForeignKeys(GetDatasetClass.Create(Self), ForeignKeys, MSSQLSchemaEnabled); end; function TDAMSConnection.DoGetLastAutoInc(const GeneratorName: string): integer; begin Result := MSSQL_DoGetLastAutoInc(GeneratorName,GetDatasetClass.Create(Self)); end; procedure TDAMSConnection.DoGetStoredProcedureNames(out List: IROStrings); begin inherited DoGetStoredProcedureNames(List); MSSQL_DoGetNames(GetDatasetClass.Create(Self),List,dotProcedure,MSSQLSchemaEnabled); end; procedure TDAMSConnection.DoGetTableFields(const aTableName: string; out Fields: TDAFieldCollection); begin MSSQL_DoGetTableFields(QuoteIdentifierIfNeeded(aTableName),GetDatasetClass.Create(Self),Fields); end; procedure TDAMSConnection.DoGetTableNames(out List: IROStrings); begin inherited DoGetTableNames(List); MSSQL_DoGetNames(GetDatasetClass.Create(Self),List,dotTable,MSSQLSchemaEnabled); end; procedure TDAMSConnection.DoGetViewNames(out List: IROStrings); begin inherited DoGetViewNames(List); MSSQL_DoGetNames(GetDatasetClass.Create(Self),List,dotView,MSSQLSchemaEnabled); end; function TDAMSConnection.GetDatabaseNames: IROStrings; begin Result := MSSQL_GetDatabaseNames(Self); end; function TDAMSConnection.GetSPSelectSyntax(HasArguments: Boolean): String; begin Result := MSSQL_GetSPSelectSyntax(HasArguments); end; procedure ADO_InitializeReservedWords; begin // http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.etools.ejbbatchdeploy.doc/topics/rsqlMSSQLSERVER_2005.html SetLength(ado_reservedwords, 747); // sorted with TStringList.Sort (bds2007) ado_reservedwords[0] := 'A'; ado_reservedwords[1] := 'ABORT'; ado_reservedwords[2] := 'ABS'; ado_reservedwords[3] := 'ABSOLUTE'; ado_reservedwords[4] := 'ACCESS'; ado_reservedwords[5] := 'ACOS'; ado_reservedwords[6] := 'ACQUIRE'; ado_reservedwords[7] := 'ACTION'; ado_reservedwords[8] := 'ACTIVATE'; ado_reservedwords[9] := 'ADA'; ado_reservedwords[10] := 'ADD'; ado_reservedwords[11] := 'ADDFORM'; ado_reservedwords[12] := 'ADMIN'; ado_reservedwords[13] := 'AFTER'; ado_reservedwords[14] := 'AGGREGATE'; ado_reservedwords[15] := 'ALIAS'; ado_reservedwords[16] := 'ALL'; ado_reservedwords[17] := 'ALLOCATE'; ado_reservedwords[18] := 'ALTER'; ado_reservedwords[19] := 'AN'; ado_reservedwords[20] := 'ANALYZE'; ado_reservedwords[21] := 'AND'; ado_reservedwords[22] := 'ANY'; ado_reservedwords[23] := 'APPEND'; ado_reservedwords[24] := 'ARCHIVE'; ado_reservedwords[25] := 'ARCHIVELOG'; ado_reservedwords[26] := 'ARE'; ado_reservedwords[27] := 'ARRAY'; ado_reservedwords[28] := 'ARRAYLEN'; ado_reservedwords[29] := 'AS'; ado_reservedwords[30] := 'ASC'; ado_reservedwords[31] := 'ASCII'; ado_reservedwords[32] := 'ASIN'; ado_reservedwords[33] := 'ASSERTION'; ado_reservedwords[34] := 'AT'; ado_reservedwords[35] := 'ATAN'; ado_reservedwords[36] := 'AUDIT'; ado_reservedwords[37] := 'AUTHORIZATION'; ado_reservedwords[38] := 'AVG'; ado_reservedwords[39] := 'AVGU'; ado_reservedwords[40] := 'BACKUP'; ado_reservedwords[41] := 'BECOME'; ado_reservedwords[42] := 'BEFORE'; ado_reservedwords[43] := 'BEGIN'; ado_reservedwords[44] := 'BETWEEN'; ado_reservedwords[45] := 'BIGINT'; ado_reservedwords[46] := 'BINARY'; ado_reservedwords[47] := 'BIND'; ado_reservedwords[48] := 'BINDING'; ado_reservedwords[49] := 'BIT'; ado_reservedwords[50] := 'BLOB'; ado_reservedwords[51] := 'BLOCK'; ado_reservedwords[52] := 'BODY'; ado_reservedwords[53] := 'BOOLEAN'; ado_reservedwords[54] := 'BOTH'; ado_reservedwords[55] := 'BREADTH'; ado_reservedwords[56] := 'BREAK'; ado_reservedwords[57] := 'BREAKDISPLAY'; ado_reservedwords[58] := 'BROWSE'; ado_reservedwords[59] := 'BUFFERPOOL'; ado_reservedwords[60] := 'BULK'; ado_reservedwords[61] := 'BY'; ado_reservedwords[62] := 'BYREF'; ado_reservedwords[63] := 'CACHE'; ado_reservedwords[64] := 'CALL'; ado_reservedwords[65] := 'CALLPROC'; ado_reservedwords[66] := 'CANCEL'; ado_reservedwords[67] := 'CAPTURE'; ado_reservedwords[68] := 'CASCADE'; ado_reservedwords[69] := 'CASCADED'; ado_reservedwords[70] := 'CASE'; ado_reservedwords[71] := 'CAST'; ado_reservedwords[72] := 'CATALOG'; ado_reservedwords[73] := 'CCSID'; ado_reservedwords[74] := 'CEILING'; ado_reservedwords[75] := 'CHANGE'; ado_reservedwords[76] := 'CHAR'; ado_reservedwords[77] := 'CHARACTER'; ado_reservedwords[78] := 'CHARTOROWID'; ado_reservedwords[79] := 'CHECK'; ado_reservedwords[80] := 'CHECKPOINT'; ado_reservedwords[81] := 'CHR'; ado_reservedwords[82] := 'CLASS'; ado_reservedwords[83] := 'CLEANUP'; ado_reservedwords[84] := 'CLEAR'; ado_reservedwords[85] := 'CLEARROW'; ado_reservedwords[86] := 'CLOB'; ado_reservedwords[87] := 'CLOSE'; ado_reservedwords[88] := 'CLUSTER'; ado_reservedwords[89] := 'CLUSTERED'; ado_reservedwords[90] := 'COALESCE'; ado_reservedwords[91] := 'COBOL'; ado_reservedwords[92] := 'COLGROUP'; ado_reservedwords[93] := 'COLLATE'; ado_reservedwords[94] := 'COLLATION'; ado_reservedwords[95] := 'COLLECTION'; ado_reservedwords[96] := 'COLUMN'; ado_reservedwords[97] := 'COMMAND'; ado_reservedwords[98] := 'COMMENT'; ado_reservedwords[99] := 'COMMIT'; ado_reservedwords[100] := 'COMMITTED'; ado_reservedwords[101] := 'COMPILE'; ado_reservedwords[102] := 'COMPLETION'; ado_reservedwords[103] := 'COMPLEX'; ado_reservedwords[104] := 'COMPRESS'; ado_reservedwords[105] := 'COMPUTE'; ado_reservedwords[106] := 'CONCAT'; ado_reservedwords[107] := 'CONFIRM'; ado_reservedwords[108] := 'CONNECT'; ado_reservedwords[109] := 'CONNECTION'; ado_reservedwords[110] := 'CONSTRAINT'; ado_reservedwords[111] := 'CONSTRAINTS'; ado_reservedwords[112] := 'CONSTRUCTOR'; ado_reservedwords[113] := 'CONTAINS'; ado_reservedwords[114] := 'CONTAINSTABLE'; ado_reservedwords[115] := 'CONTENTS'; ado_reservedwords[116] := 'CONTINUE'; ado_reservedwords[117] := 'CONTROLFILE'; ado_reservedwords[118] := 'CONTROLROW'; ado_reservedwords[119] := 'CONVERT'; ado_reservedwords[120] := 'COPY'; ado_reservedwords[121] := 'CORRESPONDING'; ado_reservedwords[122] := 'COS'; ado_reservedwords[123] := 'COUNT'; ado_reservedwords[124] := 'COUNTU'; ado_reservedwords[125] := 'CREATE'; ado_reservedwords[126] := 'CROSS'; ado_reservedwords[127] := 'CUBE'; ado_reservedwords[128] := 'CURRENT'; ado_reservedwords[129] := 'CURRENT_DATE'; ado_reservedwords[130] := 'CURRENT_PATH'; ado_reservedwords[131] := 'CURRENT_ROLE'; ado_reservedwords[132] := 'CURRENT_TIME'; ado_reservedwords[133] := 'CURRENT_TIMESTAMP'; ado_reservedwords[134] := 'CURRENT_USER'; ado_reservedwords[135] := 'CURSOR'; ado_reservedwords[136] := 'CVAR'; ado_reservedwords[137] := 'CYCLE'; ado_reservedwords[138] := 'DATA'; ado_reservedwords[139] := 'DATABASE'; ado_reservedwords[140] := 'DATAFILE'; ado_reservedwords[141] := 'DATAHANDLER'; ado_reservedwords[142] := 'DATAPAGES'; ado_reservedwords[143] := 'DATE'; ado_reservedwords[144] := 'DAY'; ado_reservedwords[145] := 'DAYOFMONTH'; ado_reservedwords[146] := 'DAYOFWEEK'; ado_reservedwords[147] := 'DAYOFYEAR'; ado_reservedwords[148] := 'DAYS'; ado_reservedwords[149] := 'DBA'; ado_reservedwords[150] := 'DBCC'; ado_reservedwords[151] := 'DBSPACE'; ado_reservedwords[152] := 'DEALLOCATE'; ado_reservedwords[153] := 'DEC'; ado_reservedwords[154] := 'DECIMAL'; ado_reservedwords[155] := 'DECLARATION'; ado_reservedwords[156] := 'DECLARE'; ado_reservedwords[157] := 'DECODE'; ado_reservedwords[158] := 'DEFAULT'; ado_reservedwords[159] := 'DEFERRABLE'; ado_reservedwords[160] := 'DEFERRED'; ado_reservedwords[161] := 'DEFINE'; ado_reservedwords[162] := 'DEFINITION'; ado_reservedwords[163] := 'DEGREES'; ado_reservedwords[164] := 'DELETE'; ado_reservedwords[165] := 'DELETEROW'; ado_reservedwords[166] := 'DENY'; ado_reservedwords[167] := 'DEPTH'; ado_reservedwords[168] := 'DEREF'; ado_reservedwords[169] := 'DESC'; ado_reservedwords[170] := 'DESCRIBE'; ado_reservedwords[171] := 'DESCRIPTOR'; ado_reservedwords[172] := 'DESTROY'; ado_reservedwords[173] := 'DESTRUCTOR'; ado_reservedwords[174] := 'DETERMINISTIC'; ado_reservedwords[175] := 'DHTYPE'; ado_reservedwords[176] := 'DIAGNOSTICS'; ado_reservedwords[177] := 'DICTIONARY'; ado_reservedwords[178] := 'DIRECT'; ado_reservedwords[179] := 'DISABLE'; ado_reservedwords[180] := 'DISCONNECT'; ado_reservedwords[181] := 'DISK'; ado_reservedwords[182] := 'DISMOUNT'; ado_reservedwords[183] := 'DISPLAY'; ado_reservedwords[184] := 'DISTINCT'; ado_reservedwords[185] := 'DISTRIBUTE'; ado_reservedwords[186] := 'DISTRIBUTED'; ado_reservedwords[187] := 'DO'; ado_reservedwords[188] := 'DOMAIN'; ado_reservedwords[189] := 'DOUBLE'; ado_reservedwords[190] := 'DOWN'; ado_reservedwords[191] := 'DROP'; ado_reservedwords[192] := 'DUMMY'; ado_reservedwords[193] := 'DUMP'; ado_reservedwords[194] := 'DYNAMIC'; ado_reservedwords[195] := 'EACH'; ado_reservedwords[196] := 'EDITPROC'; ado_reservedwords[197] := 'ELSE'; ado_reservedwords[198] := 'ELSEIF'; ado_reservedwords[199] := 'ENABLE'; ado_reservedwords[200] := 'END'; ado_reservedwords[201] := 'ENDDATA'; ado_reservedwords[202] := 'ENDDISPLAY'; ado_reservedwords[203] := 'ENDEXEC'; ado_reservedwords[204] := 'END-EXEC'; ado_reservedwords[205] := 'ENDFORMS'; ado_reservedwords[206] := 'ENDIF'; ado_reservedwords[207] := 'ENDLOOP'; ado_reservedwords[208] := 'ENDSELECT'; ado_reservedwords[209] := 'ENDWHILE'; ado_reservedwords[210] := 'EQUALS'; ado_reservedwords[211] := 'ERASE'; ado_reservedwords[212] := 'ERRLVL'; ado_reservedwords[213] := 'ERROREXIT'; ado_reservedwords[214] := 'ESCAPE'; ado_reservedwords[215] := 'EVENTS'; ado_reservedwords[216] := 'EVERY'; ado_reservedwords[217] := 'EXCEPT'; ado_reservedwords[218] := 'EXCEPTION'; ado_reservedwords[219] := 'EXCEPTIONS'; ado_reservedwords[220] := 'EXCLUDE'; ado_reservedwords[221] := 'EXCLUDING'; ado_reservedwords[222] := 'EXCLUSIVE'; ado_reservedwords[223] := 'EXEC'; ado_reservedwords[224] := 'EXECUTE'; ado_reservedwords[225] := 'EXISTS'; ado_reservedwords[226] := 'EXIT'; ado_reservedwords[227] := 'EXP'; ado_reservedwords[228] := 'EXPLAIN'; ado_reservedwords[229] := 'EXPLICIT'; ado_reservedwords[230] := 'EXTENT'; ado_reservedwords[231] := 'EXTERNAL'; ado_reservedwords[232] := 'EXTERNALLY'; ado_reservedwords[233] := 'EXTRACT'; ado_reservedwords[234] := 'FALSE'; ado_reservedwords[235] := 'FETCH'; ado_reservedwords[236] := 'FIELD'; ado_reservedwords[237] := 'FIELDPROC'; ado_reservedwords[238] := 'FILE'; ado_reservedwords[239] := 'FILLFACTOR'; ado_reservedwords[240] := 'FINALIZE'; ado_reservedwords[241] := 'FINALIZE'; ado_reservedwords[242] := 'FIRST'; ado_reservedwords[243] := 'FLOAT'; ado_reservedwords[244] := 'FLOOR'; ado_reservedwords[245] := 'FLOPPY'; ado_reservedwords[246] := 'FLUSH'; ado_reservedwords[247] := 'FOR'; ado_reservedwords[248] := 'FORCE'; ado_reservedwords[249] := 'FOREIGN'; ado_reservedwords[250] := 'FORMDATA'; ado_reservedwords[251] := 'FORMINIT'; ado_reservedwords[252] := 'FORMS'; ado_reservedwords[253] := 'FORTRAN'; ado_reservedwords[254] := 'FOUND'; ado_reservedwords[255] := 'FREE'; ado_reservedwords[256] := 'FREELIST'; ado_reservedwords[257] := 'FREELISTS'; ado_reservedwords[258] := 'FREETEXT'; ado_reservedwords[259] := 'FREETEXTTABLE'; ado_reservedwords[260] := 'FROM'; ado_reservedwords[261] := 'FULL'; ado_reservedwords[262] := 'FUNCTION'; ado_reservedwords[263] := 'GENERAL'; ado_reservedwords[264] := 'GET'; ado_reservedwords[265] := 'GETCURRENTCONNECTION'; ado_reservedwords[266] := 'GETFORM'; ado_reservedwords[267] := 'GETOPER'; ado_reservedwords[268] := 'GETROW'; ado_reservedwords[269] := 'GLOBAL'; ado_reservedwords[270] := 'GO'; ado_reservedwords[271] := 'GOTO'; ado_reservedwords[272] := 'GRANT'; ado_reservedwords[273] := 'GRANTED'; ado_reservedwords[274] := 'GRAPHIC'; ado_reservedwords[275] := 'GREATEST'; ado_reservedwords[276] := 'GROUP'; ado_reservedwords[277] := 'GROUPING'; ado_reservedwords[278] := 'GROUPS'; ado_reservedwords[279] := 'HASH'; ado_reservedwords[280] := 'HAVING'; ado_reservedwords[281] := 'HELP'; ado_reservedwords[282] := 'HELPFILE'; ado_reservedwords[283] := 'HOLDLOCK'; ado_reservedwords[284] := 'HOST'; ado_reservedwords[285] := 'HOUR'; ado_reservedwords[286] := 'HOURS'; ado_reservedwords[287] := 'IDENTIFIED'; ado_reservedwords[288] := 'IDENTITY'; ado_reservedwords[289] := 'IDENTITYCOL'; ado_reservedwords[290] := 'IF'; ado_reservedwords[291] := 'IFNULL'; ado_reservedwords[292] := 'IGNORE'; ado_reservedwords[293] := 'IIMESSAGE'; ado_reservedwords[294] := 'IIPRINTF'; ado_reservedwords[295] := 'IMMEDIATE'; ado_reservedwords[296] := 'IMPORT'; ado_reservedwords[297] := 'IN'; ado_reservedwords[298] := 'INCLUDE'; ado_reservedwords[299] := 'INCLUDING'; ado_reservedwords[300] := 'INCREMENT'; ado_reservedwords[301] := 'INDEX'; ado_reservedwords[302] := 'INDEXPAGES'; ado_reservedwords[303] := 'INDICATOR'; ado_reservedwords[304] := 'INITCAP'; ado_reservedwords[305] := 'INITIAL'; ado_reservedwords[306] := 'INITIALIZE'; ado_reservedwords[307] := 'INITIALLY'; ado_reservedwords[308] := 'INITRANS'; ado_reservedwords[309] := 'INITTABLE'; ado_reservedwords[310] := 'INNER'; ado_reservedwords[311] := 'INOUT'; ado_reservedwords[312] := 'INPUT'; ado_reservedwords[313] := 'INSENSITIVE'; ado_reservedwords[314] := 'INSERT'; ado_reservedwords[315] := 'INSERTROW'; ado_reservedwords[316] := 'INSTANCE'; ado_reservedwords[317] := 'INSTR'; ado_reservedwords[318] := 'INT'; ado_reservedwords[319] := 'INTEGER'; ado_reservedwords[320] := 'INTEGRITY'; ado_reservedwords[321] := 'INTERFACE'; ado_reservedwords[322] := 'INTERSECT'; ado_reservedwords[323] := 'INTERVAL'; ado_reservedwords[324] := 'INTO'; ado_reservedwords[325] := 'IS'; ado_reservedwords[326] := 'ISOLATION'; ado_reservedwords[327] := 'ITERATE'; ado_reservedwords[328] := 'JOIN'; ado_reservedwords[329] := 'KEY'; ado_reservedwords[330] := 'KILL'; ado_reservedwords[331] := 'LABEL'; ado_reservedwords[332] := 'LANGUAGE'; ado_reservedwords[333] := 'LARGE'; ado_reservedwords[334] := 'LAST'; ado_reservedwords[335] := 'LATERAL'; ado_reservedwords[336] := 'LAYER'; ado_reservedwords[337] := 'LEADING'; ado_reservedwords[338] := 'LEAST'; ado_reservedwords[339] := 'LEFT'; ado_reservedwords[340] := 'LENGTH'; ado_reservedwords[341] := 'LESS'; ado_reservedwords[342] := 'LEVEL'; ado_reservedwords[343] := 'LIKE'; ado_reservedwords[344] := 'LIMIT'; ado_reservedwords[345] := 'LINENO'; ado_reservedwords[346] := 'LINK'; ado_reservedwords[347] := 'LIST'; ado_reservedwords[348] := 'LISTS'; ado_reservedwords[349] := 'LOAD'; ado_reservedwords[350] := 'LOADTABLE'; ado_reservedwords[351] := 'LOCAL'; ado_reservedwords[352] := 'LOCALTIME'; ado_reservedwords[353] := 'LOCALTIMESTAMP'; ado_reservedwords[354] := 'LOCATE'; ado_reservedwords[355] := 'LOCATOR'; ado_reservedwords[356] := 'LOCK'; ado_reservedwords[357] := 'LOCKSIZE'; ado_reservedwords[358] := 'LOG'; ado_reservedwords[359] := 'LOGFILE'; ado_reservedwords[360] := 'LONG'; ado_reservedwords[361] := 'LONGINT'; ado_reservedwords[362] := 'LOWER'; ado_reservedwords[363] := 'LPAD'; ado_reservedwords[364] := 'LTRIM'; ado_reservedwords[365] := 'LVARBINARY'; ado_reservedwords[366] := 'LVARCHAR'; ado_reservedwords[367] := 'MAIN'; ado_reservedwords[368] := 'MANAGE'; ado_reservedwords[369] := 'MANUAL'; ado_reservedwords[370] := 'MAP'; ado_reservedwords[371] := 'MATCH'; ado_reservedwords[372] := 'MAX'; ado_reservedwords[373] := 'MAXDATAFILES'; ado_reservedwords[374] := 'MAXEXTENTS'; ado_reservedwords[375] := 'MAXINSTANCES'; ado_reservedwords[376] := 'MAXLOGFILES'; ado_reservedwords[377] := 'MAXLOGHISTORY'; ado_reservedwords[378] := 'MAXLOGMEMBERS'; ado_reservedwords[379] := 'MAXTRANS'; ado_reservedwords[380] := 'MAXVALUE'; ado_reservedwords[381] := 'MENUITEM'; ado_reservedwords[382] := 'MESSAGE'; ado_reservedwords[383] := 'MICROSECOND'; ado_reservedwords[384] := 'MICROSECONDS'; ado_reservedwords[385] := 'MIN'; ado_reservedwords[386] := 'MINEXTENTS'; ado_reservedwords[387] := 'MINUS'; ado_reservedwords[388] := 'MINUTE'; ado_reservedwords[389] := 'MINUTES'; ado_reservedwords[390] := 'MINVALUE'; ado_reservedwords[391] := 'MIRROREXIT'; ado_reservedwords[392] := 'MOD'; ado_reservedwords[393] := 'MODE'; ado_reservedwords[394] := 'MODIFIES'; ado_reservedwords[395] := 'MODIFY'; ado_reservedwords[396] := 'MODULE'; ado_reservedwords[397] := 'MONEY'; ado_reservedwords[398] := 'MONTH'; ado_reservedwords[399] := 'MONTHS'; ado_reservedwords[400] := 'MOUNT'; ado_reservedwords[401] := 'MOVE'; ado_reservedwords[402] := 'NAMED'; ado_reservedwords[403] := 'NAMES'; ado_reservedwords[404] := 'NATIONAL'; ado_reservedwords[405] := 'NATURAL'; ado_reservedwords[406] := 'NCHAR'; ado_reservedwords[407] := 'NCLOB'; ado_reservedwords[408] := 'NEW'; ado_reservedwords[409] := 'NEXT'; ado_reservedwords[410] := 'NHEADER'; ado_reservedwords[411] := 'NO'; ado_reservedwords[412] := 'NOARCHIVELOG'; ado_reservedwords[413] := 'NOAUDIT'; ado_reservedwords[414] := 'NOCACHE'; ado_reservedwords[415] := 'NOCHECK'; ado_reservedwords[416] := 'NOCOMPRESS'; ado_reservedwords[417] := 'NOCYCLE'; ado_reservedwords[418] := 'NOECHO'; ado_reservedwords[419] := 'NOMAXVALUE'; ado_reservedwords[420] := 'NOMINVALUE'; ado_reservedwords[421] := 'NONCLUSTERED'; ado_reservedwords[422] := 'NONE'; ado_reservedwords[423] := 'NOORDER'; ado_reservedwords[424] := 'NORESETLOGS'; ado_reservedwords[425] := 'NORMAL'; ado_reservedwords[426] := 'NOSORT'; ado_reservedwords[427] := 'NOT'; ado_reservedwords[428] := 'NOTFOUND'; ado_reservedwords[429] := 'NOTRIM'; ado_reservedwords[430] := 'NOWAIT'; ado_reservedwords[431] := 'NULL'; ado_reservedwords[432] := 'NULLIF'; ado_reservedwords[433] := 'NULLVALUE'; ado_reservedwords[434] := 'NUMBER'; ado_reservedwords[435] := 'NUMERIC'; ado_reservedwords[436] := 'NUMPARTS'; ado_reservedwords[437] := 'NVL'; ado_reservedwords[438] := 'OBID'; ado_reservedwords[439] := 'OBJECT'; ado_reservedwords[440] := 'ODBCINFO'; ado_reservedwords[441] := 'OF'; ado_reservedwords[442] := 'OFF'; ado_reservedwords[443] := 'OFFLINE'; ado_reservedwords[444] := 'OFFSETS'; ado_reservedwords[445] := 'OLD'; ado_reservedwords[446] := 'ON'; ado_reservedwords[447] := 'ONCE'; ado_reservedwords[448] := 'ONLINE'; ado_reservedwords[449] := 'ONLY'; ado_reservedwords[450] := 'OPEN'; ado_reservedwords[451] := 'OPENDATASOURCE'; ado_reservedwords[452] := 'OPENQUERY'; ado_reservedwords[453] := 'OPENROWSET'; ado_reservedwords[454] := 'OPERATION'; ado_reservedwords[455] := 'OPTIMAL'; ado_reservedwords[456] := 'OPTIMIZE'; ado_reservedwords[457] := 'OPTION'; ado_reservedwords[458] := 'OR'; ado_reservedwords[459] := 'ORDER'; ado_reservedwords[460] := 'ORDINALITY'; ado_reservedwords[461] := 'OUT'; ado_reservedwords[462] := 'OUTER'; ado_reservedwords[463] := 'OUTPUT'; ado_reservedwords[464] := 'OVER'; ado_reservedwords[465] := 'OVERLAPS'; ado_reservedwords[466] := 'OWN'; ado_reservedwords[467] := 'PACKAGE'; ado_reservedwords[468] := 'PAD'; ado_reservedwords[469] := 'PAGE'; ado_reservedwords[470] := 'PAGES'; ado_reservedwords[471] := 'PARALLEL'; ado_reservedwords[472] := 'PARAMETER'; ado_reservedwords[473] := 'PARAMETERS'; ado_reservedwords[474] := 'PART'; ado_reservedwords[475] := 'PARTIAL'; ado_reservedwords[476] := 'PASCAL'; ado_reservedwords[477] := 'PATH'; ado_reservedwords[478] := 'PCTFREE'; ado_reservedwords[479] := 'PCTINCREASE'; ado_reservedwords[480] := 'PCTINDEX'; ado_reservedwords[481] := 'PCTUSED'; ado_reservedwords[482] := 'PERCENT'; ado_reservedwords[483] := 'PERM'; ado_reservedwords[484] := 'PERMANENT'; ado_reservedwords[485] := 'PERMIT'; ado_reservedwords[486] := 'PI'; ado_reservedwords[487] := 'PIPE'; ado_reservedwords[488] := 'PLAN'; ado_reservedwords[489] := 'PLI'; ado_reservedwords[490] := 'POSITION'; ado_reservedwords[491] := 'POSTFIX'; ado_reservedwords[492] := 'POWER'; ado_reservedwords[493] := 'PRECISION'; ado_reservedwords[494] := 'PREFIX'; ado_reservedwords[495] := 'PREORDER'; ado_reservedwords[496] := 'PREPARE'; ado_reservedwords[497] := 'PRESERVE'; ado_reservedwords[498] := 'PRIMARY'; ado_reservedwords[499] := 'PRINT'; ado_reservedwords[500] := 'PRINTSCREEN'; ado_reservedwords[501] := 'PRIOR'; ado_reservedwords[502] := 'PRIQTY'; ado_reservedwords[503] := 'PRIVATE'; ado_reservedwords[504] := 'PRIVILEGES'; ado_reservedwords[505] := 'PROC'; ado_reservedwords[506] := 'PROCEDURE'; ado_reservedwords[507] := 'PROCESSEXIT'; ado_reservedwords[508] := 'PROFILE'; ado_reservedwords[509] := 'PROGRAM'; ado_reservedwords[510] := 'PROMPT'; ado_reservedwords[511] := 'PUBLIC'; ado_reservedwords[512] := 'PUTFORM'; ado_reservedwords[513] := 'PUTOPER'; ado_reservedwords[514] := 'PUTROW'; ado_reservedwords[515] := 'QUALIFICATION'; ado_reservedwords[516] := 'QUARTER'; ado_reservedwords[517] := 'QUOTA'; ado_reservedwords[518] := 'RADIANS'; ado_reservedwords[519] := 'RAISE'; ado_reservedwords[520] := 'RAISERROR'; ado_reservedwords[521] := 'RAND'; ado_reservedwords[522] := 'RANGE'; ado_reservedwords[523] := 'RAW'; ado_reservedwords[524] := 'READ'; ado_reservedwords[525] := 'READS'; ado_reservedwords[526] := 'READTEXT'; ado_reservedwords[527] := 'REAL'; ado_reservedwords[528] := 'RECONFIGURE'; ado_reservedwords[529] := 'RECORD'; ado_reservedwords[530] := 'RECOVER'; ado_reservedwords[531] := 'RECURSIVE'; ado_reservedwords[532] := 'REDISPLAY'; ado_reservedwords[533] := 'REF'; ado_reservedwords[534] := 'REFERENCES'; ado_reservedwords[535] := 'REFERENCING'; ado_reservedwords[536] := 'REGISTER'; ado_reservedwords[537] := 'RELATIVE'; ado_reservedwords[538] := 'RELEASE'; ado_reservedwords[539] := 'RELOCATE'; ado_reservedwords[540] := 'REMOVE'; ado_reservedwords[541] := 'RENAME'; ado_reservedwords[542] := 'REPEAT'; ado_reservedwords[543] := 'REPEATABLE'; ado_reservedwords[544] := 'REPEATED'; ado_reservedwords[545] := 'REPLACE'; ado_reservedwords[546] := 'REPLICATE'; ado_reservedwords[547] := 'REPLICATION'; ado_reservedwords[548] := 'RESET'; ado_reservedwords[549] := 'RESETLOGS'; ado_reservedwords[550] := 'RESOURCE'; ado_reservedwords[551] := 'RESTORE'; ado_reservedwords[552] := 'RESTRICT'; ado_reservedwords[553] := 'RESTRICTED'; ado_reservedwords[554] := 'RESULT'; ado_reservedwords[555] := 'RESUME'; ado_reservedwords[556] := 'RETRIEVE'; ado_reservedwords[557] := 'RETURN'; ado_reservedwords[558] := 'RETURNS'; ado_reservedwords[559] := 'REUSE'; ado_reservedwords[560] := 'REVOKE'; ado_reservedwords[561] := 'RIGHT'; ado_reservedwords[562] := 'ROLE'; ado_reservedwords[563] := 'ROLES'; ado_reservedwords[564] := 'ROLLBACK'; ado_reservedwords[565] := 'ROLLUP'; ado_reservedwords[566] := 'ROUTINE'; ado_reservedwords[567] := 'ROW'; ado_reservedwords[568] := 'ROWCOUNT'; ado_reservedwords[569] := 'ROWGUIDCOL'; ado_reservedwords[570] := 'ROWID'; ado_reservedwords[571] := 'ROWIDTOCHAR'; ado_reservedwords[572] := 'ROWLABEL'; ado_reservedwords[573] := 'ROWNUM'; ado_reservedwords[574] := 'ROWS'; ado_reservedwords[575] := 'ROWS'; ado_reservedwords[576] := 'RPAD'; ado_reservedwords[577] := 'RRN'; ado_reservedwords[578] := 'RTRIM'; ado_reservedwords[579] := 'RULE'; ado_reservedwords[580] := 'RUN'; ado_reservedwords[581] := 'RUNTIMESTATISTICS'; ado_reservedwords[582] := 'SAVE'; ado_reservedwords[583] := 'SAVEPOINT'; ado_reservedwords[584] := 'SCHEDULE'; ado_reservedwords[585] := 'SCHEMA'; ado_reservedwords[586] := 'SCN'; ado_reservedwords[587] := 'SCOPE'; ado_reservedwords[588] := 'SCREEN'; ado_reservedwords[589] := 'SCROLL'; ado_reservedwords[590] := 'SCROLLDOWN'; ado_reservedwords[591] := 'SCROLLUP'; ado_reservedwords[592] := 'SEARCH'; ado_reservedwords[593] := 'SECOND'; ado_reservedwords[594] := 'SECONDS'; ado_reservedwords[595] := 'SECQTY'; ado_reservedwords[596] := 'SECTION'; ado_reservedwords[597] := 'SEGMENT'; ado_reservedwords[598] := 'SELECT'; ado_reservedwords[599] := 'SEQUENCE'; ado_reservedwords[600] := 'SERIALIZABLE'; ado_reservedwords[601] := 'SERVICE'; ado_reservedwords[602] := 'SESSION'; ado_reservedwords[603] := 'SESSION_USER'; ado_reservedwords[604] := 'SET'; ado_reservedwords[605] := 'SETS'; ado_reservedwords[606] := 'SETUSER'; ado_reservedwords[607] := 'SETUSER'; ado_reservedwords[608] := 'SHARE'; ado_reservedwords[609] := 'SHARED'; ado_reservedwords[610] := 'SHORT'; ado_reservedwords[611] := 'SHUTDOWN'; ado_reservedwords[612] := 'SIGN'; ado_reservedwords[613] := 'SIMPLE'; ado_reservedwords[614] := 'SIN'; ado_reservedwords[615] := 'SIZE'; ado_reservedwords[616] := 'SLEEP'; ado_reservedwords[617] := 'SMALLINT'; ado_reservedwords[618] := 'SNAPSHOT'; ado_reservedwords[619] := 'SOME'; ado_reservedwords[620] := 'SORT'; ado_reservedwords[621] := 'SOUNDEX'; ado_reservedwords[622] := 'SPACE'; ado_reservedwords[623] := 'SPECIFIC'; ado_reservedwords[624] := 'SPECIFICTYPE'; ado_reservedwords[625] := 'SQL'; ado_reservedwords[626] := 'SQLBUF'; ado_reservedwords[627] := 'SQLCA'; ado_reservedwords[628] := 'SQLCODE'; ado_reservedwords[629] := 'SQLERROR'; ado_reservedwords[630] := 'SQLEXCEPTION'; ado_reservedwords[631] := 'SQLSTATE'; ado_reservedwords[632] := 'SQLWARNING'; ado_reservedwords[633] := 'SQRT'; ado_reservedwords[634] := 'START'; ado_reservedwords[635] := 'STATE'; ado_reservedwords[636] := 'STATEMENT'; ado_reservedwords[637] := 'STATIC'; ado_reservedwords[638] := 'STATISTICS'; ado_reservedwords[639] := 'STOGROUP'; ado_reservedwords[640] := 'STOP'; ado_reservedwords[641] := 'STORAGE'; ado_reservedwords[642] := 'STORPOOL'; ado_reservedwords[643] := 'STRUCTURE'; ado_reservedwords[644] := 'SUBMENU'; ado_reservedwords[645] := 'SUBPAGES'; ado_reservedwords[646] := 'SUBSTR'; ado_reservedwords[647] := 'SUBSTRING'; ado_reservedwords[648] := 'SUCCESSFUL'; ado_reservedwords[649] := 'SUFFIX'; ado_reservedwords[650] := 'SUM'; ado_reservedwords[651] := 'SUMU'; ado_reservedwords[652] := 'SWITCH'; ado_reservedwords[653] := 'SYNONYM'; ado_reservedwords[654] := 'SYSCAT'; ado_reservedwords[655] := 'SYSDATE'; ado_reservedwords[656] := 'SYSFUN'; ado_reservedwords[657] := 'SYSIBM'; ado_reservedwords[658] := 'SYSSTAT'; ado_reservedwords[659] := 'SYSTEM'; ado_reservedwords[660] := 'SYSTEM_USER'; ado_reservedwords[661] := 'SYSTIME'; ado_reservedwords[662] := 'SYSTIMESTAMP'; ado_reservedwords[663] := 'TABLE'; ado_reservedwords[664] := 'TABLEDATA'; ado_reservedwords[665] := 'TABLES'; ado_reservedwords[666] := 'TABLESPACE'; ado_reservedwords[667] := 'TAN'; ado_reservedwords[668] := 'TAPE'; ado_reservedwords[669] := 'TEMP'; ado_reservedwords[670] := 'TEMPORARY'; ado_reservedwords[671] := 'TERMINATE'; ado_reservedwords[672] := 'TEXTSIZE'; ado_reservedwords[673] := 'THAN'; ado_reservedwords[674] := 'THEN'; ado_reservedwords[675] := 'THREAD'; ado_reservedwords[676] := 'TIME'; ado_reservedwords[677] := 'TIMEOUT'; ado_reservedwords[678] := 'TIMESTAMP'; ado_reservedwords[679] := 'TIMEZONE_HOUR'; ado_reservedwords[680] := 'TIMEZONE_MINUTE'; ado_reservedwords[681] := 'TINYINT'; ado_reservedwords[682] := 'TO'; ado_reservedwords[683] := 'TOP'; ado_reservedwords[684] := 'TPE'; ado_reservedwords[685] := 'TRACING'; ado_reservedwords[686] := 'TRAILING'; ado_reservedwords[687] := 'TRAN'; ado_reservedwords[688] := 'TRANSACTION'; ado_reservedwords[689] := 'TRANSLATE'; ado_reservedwords[690] := 'TRANSLATION'; ado_reservedwords[691] := 'TREAT'; ado_reservedwords[692] := 'TRIGGER'; ado_reservedwords[693] := 'TRIGGERS'; ado_reservedwords[694] := 'TRIM'; ado_reservedwords[695] := 'TRUE'; ado_reservedwords[696] := 'TRUNCATE'; ado_reservedwords[697] := 'TSEQUAL'; ado_reservedwords[698] := 'TYPE'; ado_reservedwords[699] := 'UID'; ado_reservedwords[700] := 'UNCOMMITTED'; ado_reservedwords[701] := 'UNDER'; ado_reservedwords[702] := 'UNION'; ado_reservedwords[703] := 'UNIQUE'; ado_reservedwords[704] := 'UNKNOWN'; ado_reservedwords[705] := 'UNLIMITED'; ado_reservedwords[706] := 'UNLOADTABLE'; ado_reservedwords[707] := 'UNNEST'; ado_reservedwords[708] := 'UNSIGNED'; ado_reservedwords[709] := 'UNTIL'; ado_reservedwords[710] := 'UP'; ado_reservedwords[711] := 'UPDATE'; ado_reservedwords[712] := 'UPDATETEXT'; ado_reservedwords[713] := 'UPPER'; ado_reservedwords[714] := 'USAGE'; ado_reservedwords[715] := 'USE'; ado_reservedwords[716] := 'USER'; ado_reservedwords[717] := 'USING'; ado_reservedwords[718] := 'UUID'; ado_reservedwords[719] := 'VALIDATE'; ado_reservedwords[720] := 'VALIDPROC'; ado_reservedwords[721] := 'VALIDROW'; ado_reservedwords[722] := 'VALUE'; ado_reservedwords[723] := 'VALUES'; ado_reservedwords[724] := 'VARBINARY'; ado_reservedwords[725] := 'VARCHAR'; ado_reservedwords[726] := 'VARIABLE'; ado_reservedwords[727] := 'VARIABLES'; ado_reservedwords[728] := 'VARYING'; ado_reservedwords[729] := 'VCAT'; ado_reservedwords[730] := 'VERSION'; ado_reservedwords[731] := 'VIEW'; ado_reservedwords[732] := 'VOLUMES'; ado_reservedwords[733] := 'WAITFOR'; ado_reservedwords[734] := 'WEEK'; ado_reservedwords[735] := 'WHEN'; ado_reservedwords[736] := 'WHENEVER'; ado_reservedwords[737] := 'WHERE'; ado_reservedwords[738] := 'WHILE'; ado_reservedwords[739] := 'WITH'; ado_reservedwords[740] := 'WITHOUT'; ado_reservedwords[741] := 'WORK'; ado_reservedwords[742] := 'WRITE'; ado_reservedwords[743] := 'WRITETEXT'; ado_reservedwords[744] := 'YEAR'; ado_reservedwords[745] := 'YEARS'; ado_reservedwords[746] := 'ZONE'; end; function TDAMSConnection.IdentifierNeedsQuoting( const iIdentifier: string): boolean; begin Result := inherited IdentifierNeedsQuoting(iIdentifier) or MSSQL_IdentifierNeedsQuoting(iIdentifier); end; procedure TDAMSConnection.DoGetStoredProcedureParams( const aStoredProcedureName: string; out Params: TDAParamCollection); begin MSSQL_DoGetStoredProcedureParams(aStoredProcedureName, GetDatasetClass.Create(Self), Params); end; { TDAMSSQLDriver } function TDAMSSQLDriver.GetDefaultConnectionType( const AuxDriver: string): string; begin Result := MSSQL_DriverType; end; function MSACCESS_GetFileExtensions: IROStrings; begin Result := NewROStrings; Result.Add('*.mdb;MSAccess files (*.mdb)'); Result.Add('*.*;All files (*.*)'); end; initialization ado_InitializeReservedWords; finalization ado_reservedwords := nil; end.