ALL FRIEND
when the "where" condition is from interface input, (i use access2000, using ADO can connect the access database) , if input one value is empty in database, and my below program will be fault in opening recordset.i know using data feature can find the nomatch record,but not know the way for the ADO feature,pls help me or give me thinking.thanks a lot!
Private Sub Command1_Click()
Call Text1_Click
Call Text2_Click
Call Combo1_Click
MsgBox "you selected cellid is" & cell_id
If cell_id <> "" Then
If start_date <> "" And end_date <> "" Then
conn = "SELECT RECDATE,ASSFAIL,HOFAIL from data where RECDATE between #" & start_date & "# and #" & end_date & "# and CELLID=" & cell_id
grs.Open conn, grc, adOpenKeyset, adLockPessimistic
NumPoints = grs.RecordCount
MsgBox "total records" & NumPoints
Set DataGrid1.DataSource = grs
MSChart1.RandomFill = False
MSChart1.Visible = True
Call MSCHART
MSChart1.FootnoteText = "CELLIDΪ" & cell_id & "µÄÔËÐÐÖÊÁ¿Í¼"
MSChart1.AllowDynamicRotation = True
grs.Close
Else
MsgBox "pls select the start_date and end_date again"
End If
Else
MsgBox "pls select the cellid again"
End If
End Sub
when the "where" condition is from interface input, (i use access2000, using ADO can connect the access database) , if input one value is empty in database, and my below program will be fault in opening recordset.i know using data feature can find the nomatch record,but not know the way for the ADO feature,pls help me or give me thinking.thanks a lot!
Private Sub Command1_Click()
Call Text1_Click
Call Text2_Click
Call Combo1_Click
MsgBox "you selected cellid is" & cell_id
If cell_id <> "" Then
If start_date <> "" And end_date <> "" Then
conn = "SELECT RECDATE,ASSFAIL,HOFAIL from data where RECDATE between #" & start_date & "# and #" & end_date & "# and CELLID=" & cell_id
grs.Open conn, grc, adOpenKeyset, adLockPessimistic
NumPoints = grs.RecordCount
MsgBox "total records" & NumPoints
Set DataGrid1.DataSource = grs
MSChart1.RandomFill = False
MSChart1.Visible = True
Call MSCHART
MSChart1.FootnoteText = "CELLIDΪ" & cell_id & "µÄÔËÐÐÖÊÁ¿Í¼"
MSChart1.AllowDynamicRotation = True
grs.Close
Else
MsgBox "pls select the start_date and end_date again"
End If
Else
MsgBox "pls select the cellid again"
End If
End Sub
全站熱搜
留言列表