vb 提示:日期语法错误,大家快来帮帮忙
找了好久,实在找不到哪不对,这是一个窗口的代码VB提示:日期语法错误,在查询表达式'应还日期=#2014/5/16星期五#'中
源代码:
Private Sub Command1_Click()
frmmain.Timer1.Enabled = False
Unload Me
End Sub
Private Sub Command2_Click()
Adodc1.RecordSource = "select * from dzjstb where 应还日期<" & Chr(35) & DT1 & Chr(35) & ""
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
Set DataGrid1.DataSource = Adodc1
DataGrid1.Refresh
End If
Adodc2.RecordSource = "select * from dzjstb where 应还日期=" & Chr(35) & DT1 & Chr(35) & ""
Adodc2.Refresh
If Adodc2.Recordset.RecordCount > 0 Then
Set DataGrid2.DataSource = Adodc2
DataGrid2.Refresh
End If
End Sub
Private Sub DataGrid1_Error(ByVal DataError As Integer, Response As Integer)
Response = 0
End Sub
Private Sub DataGrid2_Click()
End Sub
Private Sub DT1_Change()
Adodc1.RecordSource = "select * from dzjstb where 应还日期= " & Chr(35) & DT1 & Chr(35) & ""
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
DataGrid1.Refresh
End If
Adodc2.RecordSource = "select * from dzjstb where 应还日期 =" & Chr(35) & DT1 & Chr(35) & ""
Adodc2.Refresh
If Adodc2.Recordset.RecordCount > 0 Then
DataGrid2.Refresh
End If
End Sub
Private Sub Form_Activate()
Adodc1.ConnectionString = cnn.ConnectionString
Adodc2.ConnectionString = cnn.ConnectionString
Adodc1.RecordSource = "select * from dzjstb where 应还日期 =" & Chr(35) & DT1 & Chr(35) & ""
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
Set DataGrid1.DataSource = Adodc1
DataGrid1.Refresh
End If
Adodc2.RecordSource = "select * from dzjstb where 应还日期 =" & Chr(35) & DT1 & Chr(35) & ""
Adodc2.Refresh
If Adodc2.Recordset.RecordCount > 0 Then
Set DataGrid2.DataSource = Adodc2
DataGrid2.Refresh
End If
End Sub
Private Sub Form_Load()
DT1.Value = Date
Me.Caption = Me.Caption & " " & frmmain.StatusBar1.Panels(2).Text
End Sub
Private Sub SSTab1_DblClick()
End Sub