If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
MS Jet --> MS Access Data Source: How to obtain Update lock
Hi folks,
I have a question how to obtain an update lock when talking to a MS Access ODBC data source. The DSN is roted to an otherwise unused .mdb file and driven by the MS Access ODBC driver version 4.00.6200.00 and I have ANSI SQL switched on (value is set to 1) and I increased the buffer to 102400. All other settings are default under Windows 2000. My plan is to issue a statement like SELECT * from bla where key=blabla in order to lock the row or rows for an upcoming update. In Oracle I would do "SELECT .... FOR UPDATE (NOWAIT)", in SQL Server I would do an UPDLOCK hint. None of those works for my scenario. What can I do ? Somewhere else on the net someone seriously suggested to issue a dummy update command like "UPDATE bla set key=key where key=blabla" which of course is a nuisance: It'll increase data traffic and cause unnecessary load on the database. Plus my SQL statements are created dynamically in the application and then sent to the DSN and I dont always have the update statement at hand when I want to do the select.. and it would mean a major redesign in the application to achieve that. Thanks, André |
#2
|
|||
|
|||
MS Jet --> MS Access Data Source: How to obtain Update lock
Hello Andr?,
"Andr? Hartmann" wrote: AH Hi folks, AH AH I have a question how to obtain an update lock when talking to a AH MS Access ODBC data source. The DSN is roted to an otherwise unused AH .mdb file and driven by the MS Access ODBC driver version AH 4.00.6200.00 and I have ANSI SQL switched on (value is set to 1) AH and I increased the buffer to 102400. All other settings are AH default under Windows 2000. AH AH My plan is to issue a statement like AH AH SELECT * from bla where key=blabla AH AH in order to lock the row or rows for an upcoming update. In AH Oracle I would do "SELECT .... FOR UPDATE (NOWAIT)", in SQL Server AH I would do an UPDLOCK hint. None of those works for my scenario. If you do need the lock for updating via a cursor, try to set the SQL_ATTR_CONCURRENCY statement attribute to SQL_CONCUR_LOCK before calling SQLExecDirect or SQLExecute. AH What can I do ? Somewhere else on the net someone seriously AH suggested to issue a dummy update command like "UPDATE bla set AH key=key where key=blabla" which of course is a nuisance: AH It'll increase data traffic and cause unnecessary load on the AH database. Plus my SQL statements are created dynamically in the AH application and then sent to the DSN and I dont always have the AH update statement at hand when I want to do the select.. and it AH would mean a major redesign in the application to achieve that. Agree with others that you'd better use an UPDATE statement because nothing can reduce network trafic while using Access. -- Sincerely, Dmitri Ivanov Common Lisp ODBC interface - www.ystok.ru |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to create graphs in a monthly report where the base data can change | John Clarke | Charts and Charting | 3 | June 25th, 2004 02:22 AM |
Data Access Page Problem | Doug Munich | General Discussion | 0 | June 5th, 2004 12:03 AM |
Edit recipient list causes "cannot find its data source" in Word 2002. | Les Mercer | Mailmerge | 3 | May 7th, 2004 03:49 PM |
Chart Data Table, Data Range, etc. do not update on Chart | RichardS | Charts and Charting | 3 | December 17th, 2003 05:56 PM |
Source Data Ranges in Charts | Tushar Mehta | Charts and Charting | 0 | November 30th, 2003 03:29 PM |