// dataBaseNameS : string is the name of the alias (MS-SQL 6.5) begin Query1 := TQuery.Create (Application); With Query1 do begin DatabaseName := dataBaseNameS; SQL.Text := 'SELECT * FROM ABLESTOP'; // the exception disappears if the following is removed Unidirectional := True; Open; end; ShowMessage ('ok')
Table1 := TTable.Create (Self); With Table1 do begin DatabaseName := dataBaseNameS; TableName := 'COMPONENT_PLAN'; UpdateMode := upWhereKeyOnly; Open end;
Table1.Insert; Table1.FieldByName ('PARTNO').AsString := IntToStr (GetTickCount); Table1.FieldByName ('ID').AsString := 'WWxx'; Table1.FieldByName ('VERSION').AsInteger := 1; // the exception will occurr in the next statement: // "Connection is in use by another statement" Table1.Post;
|