标题:程序问题----提示“多步OLE DB产生错误,请检查每个OLE DB状态值,没有工 ...
只看楼主
ljyxxzj
Rank: 1
等 级:新手上路
帖 子:29
专家分:0
注 册:2007-10-21
 问题点数:0 回复次数:1 
程序问题----提示“多步OLE DB产生错误,请检查每个OLE DB状态值,没有工作被完成
下面是程序,不知哪错了
Private Sub Command1_Click()
Dim cdia() As Single
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim strcnn As String
strcnn = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\Documents and Settings\Administrator\桌面\软件\djgl.mdb;initial catalog=pubs;user id=sa;password=;"
Set cn = New ADODB.Connection
cn.Open strcnn
Set rs = New ADODB.Recordset
Set DataGrid.DataSource = rs
rs.CursorLocation = adUseClient
rs.CursorType = adOpenKeyset
rs.LockType = adLockOptimistic
Set rs = cn.Execute("select * from 刀具直径")
Do While Not rs.EOF()
For i = 1 To rs.RecordCount
cdia(i) = rs!直径
Next i
Print "cdia(" & i & ")" = cdia(i)
Print
Loop

End Sub
搜索更多相关主题的帖子: OLE 状态 提示 检查 
2007-10-21 15:46
刨子头
Rank: 1
等 级:新手上路
威 望:1
帖 子:319
专家分:0
注 册:2007-9-24
得分:0 
cdia(i) = rs!直径   ?
2007-10-21 16:03



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-179554-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.106555 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved