惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

N
News and Events Feed by Topic
D
Docker
云风的 BLOG
云风的 BLOG
F
Fortinet All Blogs
F
Full Disclosure
H
Hackread – Cybersecurity News, Data Breaches, AI and More
P
Proofpoint News Feed
Microsoft Azure Blog
Microsoft Azure Blog
WordPress大学
WordPress大学
The GitHub Blog
The GitHub Blog
L
LangChain Blog
H
Help Net Security
B
Blog
T
Tailwind CSS Blog
V
V2EX
博客园_首页
阮一峰的网络日志
阮一峰的网络日志
人人都是产品经理
人人都是产品经理
The Cloudflare Blog
Recent Announcements
Recent Announcements
aimingoo的专栏
aimingoo的专栏
美团技术团队
A
About on SuperTechFans
C
Cybersecurity and Infrastructure Security Agency CISA
K
Kaspersky official blog
I
InfoQ
Project Zero
Project Zero
I
Intezer
Google DeepMind News
Google DeepMind News
博客园 - 【当耐特】
Hugging Face - Blog
Hugging Face - Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
T
Threat Research - Cisco Blogs
Last Week in AI
Last Week in AI
C
Cyber Attacks, Cyber Crime and Cyber Security
G
GRAHAM CLULEY
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
AWS News Blog
AWS News Blog
Spread Privacy
Spread Privacy
S
Securelist
Recorded Future
Recorded Future
D
Darknet – Hacking Tools, Hacker News & Cyber Security
博客园 - 叶小钗
S
Security Affairs
Blog — PlanetScale
Blog — PlanetScale
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
月光博客
月光博客
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
罗磊的独立博客
The Hacker News
The Hacker News

博客园 - Executive

基金收益,看到自己的投资成长。 和老美打电话 2003年的日记 今年西瓜上了我家的饭桌 耐心打桥牌 重新开始 - Executive - 博客园 11-21deBridge 上海泡妞路线 阅读用户部门的管理论证报告 051030--remarkable day! On diet & on sale 口译课 记一笔 金融英语 Vinci: A Service-Oriented Architecture for Rapid Development of Web Applications (2001) 饥饿的时候我想起的小食 桥牌记录 五月消费狂 黄山游记
VB program 'Open the connection
Executive · 2005-05-15 · via 博客园 - Executive

'Open the connection
Private mConn As Connection
Private XX As String
XX="PROVIDER=MSDataShape;"
XX= XX + "Data PROVIDER=Microsoft.Jet.OLEDB.4.0;"
XX= XX + "Data Source=D:\Documents and Settings\廖丹青\桌面\台账.mdb;"
mConn.Open "XXXXXX"

在Form_Load事件中打开连接并用jdqk表中的数据填充ListView控件。记住修改mConn的Open方法中的连接字符串以匹配你的设置。
Private Sub Form_Load()
    Dim rs As Recordset
    Dim NewItem As ListItem
   
    'open the connection
    Set mConn = New Connection
    mConn.Open "PROVIDER=MSDataShape;Data PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=F:\Project\db\Account.mdb"
   
    'fill the list
    Set rs = mConn.Execute("jdqk", , adCmdTable)
    Do Until rs.EOF
        Set NewItem = listAuthors.ListItems.Add(rs("dwbh"), , rs("dwmc"))
        NewItem.SubItems(1) = rs("jzcqtzzms")
        NewItem.SubItems(2) = rs("nf")
        NewItem.SubItems(3) = rs("jd")
        rs.MoveNext
    Loop
    rs.Close
    Set rs = Nothing
End Sub
特别注意以下的语句
Set NewItem = listAuthors.ListItems.Add([Index],[Key],[Text],[Icon],[SmallIcon]) As ListItem

ListItem 对象,ListItems 集合的语法包含下面部分:

部分 描述
listview 对象表达式,其值是 ListView 控件。
index 唯一标识 ListItem 集合成员的整数或字符串。如果为整数,它将是 Index 属性的值;如果为字符串,它将是 Key 属性的值。

Index或者Key都能将表中的关键字作为赋值对象,但要区别是字符型还是数字型,否则很可能报错。一定要匹配,我在此栽过跟头。切忌!!