|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
grrrr.. why is this update command po'd
Error IS:
Microsoft OLE DB Provider for SQL Server error '80040e14' There are fewer columns in the INSERT statement than values specified in the VALUES clause. The number of values in the VALUES clause must match the number of columns specified in the INSERT statement. /vendor/select_parts_proc.asp, line 69 Code:
SQL = "INSERT INTO ttInventory (prodID, vendorID, newprice, refurbprice, oosprice, venddescrip) "
SQL = SQL & "VALUES ("&CInt(prodID)&", "&CInt(loggedin)&", "&ReplaceQuotes(FormatCurrency(newPrice))& ", "&ReplaceQuotes(FormatCurrency(rfPrice))&", "&ReplaceQuotes(FormatCurrency(oosPrice))&", '"&ReplaceQuotes(note)& "')"
objCn.Execute SQL ' LINE 69
|
|
#2
|
|||
|
|||
|
anyone.. bueler..bueler...
|
|
#3
|
||||
|
||||
|
1) You don't need to use CInt, if the variable isn't surrounded by (') single quotes, the database automatically assumes it is a number.
2) Don't use FormatCurrency when inserting the data, it won't work. try this Code:
strSql = "INSERT INTO ttInventory(prodID, vendorID, newprice, refurbprice, oosprice, venddescrip) VALUES(" & prodID & ", " & loggedin & ", " & newPrice & ", " & rfPrice & ", " & oosPrice & ", '" & ReplaceQuotes(note) & "')"
objCn.Execute(strSql)
|
|
#4
|
|||
|
|||
|
Ok,
got that.. if I dont use the formatcurrency, it tells me type mismatch as im inserting a variable into a money field... and the CInt stuff, is a variable being shoved into a INT field of SQL 7. I have an UPDATE sql command, formatted the same ways, and it works fine... but i can't figure that other error out.. ill try it your way and see what happens mem. |
|
#5
|
||||
|
||||
|
I just did a sample test on inserting an amount into a money field in sql server, and didn't have any problems.
This is what I did Code:
<%
if(request.Form("Submit") <> "") then
amount = Request.Form("amount")
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "Driver={SQL SERVER};Server=(local);UID=xxx;PWD=xxx;DATABASE=Te st;"
strSql = "INSERT INTO Table1 VALUES(" & amount & ")"
Conn.Execute(strSql)
Conn.Close
End if
%>
<form name="form1" method="post" action="test6.asp">
<input name="amount" type="text"><br><br>
<input type="submit" name="Submit" value="Submit">
</form>
It worked fine, the amount I entered was 12.37 |
|
#6
|
|||
|
|||
|
Ur right brother.. i took all that crap out.. and it worked just fine. I hate it when i waste your time like that! sorry
but thank you so much for the direction either way. Ur my hero! |
![]() |
| Viewing: ASP Free Forums > Database > SQL Development > grrrr.. why is this update command po'd |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|