Help wanted!!
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: Help wanted!!

Threaded View

  1. #1
    Join Date
    Apr 2006
    Location
    Kolkata, India
    Posts
    273

    Angry Help wanted!!

    Dear Buddies,

    Hello, after a long time I entered this forum again.

    I have a peculiar question: that is

    I have a database with a table called NAME(apart from name field , there are SEx age ,Qlf,Address), there are several names in that Table some are duplicate name(I need these ) with different address,anyway I want MsFlexGrid1 to show the Duplicates I search for.
    StrSql1="Select * From table where name like '" & Me.cmbpid.text & "'"
    But this Flexgrid shows 1 record only.
    I want to see all 4 records saved in there.


    I did this:
    Code:
    Data1.RecordSource = "Select * from Master where name like '*" & Trim(ftext) & "*'"
    Data1.Recordset.MoveNext
    Data1.Refresh
    con.close
    strsql1 = "SELECT * FROM MASTER WHERE NAME LIKE '" & Me.cmbpid.Text & "'"
     
     With rs
        
        rs.ActiveConnection = con.ConnectionString
        .CursorLocation = adUseClient
        .Open strsql1
        If rs.RecordCount > 0 Then
        .MoveFirst
        k = .RecordCount
        
            For q = 1 To k
                'MSFlexGrid1.Clear
                MSFlexGrid1.AddItem (strsql1)
               
                'MSFlexGrid1.TextMatrix(1, 0) = .Fields(0)
                'MSFlexGrid1.TextMatrix(1, 1) = .Fields(1)  ' and so on for display
                'MSFlexGrid1.TextMatrix(1, 2) = .Fields(2)
                'MSFlexGrid1.TextMatrix(1, 3) = .Fields(3)
                'MSFlexGrid1.TextMatrix(1, 4) = .Fields(4)
                'MSFlexGrid1.TextMatrix(1, 5) = .Fields(5)
                'MSFlexGrid1.TextMatrix(1, 6) = .Fields(6)
                'MSFlexGrid1.TextMatrix(1, 7) = .Fields(7)
                'MSFlexGrid1.TextMatrix(1, 8) = .Fields(8)
                'MSFlexGrid1.TextMatrix(1, 9) = .Fields(9)
                'MSFlexGrid1.TextMatrix(1, 10) = .Fields(10)
                'MSFlexGrid1.TextMatrix(1, 11) = .Fields(11)
                'MSFlexGrid1.TextMatrix(1, 12) = .Fields(12)
                'MSFlexGrid1.TextMatrix(1, 13) = .Fields(13)
                'MSFlexGrid1.TextMatrix(1, 14) = .Fields(14)
                'MSFlexGrid1.TextMatrix(1, 15) = .Fields(15)
                Next
       If .EOF = True Then
               MsgBox (rs.RecordCount() & " Records presented.")
       End If
          yesno = MsgBox("See More", vbYesNo)
          If yesno = vbNo Then
          MSFlexGrid1.Clear
          End If
          .MoveNext
            '
        End If
        Set rs = Nothing
    
          On Error GoTo 0
    Exit Sub
    End With
    Last edited by WizBang; November 2nd, 2013 at 08:25 AM. Reason: Fixed code tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center