VB adodc 如何 获取 指定记录(ID或者某字段值(唯一)) 的指定字段的值?

2024-11-13 09:42:07
推荐回答(1个)
回答1:

Dim DataConnectString
DataConnectString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + 文件路径 + ";Persist Security Info=False" + ";Jet OLEDB:Database Password=prowind"
Adodc1.ConnectionString = DataConnectString
SQL = "Select * From 表名 Where ID=" & "'" & Trim(id) & "'"
Adodc1.RecordSource = SQL
Adodc1.Refresh
Label1.Caption = Adodc1.Recordset.Fields("字段名")
Adodc1.Recordset.MoveNext