operation cannot be performed on an active dataset lazarus / 16-Databases ---------------------------------------------------------------------- skaner1900 · 2011-12-05 23:51 I defined Host, User, Pass, and dbName and I connected SQLConnection SQLTransaction SQLQuery and DataSource on Form, and wrote it: Code: [Select]procedure TForm1.Button1Click(Sender: TObject); begin if SQLConnection.Connected then begin     SQLTransaction.Active := False;     SQLConnection.Close;   end;   SQLConnection.Open; end; procedure TForm1.Button2Click(Sender: TObject); var   s:string; begin   SQLQuery.ParseSQL:=true;   SQLQuery.ReadOnly:=false;   SQLQuery.SQL.Text := 'SELECT * FROM mytable';   SQLQuery.Open;     <- operation cannot be performed on an active dataset  Code: [Select] {SQLQuery.Last;   S := IntToStr(SQLQuery.RecordCount) + #13#10;   SQLQuery.First;   while not SQLQuery.EOF do     begin     S := S + SQLQuery.FieldByName('surname').AsString + #13#10;     SQLQuery.Next;     end;   Memo1.Text:=S;   dbGrid1.DataSource:=SQLQuery.DataSource;}   SQLQuery.ParseSQL:=false;   SQLQuery.ReadOnly:=true; end; and I've got an error "operation cannot be performed on an active dataset" what is wrong? have I any more errors in {} ? Thx ---------------------------------------------------------------------- Lacak2 · 2011-12-06 05:15 You can not change (set) ParseSQL and ReadOnly properties while dataset is open