看一下这条语句

doudoushen 2003-05-08 08:28:23
Private adors As ADODB.Recordset
Private adoconn As ADODB.Connection
Private cstring As String

Private Sub Command1_Click()
cstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\1.mdb;Persist Security Info=False"
adoconn.Open cstring
adors.Open "zuozhe", cstring, 3, 3
adoconn.Execute "select * from zuozhe order by nianling" 不执行
adors.MoveFirst
Do While Not adors.EOF
Debug.Print adors.Fields("nianling").Value
adors.MoveNext
Loop
adors.Close
end sub

Private Sub Form_Load()
Set adors = New ADODB.Recordset
Set adoconn = New ADODB.Connection
End Sub


为什么adoconn.execute总是不执行呢 怎么才让adoconn.execute执行
...全文
16 点赞 收藏 12
写回复
12 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
Mars.CN 2003-05-09
错了
没有显示代码!!

E-mail:suolong@sjzsoft.com
回复
doudoushen 2003-05-09
to smileskynet
我只是想索引一下 然后看一下索引结果
另外用set adors=adocnn.execute "select * form zuozhe order by nianling"
替代adoconn.Execute "select * from zuozhe order by nianling" 总说没有对象这是为什么???
回复
SmileSkyNet 2003-05-09
adoconn.Execute "select * from zuozhe order by nianling"这句好象没有什么意思呀?,你在程序中没有用到它
回复
kingcom:我操死你妈!不要以为只有你会用马甲!我也会!不要以为你多牛,我鼠标一点就封了你!
回复
doudoushen 2003-05-08
怎么每人回答啊
回复
doudoushen 2003-05-08
为什么 用set adors=adocnn.execute "select * form zuozhe order by nianling"
替代adoconn.Execute "select * from zuozhe order by nianling" 总说没有对象啊
回复
dongyoushen 2003-05-08
Debug.Print adors("nianling")
回复
dongyoushen 2003-05-08
set adors=adocnn.execute "select * form zuozhe order by nianling"
回复
doudoushen 2003-05-08
qiangsheng(立足中原辐射西北)
怎么让我看到我的结果呢
dongyoushen(东
其实我知道你的方法就是想用adoconn.execute的方法 能帮帮我吗 谢谢
回复
spland 2003-05-08
樓上的是一種做法
Set adors = adoconn.Execute "select * from zuozhe order by nianling"
也可以
回复
dongyoushen 2003-05-08
在网吧,没测试,这样简单些,试一试
Private adors As ADODB.Recordset
Private adoconn As ADODB.Connection

Private Sub Command1_Click()
with adoconn
.Provider=Microsoft.Jet.OLEDB.4.0
.Source=C:\1.mdb
end with
adors.open "select * from zuozhe order by nianling",adoconn,3,3
adors.MoveFirst
Do While Not adors.EOF
Debug.Print adors.Fields("nianling").Value
adors.MoveNext
Loop
adors.Close
end sub

Private Sub Form_Load()
Set adors = New ADODB.Recordset
Set adoconn = New ADODB.Connection
End Sub
回复
qiangsheng 2003-05-08
就算它执行了,你的程序里也没有显示它执行结果的代码呀。
回复
相关推荐
发帖
VB基础类
创建于2007-09-28

7492

社区成员

VB 基础类
申请成为版主
帖子事件
创建了帖子
2003-05-08 08:28
社区公告
暂无公告