好吧,这可能会非常明显,但是在查看相同的代码块 3 天后,我开始对它失去理智。
下面2个代码块。第一个像魅力一样工作,但第二个虽然我认为它的编码正确,但一直给我带来问题。
SQL = "EXECUTE sp_AddEvent '" &_
chrEventName & "','" &_
chrEventManager & "','" &_
chrEventAssistant & "','" &_
txtEventDescr & "','" &_
intEventTypeID & "'," &_
intEventCatagoryID & "," &_
intIncomeModelID & "," &_
intEventStatusID & ",'" &_
dtEventStart & "','" &_
dtEventEnd & "','" &_
intMultiArea & "'," &_
intMultiLokation & "," &_
intMultiDay & ",'" &_
dtEventAdded & "','" &_
dtEventChanged & "','" &_
intEventLastChangedBy & "'"
' Executing Insert statement.
SET rsAddEvent = someconnection.EXECUTE(SQL)
现在是第二块让我现在完全发疯了。
SQL = "EXECUTE sp_AddLokation '" &_
chrLokationName & "','" &_
chrLokationStreet & "','" &_
chrLokationCity & "','" &_
chrLokationCountry & "','" &_
chrLokationSNumber & "','" &_
chrLocationZipcode & "','" &_
chrLokationPhone & "','" &_
chrLokationFax & "','" &_
chrLokationEmail & "','" &_
chrLokationWebsite & "','" &_
intLokationTypeID & "'," &_
intMultiArea & "," &_
intLokationStatusID & ",'" &_
dtLokationAdded & "','" &_
dtLokationChanged & "','" &_
intLastChangedBy & "'"
' Executing Insert statement.
SET rsAddLokation = someconnection.EXECUTE(SQL)
被调用来插入数据的存储过程工作正常,所以它必须是 ASP 级别的东西。
在我开始咀嚼键盘之前,有人对这种怪异有什么建议吗?
另外:我要么得到一个 varchar 到 int 的转换错误,要么在 dtlokationAdded 之前的最后 3 个 int 字段之一中摆弄 ' 时我得到一个语法错误附近(取决于通过摆弄受影响的字段)