Have you tried recordsets?
Hmm, have you tried using the adodb instead of the data control(adodc1)? Try it by creating a recordset and then assigning the datagrid to the recordset. If you need a sample code on how to do that, let me know.
Good luck!
Don't know how to use ADODB
I have tried ADODB but don't know how to use ADODB
I Think I need some source code for a example, Thanks
Here's another one that works with MSHFlexGrid
Code:
Private Sub cmdFind_Click() 'This procdedure is for the dynamic search of the database
Dim strSQL As String
Dim strSQLAdd As String
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
If cn.State = adStateClosed Then
cn.CursorLocation = adUseClient
cn.Open
End If
strSQL = "select AtmId, ReportId, ServiceTech, DOccurence from tblReport "
If optAtm = True Then
strSQLAdd = "where AtmId = '" & txtSearch.Text & "' order by AtmId"
ElseIf OptReportID = True Then
strSQLAdd = "where ReportId = " & CInt(txtSearch.Text) & " order by ReportId"
ElseIf OptTech = True Then
strSQLAdd = "where ServiceTech LIKE '" & UCase(txtSearch.Text) & "%' order by ServiceTech"
End If
strSQL = strSQL & strSQLAdd
rs.Open strSQL, cn, adOpenStatic, adLockBatchOptimistic, adCmdText
If Not rs.EOF And Not rs.BOF Then
rs.MoveFirst
End If
Set MSHFlexGrid1.DataSource = rs
rs.Close
rs.ActiveConnection = Nothing
End Sub
Good Luck!