User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Visual Basic 4 / 5 / 6 section within the Software Development category of DaniWeb, a massive community of 425,997 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 1,680 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums
Views: 4405 | Replies: 0
Reply
Join Date: Aug 2006
Posts: 1
Reputation: Magna is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Magna Magna is offline Offline
Newbie Poster

Help How to Show Database In DataGrid Using DAO

  #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:

Private Sub cmdFind_Click()
If txtFind.Text = "" Then
MsgBox "Enter text to search for", vbOKOnly, "Error"
Else
If cmbFind.Text = "User Name" Then
    Set rec = data.OpenRecordset("select * from PC where PC.UserName  Like '*" & txtFind.Text & "*'")
    With rec
    lstFind.Clear
    Do Until .EOF
   lstFind.AddItem ("User Name: " & .Fields(0) & " Owner: " & .Fields(1) & " User Type: " & .Fields(2))
    .MoveNext
     Loop
   
    End With
    
ElseIf cmbFind.Text = "PC Serial Number" Then
    Set rec = data.OpenRecordset("select * from PC where PC.PCSerialNumber  Like '*" & txtFind.Text & "*'")
    With rec
    lstFind.Clear
    Do Until .EOF
    lstFind.AddItem ("User Name: " & .Fields(0) & " Owner: " & .Fields(1) & " User Type: " & .Fields(2))
    .MoveNext
    Loop
    End With
End if
End Sub
Attached Images
File Type: jpg search.JPG (23.7 KB, 15 views)
AddThis Social Bookmark Button
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Visual Basic 4 / 5 / 6 Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum

All times are GMT -4. The time now is 12:14 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC