|
Dim grobject As GridEX
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim sqlstr As String
Set cn = CurrentProject.Connection
Set grobject = Me.GridEX9.Object
grobject.DatabaseName = cn
'grobject.DataMode = jgexADO
MsgBox grobject.DatabaseName
sqlstr = "up_cl_v所有请购单_Cost_Fnd '" & Me.datebegin & "','" & Me.dateend & "','" & Me.Buyer & "','" & Me.BuyTeam & "','" & Me.BuyDept & "','" & Me.Whs & "'"
'日期,采购员,采购组,采购部门,仓库
Set rs = cn.Execute(sqlstr)
MsgBox rs.RecordCount '有12条记录
grobject.HoldFields
Set grobject.Recordset = rs'运行到这句的时候显示类型不匹配.不知道是什么原因.我是用在ADP中的. |
|