程序问题----提示“多步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)
Loop
End Sub