Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
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
Posted 29-Sep-11 5:48am
denovez328
Edited 29-Sep-11 5:55am
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You need to change the line you flagged. Add "Set" to the beginning of the line. See the line near the top of that procedure where you're doing the exact same thing.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

its still cannot compile.
im need to view in datagrid
select * from logfile where no_ponsel = '" & searchtext.text & " ';
 
but apear message error.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web01 | 2.8.1411022.1 | Last Updated 4 Oct 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100