2 Replies - 1705 Views - Last Post: 06 July 2012 - 04:21 PM Rate Topic: -----

#1 rana mohamed12  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 05-July 12

search using datagrid and adodc

Posted 05 July 2012 - 04:34 PM

i have make adodc connection with access 2007
it is suppose that i wrote the student id in a text then press button search then
the data appear in the data grid
Private Sub Command1_Click()
Adodc2.RecordSource = " select * from Student where StdID = " & Text1.Text & ""

If Adodc2.Recordset.EOF = True Then
MsgBox "Record not found"
Else
DataGrid1.datasource = Adodc2.recordsource
DataGrid1.Refresh
End If
End Sub


there is an error in DataGrid1.datasource = Adodc2.recordsourcei dont know why?

Is This A Good Question/Topic? 0
  • +

Replies To: search using datagrid and adodc

#2 BobRodes  Icon User is offline

  • Your Friendly Local Curmudgeon
  • member icon

Reputation: 550
  • View blog
  • Posts: 2,911
  • Joined: 19-May 09

Re: search using datagrid and adodc

Posted 06 July 2012 - 06:14 AM

You need to set your datasource to the control itself, not to its RecordSource property. adodc.recordsource simply tells the data control where to find its data.
Was This Post Helpful? 0
  • +
  • -

#3 rana mohamed12  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 05-July 12

Re: search using datagrid and adodc

Posted 06 July 2012 - 04:21 PM

View PostBobRodes, on 06 July 2012 - 06:14 AM, said:

You need to set your datasource to the control itself, not to its RecordSource property. adodc.recordsource simply tells the data control where to find its data.


thanks a lot
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1