@@ -8797,8 +8797,9 @@ function TMySQLQuery.Col(Column: Integer; IgnoreErrors: Boolean=False): String;
87978797 end ;
87988798
87998799 end ;
8800- end else if not IgnoreErrors then
8801- Raise EDbError.CreateFmt(_(MsgInvalidColumn), [Column, ColumnCount, RecordCount]);
8800+ end
8801+ else
8802+ Result := TextInvalidColumn;
88028803end ;
88038804
88048805{ $IFDEF HASMSSQL}
@@ -8827,8 +8828,9 @@ function TSqlSrvQuery.Col(Column: Integer; IgnoreErrors: Boolean=False): String;
88278828 else
88288829 Result := ' 0' ;
88298830 end
8830- end else if not IgnoreErrors then
8831- Raise EDbError.CreateFmt(_(MsgInvalidColumn), [Column, ColumnCount, RecordCount]);
8831+ end
8832+ else
8833+ Result := TextInvalidColumn;
88328834end ;
88338835{ $ENDIF}
88348836
@@ -8849,8 +8851,9 @@ function TPGQuery.Col(Column: Integer; IgnoreErrors: Boolean=False): String;
88498851 else
88508852 Result := Connection.DecodeAPIString(AnsiStr);
88518853 end ;
8852- end else if not IgnoreErrors then
8853- Raise EDbError.CreateFmt(_(MsgInvalidColumn), [Column, ColumnCount, RecordCount]);
8854+ end
8855+ else
8856+ Result := TextInvalidColumn;
88548857end ;
88558858
88568859
@@ -8863,8 +8866,9 @@ function TSQLiteQuery.Col(Column: Integer; IgnoreErrors: Boolean=False): String;
88638866 end else begin
88648867 Result := FCurrentResults[FRecNoLocal][Column].OldText;
88658868 end ;
8866- end else if not IgnoreErrors then
8867- Raise EDbError.CreateFmt(_(MsgInvalidColumn), [Column, ColumnCount, RecordCount]);
8869+ end
8870+ else
8871+ Result := TextInvalidColumn;
88688872end ;
88698873
88708874
@@ -8876,8 +8880,9 @@ function TSQLiteQuery.Col(Column: Integer; IgnoreErrors: Boolean=False): String;
88768880 end else begin
88778881 Result := FCurrentResults.Fields[Column].AsString;
88788882 end;
8879- end else if not IgnoreErrors then
8880- Raise EDbError.CreateFmt(_(MsgInvalidColumn), [Column, ColumnCount, RecordCount]);
8883+ end
8884+ else
8885+ Result := TextInvalidColumn;
88818886end;}
88828887
88838888
@@ -8887,12 +8892,11 @@ function TDBQuery.Col(ColumnName: String; IgnoreErrors: Boolean=False): String;
88878892begin
88888893 // ColumnNames is case insensitive, so we can select wrong cased columns in MariaDB 10.4
88898894 // See #599
8890- Result := ' ' ;
88918895 idx := ColumnNames.IndexOf(ColumnName);
88928896 if idx > -1 then
88938897 Result := Col(idx)
8894- else if not IgnoreErrors then
8895- Raise EDbError.CreateFmt(_( ' Column "%s" not available. ' ), [ColumnName]) ;
8898+ else
8899+ Result := TextInvalidColumn ;
88968900end ;
88978901
88988902
@@ -8982,8 +8986,9 @@ function TDBQuery.ColAttributes(Column: Integer): TTableColumn;
89828986 i: Integer;
89838987begin
89848988 Result := nil ;
8985- if (Column < 0 ) or (Column >= FColumnOrgNames.Count) then
8986- raise EDbError.CreateFmt(_(' Column #%s not available.' ), [IntToStr(Column)]);
8989+ if (Column < 0 ) or (Column >= FColumnOrgNames.Count) then begin
8990+ // Just return nil
8991+ end ;
89878992 if FColumns <> nil then begin
89888993 for i:=0 to FColumns.Count-1 do begin
89898994 if FColumns[i].Name = FColumnOrgNames[Column] then begin
0 commit comments