RST.Addnew in combination with Limit 1. - Mailing list pgsql-novice

From Vellinga, Fred
Subject RST.Addnew in combination with Limit 1.
Date
Msg-id DB8373C85B90D71191350008C784C739574988@ms-ams-exch02.nl.mcilink.com
Whole thread Raw
List pgsql-novice

Hi,

I want to use the ADODB object model to do updates etc. I use MSaccess as frontend, but I guess it will fail on any frontend that supports ADODB.

However the following code does not do the update.

Set RST = New ADODB.Recordset
RST.Open "SELECT FldPtr FROM TblTown LIMIT 1;", CNN, adOpenKeyset, adLockOptimistic, adCmdText
RST.AddNew
RST.Fields("FldPtr").Value = 1
RST.Update

The following does however the work:

Set RST = New ADODB.Recordset
RST.Open "SELECT FldPtr FROM TblTown;", CNN, adOpenKeyset, adLockOptimistic, adCmdText
RST.AddNew
RST.Fields("FldPtr").Value = 1
RST.Update

Is this a bug in the LIMIT operator? The advantage of LIMIT 1 is that only one record in sent over the wire. The code fails at the moment the RST.update statement is called.

Anyway, I am new to PostgreSQL, but the ADODB works very fine with PostgreSQL.
 
Thanks,
Fred

pgsql-novice by date:

Previous
From: Giovanni Mattamira
Date:
Subject: Name of server SSL key and certificate in version 7.4
Next
From: "Matt Lynch"
Date:
Subject: LWLockAcquire