简体   繁体   中英

Microsoft OLE DB Provider for ODBC Drivers error '80040e07'

Oké this one will probably be verry obvious but after 3 days looking at the same block of code to find the mistake i start loosing my mind over it.

Below 2 blocks of code. The 1st one works like a charm but the second one although i assume it's correctly coded keeps giving me issues.

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)

Now the second block which is driving me to complete madness by now.

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)

the stored procedure which is called to insert the data is working fine so it has to be something at ASP level.

Does anyone has an suggestion to this weirdness before i start chewing on my keyboard?

In addition: I either get an varchar to int conversion error or when fiddling with the ' in one of the last 3 int fields before dtlokationAdded i get an syntax error near (depending on the by fiddling affected field)

Assuming all fields that starts with int are numeric (Except intLastChangedBy , which in the previous block is enclosed in quotes; if it is, remove that quote too):

SQL = "EXECUTE sp_AddLokation '" &_
chrLokationName & "','" &_
chrLokationStreet & "','" &_
chrLokationCity & "','" &_
chrLokationCountry & "','" &_
chrLokationSNumber & "','" &_
chrLocationZipcode & "','" &_
chrLokationPhone & "','" &_
chrLokationFax & "','" &_
chrLokationEmail & "','" &_
chrLokationWebsite & "'," &_
intLokationTypeID & "," &_
intMultiArea & "," &_
intLokationStatusID & ",'" &_
dtLokationAdded & "','" &_
dtLokationChanged & "','" &_
intLastChangedBy & "'"
intLokationTypeID & "'," &_

Well, I noticed here you have a set of quotation marks but only one apostraphe... that could be causing an error? Or, wait, I think I see where you closed it. (couple lines down, sorry!)

Ok, thanks all for trying to help me out here!

It seems my issue is resolved. It must be code-midgets who payed me a visit last night. Other than that i can't explain what just happened. Cause when i left the project yesterday it sure as hell wasn't working at all.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM