Changeset View
Changeset View
Standalone View
Standalone View
kexi/plugins/queries/kexiqueryview.cpp
Context not available. | |||||
88 | if (!ok) {//input cancelled | 88 | if (!ok) {//input cancelled | ||
---|---|---|---|---|---|
89 | return cancelled; | 89 | return cancelled; | ||
90 | } | 90 | } | ||
91 | d->cursor = conn->executeQuery(*query, d->currentParams); | 91 | d->cursor = conn->prepareQuery(*query, d->currentParams); | ||
92 | if (!d->cursor) { | 92 | if (!d->cursor) { | ||
93 | window()->setStatus( | 93 | window()->setStatus( | ||
94 | conn, | 94 | conn, | ||
Context not available. | |||||
96 | //! @todo also provide server result and sql statement | 96 | //! @todo also provide server result and sql statement | ||
97 | return false; | 97 | return false; | ||
98 | } | 98 | } | ||
99 | setData(d->cursor); | 99 | ok = setData(d->cursor); | ||
100 | 100 | | |||
101 | //! @todo remove close() when dynamic cursors arrive | 101 | //! @todo remove close() when dynamic cursors arrive | ||
102 | d->cursor->close(); | 102 | if (!d->cursor->close()) { | ||
103 | 103 | ok = false; | |||
104 | if (oldCursor) | 104 | } | ||
105 | oldCursor->connection()->deleteCursor(oldCursor); | 105 | if (oldCursor) { | ||
106 | conn->deleteCursor(oldCursor); | ||||
107 | } | ||||
108 | if (!ok) { | ||||
109 | conn->deleteCursor(d->cursor); | ||||
110 | d->cursor = 0; | ||||
111 | return false; | ||||
112 | } | ||||
106 | 113 | | |||
107 | //! @todo maybe allow writing and inserting for single-table relations? | 114 | //! @todo maybe allow writing and inserting for single-table relations? | ||
108 | tableView()->setReadOnly(true); | 115 | tableView()->setReadOnly(true); | ||
Context not available. |