×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

VB to Informix using ODBC. Problems with Locks.

VB to Informix using ODBC. Problems with Locks.

VB to Informix using ODBC. Problems with Locks.

(OP)
Hello,

I'm having a couple of troubles with the Informix ODBC driver
and I would like to know if someone know the answer

for this situation.

The environment is :
- Visual Basic Sp4
- Informix Server 7.31.UC5
- Tables have row lock defined.

The problem is about concurrency:
- I've established a connection (ODBC) to the server and
  I started a transaction with the following Code:

............................................................
Begin Work;
Update Test Set ProductName = 'sugar' where ProductID = 2;
............................................................

And I didn't commit or rollback the transaction
Now, I've a small VB program with the following Code

..............................................................
' Connection
' ------------------------------------------------
Set cnn = New ADODB.Connection
cnn.ConnectionTimeout = m_intConnectionTimeOut
cnn.IsolationLevel = adXactReadCommitted
cnn.CursorLocation = ADODB.adUseClient
cnn.Open "DSN=MyDSN"

' Recordset
' ------------------------------------------------
Set rs = New ADODB.Recordset
rs.LockType = adLockBatchOptimistic
rs.CursorType = adOpenStatic

' Processes
' ------------------------------------------------
' Defining the Wait time if a concurrency lock it's found,
' which it's the case by the way.

 cnn.Execute "Set Lock Mode To Wait 10 ",,adExecuteNoRecords
 rs.ActiveConnection = cnn
 rs.Open " Select * From Test ", , , , adCmdText
..........................................................

Problem : in the last line after the 10 seconds
I don't receive an error. Instead the recordset it's
in a normal state with BOF and EOF set to true, this
lead me to another problem. When you query the table
and the table it's empty the recordset will have the
BOF and EOF to true. So how can why distinguish

Question: Does anyone knows how to get thes error when
the record it's locked ?

I'm sorry for the extension of the post.
Tanks for further help.

Hugo Leitão.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close