dbTalk Databases Forums  

access2007 creating a transaction - timeout error

comp.databases.ms-access comp.databases.ms-access


Discuss access2007 creating a transaction - timeout error in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Roger
 
Posts: n/a

Default access2007 creating a transaction - timeout error - 11-22-2011 , 06:33 PM






using access2007 and sql server 2005 linked tables
trying to create a transaction with many UPDATEs, INSERTs and SELECTs
this is required to get new autonumber IDs as they are created

I tried using DAO and ADODB to insert the record below,
this makes it easy to use lastModified to get the autonumber field,
bookingId
both objects failed

so I changed to an INSERT statement, like this

Set wks = Application.DBEngine(0)
Set db = CurrentDb
wks.BeginTrans

strsql = "SELECT max(bookingId) as m_bookingId FROM tblX WHERE
quoteId = " & quoteId
Set rs = db.OpenRecordset(strSql, dbOpenDynaset, dbFailOnError +
dbReadOnly) ' this works

strSql = "INSERT INTO tblX (booked) " & _
" values (-1)"
db.Execute strSql, dbFailOnError

strsql = "SELECT max(bookingId) as m_bookingId FROM tblX WHERE
quoteId = " & quoteId
Set rs = db.OpenRecordset(strSql, dbOpenDynaset, dbFailOnError +
dbReadOnly) ' this errors out with a timeout

if I look at the sql server activity monitor for this last statement,
is shows that it is blocked
by the 'INSERT...' process, but I just want to read the value of
'bookingId', thus dbReadOnly
is there a combination of parms 2 and 3 in db.openRecordset() that
will work ?

any other ideas ?

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.