I think all I need is to somehow unbind the stored procedure recordset to the Janus GridEX, but having a difficult time figuring out how. Programming language is VBA.

My grid populates as I want - no problem there. But this code will not allow me to edit the cells that I have showing (hiding some columns):

JGEX.AllowEdit = True
JGEX.Columns(4).EditType = jgexEditNone
JGEX.Columns(6).EditType = jgexEditTextBox
JGEX.Columns(7).EditType = jgexEditTextBox
JGEX.Columns(8).EditType = jgexEditTextBox

again - I think the only issue is the need to disconnect the recordset (to allow edit). The RS object is tied in like this:

Set JGEX.ADORecordset = rsStaged

Where the rsStaged is this:

Set rsStaged = New ADODB.Recordset
rsStaged.CursorLocation = adUseClient
rsStaged.Open SQL1, cnScada, adOpenStatic, adLockOptimistic

Pretty simple recordset, but comes from a stored procedure, not a direct table query.

Thanks in advance!

有帮助吗?

解决方案

I fixed the issue by adding lines of code as shown below:

JGEX.AllowEdit = True
JGEX.EditMode = jgexEditModeOn

JGEX.Columns(4).EditType = jgexEditNone
JGEX.Columns(6).EditType = jgexEditTextBox
JGEX.Columns(7).EditType = jgexEditTextBox
JGEX.Columns(8).EditType = jgexEditTextBox

JGEX.Update

You can see the differences there from above. My only problem now is that when I actually edit fields (complete on a single row), I would get this:

Multiple-step operation generated errors. Check each status value.

I believe this issue is because my recordset object is bound and it is attempting to write back. Essentially, though, what I want to do is have the ability to update any row inside the table. I will handle write back by iterating through the rows and then calling a Stored Procedure as required.

thanks again.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top