Private Function DataDelCheck1() As Boolean '检测数据删除的合法性函数,合法返回值为True.
DataDelCheck1 = False
Dim M As Integer
Dim SQL As String
SQL = "" & vbCrLf
SQL = SQL & " SELECT * " & vbCrLf
SQL = SQL & " FROM 基金" & vbCrLf
If rc.State = 1 Then rc.Close
rc.Open SQL, Cnndb, 3, 2
If rc.RecordCount > 0 Then
Dim DelSQL As String
DelSQL = ""
If txtuser1.Text <> "" Then DelSQL = DelSQL & " and 用户 = '" & Trim(txtuser1.Text) & "'"
If txtcode1.Text <> "" Then DelSQL = DelSQL & " and 基金代码 ='" & Trim(txtcode1.Text) & "'"
If txtname1.Text <> "" Then DelSQL = DelSQL & " and 基金简称 ='" & Trim(txtname1.Text) & "'"
If Commode1.Text <> "" Then DelSQL = DelSQL & " and 类型 = '" & Trim(Commode1.Text) & "'"
If txtprice1.Text <> "" Then DelSQL = DelSQL & " and 价格 = " & Trim(txtprice1.Text) & ""
If txtnum1.Text <> "" Then DelSQL = DelSQL & " and 数量 = '" & Trim(txtnum1.Text) & "'"
If Dbuy1.Value <> Dbuy1.MaxDate Then DelSQL = DelSQL & " and 买入日期 = # " & Dbuy1.Value & " # "
If txtman1.Text <> "" Then DelSQL = DelSQL & " and 基金管理人 = '" & Trim(txtman1.Text) & "'"
If DelSQL <> "" Then
DelSQL = " select * from 基金 where key1 <>'' " & DelSQL
If rc.State = 1 Then rc.Close
rc.Open DelSQL, Cnndb, 3, 2
If rc.EOF Then
M = MsgBox("查无此记录", vbInformation)
Exit Function
Else
Call DataFresh1(DelSQL)
End If
Else
M = MsgBox("请输入条件", vbInformation)
Exit Function
End If
End If
DataDelCheck1 = True
End Function
除了价格是single 买入日期是date 其它都是textrc.Open DelSQL, Cnndb, 3, 2 错误2147217913(80040e07)标准表达式中数据类型不匹配?
DataDelCheck1 = False
Dim M As Integer
Dim SQL As String
SQL = "" & vbCrLf
SQL = SQL & " SELECT * " & vbCrLf
SQL = SQL & " FROM 基金" & vbCrLf
If rc.State = 1 Then rc.Close
rc.Open SQL, Cnndb, 3, 2
If rc.RecordCount > 0 Then
Dim DelSQL As String
DelSQL = ""
If txtuser1.Text <> "" Then DelSQL = DelSQL & " and 用户 = '" & Trim(txtuser1.Text) & "'"
If txtcode1.Text <> "" Then DelSQL = DelSQL & " and 基金代码 ='" & Trim(txtcode1.Text) & "'"
If txtname1.Text <> "" Then DelSQL = DelSQL & " and 基金简称 ='" & Trim(txtname1.Text) & "'"
If Commode1.Text <> "" Then DelSQL = DelSQL & " and 类型 = '" & Trim(Commode1.Text) & "'"
If txtprice1.Text <> "" Then DelSQL = DelSQL & " and 价格 = " & Trim(txtprice1.Text) & ""
If txtnum1.Text <> "" Then DelSQL = DelSQL & " and 数量 = '" & Trim(txtnum1.Text) & "'"
If Dbuy1.Value <> Dbuy1.MaxDate Then DelSQL = DelSQL & " and 买入日期 = # " & Dbuy1.Value & " # "
If txtman1.Text <> "" Then DelSQL = DelSQL & " and 基金管理人 = '" & Trim(txtman1.Text) & "'"
If DelSQL <> "" Then
DelSQL = " select * from 基金 where key1 <>'' " & DelSQL
If rc.State = 1 Then rc.Close
rc.Open DelSQL, Cnndb, 3, 2
If rc.EOF Then
M = MsgBox("查无此记录", vbInformation)
Exit Function
Else
Call DataFresh1(DelSQL)
End If
Else
M = MsgBox("请输入条件", vbInformation)
Exit Function
End If
End If
DataDelCheck1 = True
End Function
除了价格是single 买入日期是date 其它都是textrc.Open DelSQL, Cnndb, 3, 2 错误2147217913(80040e07)标准表达式中数据类型不匹配?
解决方案 »
- VB Command default,cancel属性怎么用?
- vb 判断图片是否损坏
- 我想在richtextbox输出的报告中根据一个RETCODE = ???判断结果是否正确,怎么做啊?请高手指教1!!
- treeview控件加载速度很慢,如何解决?
- 请问如何加载webbrowser控件?
- List控件的如何出现提示文本
- 关于vb窗体的一个问题
- 发现了VB里的一个API“GetWindowsDirectory” 的BUG
- ado recordset addnew语法怎么使用,主要是带的参数不太明白.求助!!
- 关于SQL .Open "SELECT * FROM [My document]", , , , adCmdTable
- 取INI的时候遇到的问题,急,在线等!!
- 怎样随机批量生成用户数据
在ACCESS里面用的#
SQL里面直接使用''好象
在ACCESS里面用的#
SQL里面直接使用''
sql="select * from dengji where datetime='"& datetime &"'"
DelSQL = " select * from 基金 where key1 <>'' " & DelSQL
key1<>NULL是错的,应该是key1<>0