急求,解决类型不匹配问题
环境:asp(vbscript)+sql2000
代码:
<%
While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))
%>
<%a=Recordset1.Fields.Item("TEAM_CODE").Value%>
<%b=Recordset1.Fields.Item("STAT_DATE").Value%>
<%c=Recordset1.Fields.Item("SEG_CODE").Value%>
<%
exec="insert into BUS_DAYCHECK_BILL(TEAM_CODE,CHK_DATE,SEG_CODE)values('"+a+"','"+b+"','"+c+"')"
conn.execute exec
%>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
Recordset1.MoveNext()
Wend
%>
提示错误:类型不匹配: '[string: "insert into BUS_DAYC"]'
表BUS_DAYCHECK_BILL的几个字段都是varchar,a、b、c对应的字段也是varchar。
请指教!
------解决方案--------------------exec="insert into BUS_DAYCHECK_BILL(TEAM_CODE,CHK_DATE,SEG_CODE)values('"+a+"','"+b+"','"+c+"')")
字符串连接符不是 & 吗?
exec="insert into BUS_DAYCHECK_BILL(TEAM_CODE,CHK_DATE,SEG_CODE)values('" & a & "','" & b & "','" & c & "')")