For questions about Truedbgrid, ask you prawn

zhaozj2021-02-16  93

We use the TruedBGrid Pro 8.0 control in a VB engineering. In the later change, we want to add its Filter feature to (which is hidden), but when we set its FilterBar property to true, Throw such an exception: The Provider filter cannot be opened. Filter's function is as follows:

Private Sub TdbGrid1_filterchange () on Error Goto Errhandler

Set cols = tdbgrid1.columnsdim c as integer = tdbgrid1.coltdbGrid1.holdfields

Adodc1.recordset.filter = getfilter () TDBGRID1.COL = CTDBGRID1.EDITACTIVE = TrueExit Sub

Errhandler: MsgBox Err.Source & ":" & vbcrf & err.description for Each Col in TdbGrid1.columns col.filtertext = "" Next Colend Sub

Private function getfilter () AS STRING DIM TMP AS STRING DIM N AS INTEGER for Each Col in cols if Trim (col.filtertext) <> "" "THEN N = N 1 IF N> 1 TMP = TMP &" AND "END If TMP = TMP & col.Datafield & "Like '" & col.filtertext & "%'" end if next col Getfilter = TMPEND FUNCTION

In the DEBUG, there is an abnormality in the Purple Font. If you doubt what the settings are related to AdoDB, please ask your prawn to enlighten me!

转载请注明原文地址:https://www.9cbs.com/read-11865.html

New Post(0)