带原代码请教 vb+access问题?
Private Sub line(ByRef X1 As Long, ByRef X2 As Long, ByRef Y1 As Long, ByRef Y2 As Long, ByRef id As Integer)Dim strsql As String
Dim i As Integer
Dim j As Integer
Dim count As Integer
Dim rsrecord As Recordset
Dim ii As Integer
On Error Resume Next
Set dbdao = DBEngine.Workspaces(0).OpenDatabase(App.Path & "\lddatabase.mdb") '打开数据库
strsql = "select * from line" & " order by address"
Set rsrecord = dbdao.OpenRecordset(strsql)
If rsrecord.RecordCount > 0 Then
For i = 1 To TreeView1.Nodes.count - 2
rsrecord.MoveFirst
For j = 1 To rsrecord.RecordCount
If TreeView1.Nodes(TreeIndex).Index = rsrecord.Fields("address") Then
'
X1 = rsrecord.Fields("x1")
X2 = rsrecord.Fields("x2")
Y1 = rsrecord.Fields("y1")
Y2 = rsrecord.Fields("y2")
'//////////////////////////////////////////////////
Lin(j - 1).X1 = X1
Lin(j - 1).X2 = X2
Lin(j - 1).Y1 = Y1
Lin(j - 1).Y2 = Y2
Lin(j - 1).Visible = True
rsrecord.MoveNext
Else
Lin(j - 1).Visible = False
rsrecord.MoveNext
End If
Next j
If rsrecord.EOF Then rsrecord.MoveLast
Set rsrecord = Nothing
Next i
End If
On Error GoTo 0
请教,帮我看下数据库指针第一条和下移语句以及数据库判断是否正确.在运行时怎么感觉数据库记录没有下移.
先谢谢.在线等候!