mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2026-03-13 09:24:25 +08:00
Create new data grid result object each time, so it's of the right vendor type. Fixes an access violation when switching to a table in another connection. See http://www.heidisql.com/forum.php?t=8306
This commit is contained in:
@@ -4023,9 +4023,12 @@ begin
|
||||
|
||||
try
|
||||
ShowStatusMsg('Fetching rows ...');
|
||||
if not Assigned(DataGridResult) then
|
||||
// Result object must be of the right vendor type
|
||||
if not RefreshingData then begin
|
||||
FreeAndNil(DataGridResult);
|
||||
DataGridResult := DBObj.Connection.Parameters.CreateQuery(Self);
|
||||
DataGridResult.Connection := ActiveConnection;
|
||||
end;
|
||||
DataGridResult.Connection := DBObj.Connection;
|
||||
DataGridResult.SQL := Select;
|
||||
DataGridResult.Execute(Offset > 0);
|
||||
DataGridResult.ColumnOrgNames := WantedColumnOrgnames;
|
||||
|
||||
Reference in New Issue
Block a user