2 Replies - 5712 Views - Last Post: 06 March 2010 - 02:26 AM Rate Topic: -----

#1 vishaldalya  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 31-January 09

listview VB6

Posted 05 March 2010 - 12:13 PM

1) how to hide columns in listview
i am having five columns in mdb database i.e. Code, Name, RegdNo City Pin
1 Vicky ABC32A Newyork 24224
i want to hide two columns City and its No. but while adding new data in database, all the fields should be properly added.

2) How to merge columns in listview.
i am having seven columns in mdb database. i.e. Flat no, Premises Name, Area,Road, City, State & its Pin. I have to show all these columns in one row row and one column only. (& not one row seven column.)

Plz guide me.

Is This A Good Question/Topic? 0
  • +

Replies To: listview VB6

#2 raziel_  Icon User is offline

  • Like a lollipop
  • member icon

Reputation: 458
  • View blog
  • Posts: 4,222
  • Joined: 25-March 09

Re: listview VB6

Posted 05 March 2010 - 04:07 PM

well do you use a ADODB(ADODC is working as well)?
i think the recordset.field will be what your looking for for your second question. i will show you what i mean
Private Sub Command1_Click()
    Dim strSQL As String
    Dim RS As ADODB.Recordset
    
    strSQL = "SELECT * FROM Some_Table WHERE some_clause"   'make a query to your DB'
    RS.Open strSQL, Connection_Open 'get the query using the opened connection'
    If Not RS.RecordCount = 0 Then
    'chekc if there is a records'
        While Not RS.EOF
        'loop for all the records'
            ListView1.ListItems.Add RS.Fields("SomeColumn").Value
            ListView1.ListItems.Add RS.Fields("OtherColumn").Value
        RS.MoveNext
        Wend
    End If
    
End Sub


Was This Post Helpful? 0
  • +
  • -

#3 Kinwang2009  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 76
  • Joined: 07-February 10

Re: listview VB6

Posted 06 March 2010 - 02:26 AM

View Postvishaldalya, on 05 March 2010 - 11:13 AM, said:

1) how to hide columns in listview
i am having five columns in mdb database i.e. Code, Name, RegdNo City Pin
1 Vicky ABC32A Newyork 24224
i want to hide two columns City and its No. but while adding new data in database, all the fields should be properly added.

2) How to merge columns in listview.
i am having seven columns in mdb database. i.e. Flat no, Premises Name, Area,Road, City, State & its Pin. I have to show all these columns in one row row and one column only. (& not one row seven column.)

Plz guide me.


Hi Vishal,

This my Login Example will help you solve your problem.
In this Example UserID, Password, and UserTypes are hidden except Username. Try to Manage Users in my example

Thankx

Attached File(s)


Was This Post Helpful? 0
  • +
  • -

Page 1 of 1