|
你好
我有一个技术问题请教你可以吗
如果可以我的手机13901948178;邮箱hk59621@sohu.com ;QQ号是437570859
我就住在仓源路,到你那比较方便
是用VB6.0编写的数据库转换程序
数据库是Access97数据库做的程序
我的目前使用的电脑是Office
Access2007
无当前记录
运行错误‘3021’
帮助:
无当前记录。(错误 3021)
当底层的 Recordset 没有记录或记录己经被删除时,使用 Find 或 Seek 方法应用程序失败之后,会出现这个错误。选择或移动到另一条记录,然后重试一次。如果 Recordset 是空的,不能设置当前记录。请检查 BOF 及 EOF 属性。
部分代码如下
If mskStartDate.Text = "____-__-__" Or mskEndDate = "____-__-__" Then
MsgBox "time!"
mskStartDate.SetFocus
Exit Sub
End If
If rcZQ.RecordCount > 0 Then
rcZQ.MoveLast
rcZQ.MoveFirst
For i = 1 To rcZQ.RecordCount
rcZQ.Delete
rcZQ.MoveNext
Next i
End If
'
If Data1.Recordset.Fields(0).Value <> "ABCDEF14" And Data1.Recordset.Fields(0).Value <> "ABCDEF15" Then
sProductID = Data1.Recordset.Fields(0).Value
sProductName = Data1.Recordset.Fields(1).Value
'
End If
bFindResult = False
datBrowse.Recordset.MoveFirst
Do Until datBrowse.Recordset.EOF
If datBrowse.Recordset("fzqdm") = sProductID Then
bFindResult = True
rcZQ.AddNew
rcZQ!zqdm = datBrowse.Recordset("fzqdm")
rcZQ!ZQMC = sProductName
rcZQ!Date = datBrowse.Recordset("fdate")
rcZQ.Update
End If
datBrowse.Recordset.MoveNext
Loop
datBrowse.Recordset.MoveFirst
rs.MoveFirst
Do While Not rs.EOF And rs!ZQMC <> sProductName
rs.MoveNext
Loop
If rs.EOF Then
Answer = MsgBox("Match product not found.", vbOKOnly)
Else
Me.MousePointer = 11
If mskStartDate.ClipText = "" Or mskEndDate.ClipText = "" Then
MsgBox "date is null"
mskStartDate.SetFocus
Me.MousePointer = 0
Exit Sub
End If
StartDate = CDate(mskStartDate)
EndDate = CDate(mskEndDate)
DayNumber = EndDate - StartDate + 1
rcZQ.MoveLast
rcZQ.MoveFirst
For i = 1 To rcZQ.RecordCount
If rcZQ!Date > EndDate Then
rcZQ.Delete
End If
Next i
If rcZQ.RecordCount = 0 Then
MsgBox "No Record!"
Me.MousePointer = 0
cmdOk(0).Enabled = False
cmdPrint(1).Enabled = False
Exit Sub
End If
ReDim DayFor1(1 To DayNumber) As Date
ReDim opDate(1 To rcZQ.RecordCount, 1 To DayNumber) As Long
ReDim opDateID(1 To rcZQ.RecordCount, 1 To DayNumber) As Long
'日
For i = 1 To (rcZQ.RecordCount)
opDate(i, 1) = StartDate - CDate(rcZQ("date"))
If StartDate >= CDate(rcZQ("date")) Then
For j = 1 To DayNumber
opDate(i, j) = opDate(i, 1) + j - 1
Next j
|
|