please help me, i need show data searching in datagrid. i have example code but its can't compile.
These coding examples that I made.
Option Explicit
Dim conn As ADODB.Connection
Dim Rs As ADODB.Recordset
Dim query As String
Sub setConn()
Set conn = New ADODB.Connection
End Sub
Private Sub serachCmd_Click()
Set Rs = New Recordset
Adodc1.RecordSource = " select * from logfile where no_ponsel = '" & textSearch & "'"
Set LogDataGrid.DataSource = Adodc1
'Rs.Open " select * from logfile where no_ponsel = '" & textSearch & "'", conn, adOpenDynamic, adLockOptimistic
If Adodc1.Recordset.EOF Then
MsgBox "Record not found"
Else
LogDataGrid.DataSource = Adodc1 /* in this is error and message appear "method and data number not found"
LogDataGrid.Refresh
End If
End Sub
please help me..thanks