adEditInProgress

From: George Hester (hesterloli_at_hotmail.com)
Date: 06/29/04


Date: Tue, 29 Jun 2004 03:54:11 -0400

In an ASP I have this:

<%
Option Explicit
Dim cn, rs, sSQL
sSQL= "SELECT * FROM Suppliers"
Set cn = Server.CreateObject("ADODB.Connection")
cn.Open Application("DBconn")
Set rs = Server.CreateObject("ADODB.Recordset")
rs.CursorType = adOpenKeyset
rs.LockType = adLockOptimistic
rs.Open sSQL, cn,,, adCmdText
With rs
 .AddNew
 .Fields("CompanyName") = "Westie Enterprises"
 .Fields("ContactName") = "Torrey Spinoza"
 .Fields("ContactTitle") = "Top Dog"
 .Update
 .Close
End With
sSQL = "SELECT * FROM Suppliers ORDER BY SupplierID DESC" 'DESC means reverse-order
rs.CursorType = adOpenKeyset
rs.LockType = adLockOptimistic
rs.Open sSQL, cn,,, adCmdText
With rs
 .EditMode = adEditInProgress 'FAILS HERE
 .Fields("ContactTitle") = "CEO"
 .Fields("Region") = "West Highlands"
 .Update
 .Close
End With
sSQL = "SELECT * FROM Suppliers ORDER BY SupplierID DESC"
rs.CursorType = adOpenForwardOnly
rs.LockType = adLockReadOnly
rs.Open sSQL, cn,,, adCmdText
%>

No according to what I have read this should work but doesn't. It fails at the part:

.EditMode = adEditInProgress

I realize it is not necessary but its inclusion should not give this:

Microsoft VBScript runtime error '800a01c2'
Wrong number of arguments or invalid property assignment: 'EditMode'

I went to the Microsoft Knowledge Base and typed in a search on adEditModeInProgress and was returned with three articles all of which began with "BUG:"

So my question is, Is this just buggy or did I use it (.EditMode = adEditInProgress) wrong? Thanks.

-- 
George Hester
__________________________________