How to Show Database In DataGrid Using DAO

Reply

Join Date: Aug 2006
Posts: 1
Reputation: Magna is an unknown quantity at this point 
Solved Threads: 0
Magna Magna is offline Offline
Newbie Poster

How to Show Database In DataGrid Using DAO

 
0
  #1
Aug 8th, 2006
Hi there,
I just registered and see that u have solve many problems for many ppl .. and I get good and new info and codes from u..

I'm having problem with Datagrid bcoz for really I'm not advanced devoloper,I'm using DAO to show me the records from database to the List,,which is not reconized for my project,,Now ,, I need to use Datagrid on my search form to show my search result.. so plz help me fast,, attachment is a Screenshot for my Search form..

this is the code and it is working on List,but i need code for datagrid:

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Private Sub cmdFind_Click()
  2. If txtFind.Text = "" Then
  3. MsgBox "Enter text to search for", vbOKOnly, "Error"
  4. Else
  5. If cmbFind.Text = "User Name" Then
  6. Set rec = data.OpenRecordset("select * from PC where PC.UserName Like '*" & txtFind.Text & "*'")
  7. With rec
  8. lstFind.Clear
  9. Do Until .EOF
  10. lstFind.AddItem ("User Name: " & .Fields(0) & " Owner: " & .Fields(1) & " User Type: " & .Fields(2))
  11. .MoveNext
  12. Loop
  13.  
  14. End With
  15.  
  16. ElseIf cmbFind.Text = "PC Serial Number" Then
  17. Set rec = data.OpenRecordset("select * from PC where PC.PCSerialNumber Like '*" & txtFind.Text & "*'")
  18. With rec
  19. lstFind.Clear
  20. Do Until .EOF
  21. lstFind.AddItem ("User Name: " & .Fields(0) & " Owner: " & .Fields(1) & " User Type: " & .Fields(2))
  22. .MoveNext
  23. Loop
  24. End With
  25. End if
  26. End Sub
Attached Thumbnails
search.JPG  
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC