主题:类型不匹配如何破
Dim dte As Date
Dim area As Integer
Dim loc As Long
Dim dep As String
Dim dev As String
Dim name As String
Dim ip As String
area = CInt(Trim(Combo1.Text))
loc = CLng(Trim(Combo2.Text))
dep = Chr(Trim(Combo3.Text))
dev = Chr(Trim(Combo4.Text))
name = Chr(Trim(Text1.Text))
ip = Chr(Trim(Combo5.Text))
dte = DateValue(Format(Now, "yyyy.mm.dd"))
Set DB = New ADODB.Connection
Set rs = New ADODB.Recordset
DB.ConnectionString = "Provider=MSDASQL.1;Persist Security Info=False;User ID=report/report;Extended Properties=DRIVER={Microsoft ODBC for Oracle};UID=report/report;SERVER=lzerp;"
DB.Open
rs.CursorLocation = adUseClient
rs.Open "update ip_address set area_no=" & area & ",location=" & loc & ",dept='" & dep & "',device_name='" & dev & "',name='" & name & "',create_date='" & dte & "',flag=1 where ip='" & ip & "' and flag=0", DB, 1, 4
Dim area As Integer
Dim loc As Long
Dim dep As String
Dim dev As String
Dim name As String
Dim ip As String
area = CInt(Trim(Combo1.Text))
loc = CLng(Trim(Combo2.Text))
dep = Chr(Trim(Combo3.Text))
dev = Chr(Trim(Combo4.Text))
name = Chr(Trim(Text1.Text))
ip = Chr(Trim(Combo5.Text))
dte = DateValue(Format(Now, "yyyy.mm.dd"))
Set DB = New ADODB.Connection
Set rs = New ADODB.Recordset
DB.ConnectionString = "Provider=MSDASQL.1;Persist Security Info=False;User ID=report/report;Extended Properties=DRIVER={Microsoft ODBC for Oracle};UID=report/report;SERVER=lzerp;"
DB.Open
rs.CursorLocation = adUseClient
rs.Open "update ip_address set area_no=" & area & ",location=" & loc & ",dept='" & dep & "',device_name='" & dev & "',name='" & name & "',create_date='" & dte & "',flag=1 where ip='" & ip & "' and flag=0", DB, 1, 4
MsgBox "!", vbOKOnly, ""
这段在有些电脑上执行报错提示类型不匹配,有些电脑上执行没问题,哪位高手给指导一下