adodc控件如何使用? 我想连接到excel文件,请问如何设置adodc控件的属性?然后一些简要的查询如何操作?就像excel中的find函数一样,如何查找数据?有例子更好了.谢谢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 是不是可以考虑adodb对象?简单方便 sql = "select * from [SheetLabelName$]" With Adodc .ConnectionString = "provider=microsoft.jet.oledb.4.0;persist security info=false;" & _ "data source=" & PathName & ";extended properties='" & _ "excel 8.0;hdr=yes'" .CommandType = adCmdText .RecordSource = sql .Refresh End With只是ConnectionString与连接数据库有所不同,其它操作一样的 二、利用adodc(ADO Data Control)进行数据库链接:private form_load ()Dim str As String '定义str = App.PathIf Right(str, 1) <> "\" Thenstr = str + "\"End Ifstr = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=" & str & "\tsl.mdb"Adodc1.ConnectionString = strAdodc1.CommandType = adCmdTextAdodc1.RecordSource = "select * from table3"Adodc1.Refreshend sub http://shareware.4urneed.com/VB/vb-3.htm http://taoyuan.webhostme.com/download/ http://www.easywise.com/learn/programme/less003vb.htm 用VBS如何判断并杀掉进程和启动程序 vb二级考试填空题,高手指点! 关于VB数字金字塔之我见 非常弱的问题 问一个特难的问题,在windows下怎么编程卸载优盘 如何判断WEBBROWSER时候还可以GOBACK? 编程爱好者网站 http://www.programfan.net 软件价钱问题?(急,在线等) AxtiveX控件的设置问题? 红帽安装请教 从何处可以查“Automation错误”的说明 winsock10054错误,连接由远程端重新设置?
简单方便
With Adodc
.ConnectionString = "provider=microsoft.jet.oledb.4.0;persist security info=false;" & _
"data source=" & PathName & ";extended properties='" & _
"excel 8.0;hdr=yes'"
.CommandType = adCmdText
.RecordSource = sql
.Refresh
End With
只是ConnectionString与连接数据库有所不同,其它操作一样的
private form_load ()
Dim str As String '定义
str = App.Path
If Right(str, 1) <> "\" Then
str = str + "\"
End If
str = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=" & str & "\tsl.mdb"
Adodc1.ConnectionString = str
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select * from table3"
Adodc1.Refresh
end sub