944,017 Members | Top Members by Rank

Ad:
Aug 8th, 2006
0

How to Show Database In DataGrid Using DAO

Expand Post »
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
Click image for larger version

Name:	search.JPG
Views:	51
Size:	23.7 KB
ID:	2247  
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Magna is offline Offline
1 posts
since Aug 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: OLE object question
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: text boxes





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC