Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Function Listload(Gsub_LoadDatasource As String, lvw As ListView)
Dim rs As New ADODB.Recordset
Dim cnn As New ADODB.Connection
'Gsub_LoadDatasource
cnn.ConnectionString = "Provider=Microsoft.jet.oledb.4.0;Data Source =D:\Lifting RAR\Liftingreports.mdb"
cnn.Open
rs.Open ("Select * from tbllogin"), cnn, 2, 3
lvw.ListItems.Clear
While Not rs.EOF
  With lvw.ListItems.Add(, , rs(0))
        For rx = 1 To 3
             .SubItems(rx) = rs(rx)
        Next
  End With
     rs.MoveNext
  Wend
End Function
Posted
Updated 23-Oct-10 3:18am
v2
Comments
Rod Kemp 23-Oct-10 9:19am    
What exactly is the problem. List any error messages you may be receiving.
Keith Barrow 23-Oct-10 9:37am    
There is no question here, what is the problem? You just state you have a problem then whizz up some code. Please tell us the error message at least.
thatraja 23-Oct-10 10:17am    
There is no question man
Tarun.K.S 23-Oct-10 13:05pm    
now what?
Henry Minute 23-Oct-10 22:44pm    
Your code (Recordset) looks like it might be VB 6.0, please edit your Tag to make it either VB 6.0 or VB.NET

1 solution

Apart from having no idea what your problem is, because you haven't asked a question, or provided an error messages or symptoms;

1) Depend what the caller is expecting, you have used a Function statement and returning nothing at all.

2) rs.Open ("Select * from tbllogin"), cnn, 2, 3 is the closing parenthesis in the correct place? would have thought rs.Open ("Select * from tbllogin", cnn, 2, 3) would have been more appropriate, or remove them altogether.

3) Can't remember the statements for the listview add, but don't remember optional members at the front, could be wrong though....been a while...

best I can come up with until you give us all more of a clue..........:~
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900