SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseSQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old April 13th, 2004, 05:13 PM
plasma800 plasma800 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: Houston
Posts: 407 plasma800 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 12 h 13 m 36 sec
Reputation Power: 5
Send a message via Yahoo to plasma800
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

Reply With Quote
  #2  
Old April 14th, 2004, 01:16 PM
plasma800 plasma800 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: Houston
Posts: 407 plasma800 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 12 h 13 m 36 sec
Reputation Power: 5
Send a message via Yahoo to plasma800
anyone.. bueler..bueler...

Reply With Quote
  #3  
Old April 14th, 2004, 01:24 PM
Memnoch's Avatar
Memnoch Memnoch is offline
Unholy Moderator
ASP Free God 14th Plane (11500 - 11999 posts)
 
Join Date: Oct 2003
Location: In hell, where did you think?
Posts: 11,776 Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 3 Weeks 5 Days 8 h 27 m 42 sec
Reputation Power: 470
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)

Reply With Quote
  #4  
Old April 14th, 2004, 01:35 PM
plasma800 plasma800 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: Houston
Posts: 407 plasma800 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 12 h 13 m 36 sec
Reputation Power: 5
Send a message via Yahoo to plasma800
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.

Reply With Quote
  #5  
Old April 14th, 2004, 02:06 PM
Memnoch's Avatar
Memnoch Memnoch is offline
Unholy Moderator
ASP Free God 14th Plane (11500 - 11999 posts)
 
Join Date: Oct 2003
Location: In hell, where did you think?
Posts: 11,776 Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 3 Weeks 5 Days 8 h 27 m 42 sec
Reputation Power: 470
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

Reply With Quote
  #6  
Old April 14th, 2004, 03:58 PM
plasma800 plasma800 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: Houston
Posts: 407 plasma800 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 12 h 13 m 36 sec
Reputation Power: 5
Send a message via Yahoo to plasma800
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!

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseSQL Development > grrrr.. why is this update command po'd


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT