VB6.0连接数据库问题,运行错误3709。 5
PublicSubupdata()DimcnnAsNewADODB.ConnectionDimrsAsNewADODB.Recordsetcnn.Open"Provide...
Public Sub updata()
Dim cnn As New ADODB.Connection
Dim rs As New ADODB.Recordset
cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\access\tycs.mdb"
rs.Open "select * from YJCS , cnn, adOpenKeyset, adLockOptimistic"
(调试显示上面这个位置出错)
re.MoveFirst
Do While Not rs.EOF
X11 = rs.Fields("X1")
Y11 = rs.Fields("Y1")
lx = rs.Fields("TYPE")
Select Case lx
Case 1
Call byq(X11, Y11, 1, 1, False)
Case 2
Call dy(X11, Y11, 1, False)
End Select
Loop
rs.Close
End Sub
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim x1 As Integer
Dim x2 As Integer
Dim y1 As Integer
Dim y2 As Integer
If moveflag = ture Then
Dim cnn As New ADODB.Connection
Dim rs As New ADODB.Recordset
x1 = x2: y1 = y2
cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\access\tycs.mdb"
rs.Open "select * from YJCS ", cnn, adOpenKeyset, adLockOptimistic
xnow = rs.Fields("X1")
ynow = rs.Fields("Y1")
rs.Fields("X1") = xnow + x2 - x1
rs.Fields("Y1") = ynow + y2 - y1
x2 = X: y2 = Y
rs.Update
rs.Close
Picture1.Cls
Call updata
End If
End Sub 展开
Dim cnn As New ADODB.Connection
Dim rs As New ADODB.Recordset
cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\access\tycs.mdb"
rs.Open "select * from YJCS , cnn, adOpenKeyset, adLockOptimistic"
(调试显示上面这个位置出错)
re.MoveFirst
Do While Not rs.EOF
X11 = rs.Fields("X1")
Y11 = rs.Fields("Y1")
lx = rs.Fields("TYPE")
Select Case lx
Case 1
Call byq(X11, Y11, 1, 1, False)
Case 2
Call dy(X11, Y11, 1, False)
End Select
Loop
rs.Close
End Sub
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim x1 As Integer
Dim x2 As Integer
Dim y1 As Integer
Dim y2 As Integer
If moveflag = ture Then
Dim cnn As New ADODB.Connection
Dim rs As New ADODB.Recordset
x1 = x2: y1 = y2
cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\access\tycs.mdb"
rs.Open "select * from YJCS ", cnn, adOpenKeyset, adLockOptimistic
xnow = rs.Fields("X1")
ynow = rs.Fields("Y1")
rs.Fields("X1") = xnow + x2 - x1
rs.Fields("Y1") = ynow + y2 - y1
x2 = X: y2 = Y
rs.Update
rs.Close
Picture1.Cls
Call updata
End If
End Sub 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询