Thread: Problem with psqlODBC 07.02.0001and VB 6

Problem with psqlODBC 07.02.0001and VB 6

From
"Eng Kern Shen"
Date:
Hi,

I've been using previous versions of the ODBC driver without any
problem, but after intalling the version 07.02.0001, I discovered a
serious problem with the following codes in VB6.  Locking tables with
the codes below doesn't work.

        cn.Execute "BEGIN"

        cn.Execute "LOCK TABLE serialno IN ACCESS EXCLUSIVE MODE"

      ......

        cn.Execute "COMMIT"


In VB debug mode, after executing the 2nd line, I carry out a 'SELECT'
on the 'serialno' table in another connection.
In previous version, the 'SELECT' would hold the 'SELECT' result until I
execute the 'COMMIT' line in my VB codes, meaning that the locking of
the table is successful.  However, in version 07.02.0001, the 'SELECT'
on the 'serialno' table display the result even though it is supposed to
be lock in my VB codes.  I've also realised that other transaction
comands "BEGIN", "ROLLBACK" and "COMMIT" doesn't works as well.

Great thanks to anyone who can explain what's happening.  Bug or
feature, or I should change my codings.

Kern.



Re: Problem with psqlODBC 07.02.0001and VB 6

From
Hiroshi Inoue
Date:
Eng Kern Shen wrote:
>
> Hi,
>
> I've been using previous versions of the ODBC driver without any
> problem, but after intalling the version 07.02.0001, I discovered a
> serious problem with the following codes in VB6.  Locking tables with
> the codes below doesn't work.
>
>         cn.Execute "BEGIN"
>
>         cn.Execute "LOCK TABLE serialno IN ACCESS EXCLUSIVE MODE"
>
>           ......
>
>         cn.Execute "COMMIT"

Direct execution of "BEGIN", "COMMIT" or "ROLLBACK" isn't
a recommended way. Please call BeginTrans, CommitTrans or
RollbackTrans instead.

regards,
Hiroshi Inoue
    http://w2422.nsk.ne.jp/~inoue/