编码请帮助中的问题 [英] Problem in Coding Pls help

查看:57
本文介绍了编码请帮助中的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

推荐答案

除了不知道您的问题是什么,因为您没有问过问题,也没有提供错误消息或症状, ;

1)取决于调用者的期望,您使用了Function语句并且什么也不返回.

2) rs.Open ("Select * from tbllogin"), cnn, 2, 3右括号是否在正确的位置?会认为rs.Open ("Select * from tbllogin", cnn, 2, 3)更合适,或者将其完全删除.

3)不记得添加的listview语句,但是不记得最前面的可选成员,尽管...可能是错误的...一段时间了...

最好我能提出来,直到您给我们更多的线索......... ::〜
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..........:~


这篇关于编码请帮助中的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆