0

我认为我需要的只是以某种方式将存储过程记录集与 Janus GridEX 解除绑定,但很难弄清楚如何。编程语言是VBA。

我的网格按我的意愿填充 - 没问题。但是这段代码不允许我编辑我显示的单元格(隐藏一些列):

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

再次 - 我认为唯一的问题是需要断开记录集(以允许编辑)。RS 对象是这样绑定的:

Set JGEX.ADORecordset = rsStaged

rsStaged 是这样的:

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

非常简单的记录集,但来自存储过程,而不是直接表查询。

提前致谢!

4

1 回答 1

0

我通过添加如下所示的代码行解决了这个问题:

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

你可以从上面看到那里的差异。我现在唯一的问题是,当我实际编辑字段(在单行上完成)时,我会得到这个:

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.

于 2014-01-24T17:06:46.690 回答