Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Current recordset does not support updating

2 posts in OLEDB Last posting was on 2006-06-08 19:11:35.0Z
Andrew Bradley Posted on 2006-05-14 21:51:00.0Z
Date: Sun, 14 May 2006 22:51:00 +0100
From: Andrew Bradley <andrew@idssystems-online.com>
User-Agent: Thunderbird 1.5.0.2 (Windows/20060308)
MIME-Version: 1.0
Newsgroups: Advantage.OLEDB
Subject: Current recordset does not support updating
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 86.29.197.30
Message-ID: <4467a598@solutions.advantagedatabase.com>
X-Trace: 14 May 2006 15:48:08 -0700, 86.29.197.30
Lines: 59
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!86.29.197.30
Xref: solutions.advantagedatabase.com Advantage.OLEDB:1154
Article PK: 1133675

My company is porting an application written in VB6 from Access to
Advantage.

In a few places, we open a recordset and populate a grid. We then
movefirst and loop through the recordset updating two fields in each
record. This code works in Access - in Advantage it generates the error
"Current recordset does not support updating. This may be a limitation
of the provider, or the selected locktype."

Using the supports method of the recordset I determined that updating
would be allowed if I used a clientside cursor. However I then get an
error "insufficient base table information for updating or refreshing".

I'm not very well informed on cursors, locktypes etc, and with my boss
away and the client expecting a beta version early this week, I have
little time to read up. If anyone has any pointers they would be very
much appreciated.

Code details are pasted below.

David

Connection details are:

Set cnnconnection = New ADODB.connection
With cnnconnection
.CursorLocation = adUseServer
.Mode = adModeReadWrite
.Open "Provider=Advantage OLE DB Provider; Data Source=" & amspath
& "\" & database_name & ";LockMode=ADS_Compatible_Locking;
ServerType=ADS_REMOTE_SERVER; TableType=ADS_ADT;
TrimTrailingSpaces=TRUE; User ID=test; Password=test;
FilterOptions=RESPECT_WHEN_COUNTING"
End With

Recordset is opened like this:

Set adostatements = New ADODB.Recordset
With adostatements
.ActiveConnection = connection.cnnconnection
.LockType = adLockOptimistic
.CursorLocation = adUseServer
.CursorType = adOpenKeyset
.Source = strsql
End With
adostatements.Open

The updating part is like this:

With adostatements
.MoveFirst
While Not .EOF
.Update
!state_lock = True
!state_lock_user = users.username
.Update
.MoveNext
Wend
End With


Jeremy Mullin Posted on 2006-06-08 19:11:35.0Z
Date: Thu, 8 Jun 2006 19:11:35 +0000 (UTC)
Message-ID: <886edc1513c338c859143434321d@devzone.advantagedatabase.com>
From: Jeremy Mullin <no@email.com>
Subject: Re: Current recordset does not support updating
Newsgroups: Advantage.OLEDB
References: <4467a598@solutions.advantagedatabase.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=iso-8859-1; format=flowed
X-Newsreader: JetBrains Omea Reader 928.2
NNTP-Posting-Host: 10.24.38.116
X-Trace: 8 Jun 2006 13:08:00 -0700, 10.24.38.116
Lines: 68
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!10.24.38.116
Xref: solutions.advantagedatabase.com Advantage.OLEDB:1155
Article PK: 1133676

What is the sql statement you are executing? Does it result in a static cursor
if you run it from ARC?

J.D. Mullin
Advantage R&D

> My company is porting an application written in VB6 from Access to
> Advantage.
>
> In a few places, we open a recordset and populate a grid. We then
> movefirst and loop through the recordset updating two fields in each
> record. This code works in Access - in Advantage it generates the
> error "Current recordset does not support updating. This may be a
> limitation of the provider, or the selected locktype."
>
> Using the supports method of the recordset I determined that updating
> would be allowed if I used a clientside cursor. However I then get an
> error "insufficient base table information for updating or
> refreshing".
>
> I'm not very well informed on cursors, locktypes etc, and with my boss
> away and the client expecting a beta version early this week, I have
> little time to read up. If anyone has any pointers they would be very
> much appreciated.
>
> Code details are pasted below.
>
> David
>
> Connection details are:
>
> Set cnnconnection = New ADODB.connection
> With cnnconnection
> .CursorLocation = adUseServer
> .Mode = adModeReadWrite
> .Open "Provider=Advantage OLE DB Provider; Data Source=" &
> amspath
> & "\" & database_name & ";LockMode=ADS_Compatible_Locking;
> ServerType=ADS_REMOTE_SERVER; TableType=ADS_ADT;
> TrimTrailingSpaces=TRUE; User ID=test; Password=test;
> FilterOptions=RESPECT_WHEN_COUNTING"
> End With
> Recordset is opened like this:
>
> Set adostatements = New ADODB.Recordset
> With adostatements
> .ActiveConnection = connection.cnnconnection
> .LockType = adLockOptimistic
> .CursorLocation = adUseServer
> .CursorType = adOpenKeyset
> .Source = strsql
> End With
> adostatements.Open
>
> The updating part is like this:
>
> With adostatements
> .MoveFirst
> While Not .EOF
> .Update
> !state_lock = True
> !state_lock_user = users.username
> .Update
> .MoveNext
> Wend
> End With