Re: adEditInProgress
From: Val Mazur (group51a_at_hotmail.com)
Date: 06/30/04
- Next message: Val Mazur: "Re: Filter a dataform"
- Previous message: Alex: "Object reference not set to an instance of an object."
- In reply to: George Hester: "adEditInProgress"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 29 Jun 2004 21:43:03 -0400
Hi George,
EditMode property is a read-only and it returns status of the current
record. You cannot change it from the code. To be able to edit a recordset,
all you need is just to assign value to the field and that is it.
--
Val Mazur
Microsoft MVP
"George Hester" <hesterloli@hotmail.com> wrote in message
news:uFF7E5aXEHA.1496@TK2MSFTNGP10.phx.gbl...
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
__________________________________
- Next message: Val Mazur: "Re: Filter a dataform"
- Previous message: Alex: "Object reference not set to an instance of an object."
- In reply to: George Hester: "adEditInProgress"
- Messages sorted by: [ date ] [ thread ]