473,396 Members | 1,792 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

I get "number of supplied values does not match" after I add a clolumn.

101 100+
Here's what my code looks like:
=======================================
Set RS = Server.CreateObject("ADODB.Recordset")
RS.Open "Table", objConn, 1, 3, 2

If Len(Request.Form("AreaID1")) > 0 Then
RS("AreaID1") = Request.Form("AreaID1")
End If

If Len(Request.Form("AreaID2")) > 0 Then
RS("AreaID2") = Request.Form("AreaID2")
End If

RS.Update
=======================================
The code works perfectly, but when I add a column to the table, I get this error:
"Insert Error: Column name or number of supplied values does not match table definition."
If I drop the column, the script works again.

I think it's a problem of the number of supplied values. I don't think it matters if some of the columns are null (IE, I shouldn't have to change my script for adding a new column). But, I've just started using asp a little while ago, so I'm not sure of anything.

Could it have something to do with stored proceedures?
May 17 '07 #1
4 5743
jhardman
3,406 Expert 2GB
The code works perfectly, but when I add a column to the table, I get this error:
"Insert Error: Column name or number of supplied values does not match table definition."
If I drop the column, the script works again.
Are you adding a coulmn using some sql statement in an asp? If you are, I would not recommend it. I would definitely use a db manager to add the column. ASP is not designed to be a db manager.

Or are you saying you added a column in a db manager then when you tried to run the same snippet of code in your asp that used to work, it gives you an error? If that is the case, check to make sure the new column only needs to be filled optionally. If the new column is required and you update without giving a value for that field you will get this error.

Or are you saying that you add the column and use a script like this but also including data for the third field? If that is the case, can you show your code?

Jared
May 17 '07 #2
zensunni
101 100+
"Are you adding a coulmn using some sql statement in an asp? If you are, I would not recommend it. I would definitely use a db manager to add the column. ASP is not designed to be a db manager."

Yes, I'm using asp to add a column. I can't help it. I'm working remotely and I don't get access to the DB directly. Could that be causing any problems? What should I check for if so? The script that uses the table is separate from the one that adds a column.

"If that is the case, check to make sure the new column only needs to be filled optionally. If the new column is required and you update without giving a value for that field you will get this error."

When you add a column using an sql statement in asp and don't specify any constraints, it shouldn't default to "NOT NULL", should it?

"Or are you saying that you add the column and use a script like this but also including data for the third field? If that is the case, can you show your code?"

I have tried including data for the third field with the same error. I'll post my code tomorrow.

Thanks again for the help.
May 18 '07 #3
zensunni
101 100+
Here is my code...
================================================== ===

Set RSCorpIdentity = Server.CreateObject("ADODB.Recordset")
RSCorpIdentity.Open "CorporateIdentity", objConn, 1, 3, 2

CorpID = Request.Form("Update")
'Response.Write "<br>CorpID: " & CorpID
If Len(CorpID) > 0 Then
Update = 1
FBFilter = "ID = " & CorpID
RSCorpIdentity.Filter = FBFilter
Else
RSCorpIdentity.AddNew
End If

If Len(Request.Form("Referrer")) > 0 Then
RSCorpIdentity("Referrer") = Trim(Request.Form("Referrer"))
Else
RSCorpIdentity("Referrer") = 0
End If

If Len(Request.Form("FLCityID")) > 0 Then
RSCorpIdentity("FLCityID") = Request.Form("FLCityID")
End If

If Len(Request.Form("Webdisplay")) > 0 Then
RSCorpIdentity("Webdisplay") = Request.Form("Webdisplay")
End If

RSCorpIdentity.Update
May 20 '07 #4
zensunni
101 100+
Is there ever a case where the table can go out of sync with it's table definition?
May 20 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: kmunderwood | last post by:
I am trying to combine "if match=" and "when test" I am a newbie, and have made both work separately, but I can not seem to combine them. This is my xml("index.xml")page(I can not change this,...
16
by: John Baker | last post by:
Hi: I know this is a strange question, but I have inherited a system where files are copied and records re auto numbered (as an index field) )frequently, and I am wondering how high the number...
1
by: CA | last post by:
I am having a problem getting a pointer to an existing running Excel process on a client machine. Here are some details: 1) I have tested out the code on the development machine and it works...
5
by: Jeffrey Bradshaw | last post by:
Hey everybody, I've got a VB.NET program that is trying to access a Word document and I'm having all kinds of trouble. First on is the above. I'm trying to get the number of lines in the document...
2
by: Tom | last post by:
I'm getting this error when I try to pass a structure to a dll. An unhandled exception of type 'System.ArgumentException' occured in Test1.exe Additional Information: Type could not be marshaled...
1
by: myth.drannon | last post by:
Hi , I'm trying to find a simple solution to this question.. ( not just making two match parts) I have <xsl:template match=" one | two " > and then I want to test what match I have and do...
32
by: Licheng Fang | last post by:
Basically, the problem is this: 'do' Python's NFA regexp engine trys only the first option, and happily rests on that. There's another example: 'oneself' The Python regular expression...
1
by: Ducknut | last post by:
Not so much a problem as a discussion. I am currently in the early stages of designing a database to hold a bunch of water quality data (e.g., concentrations of heavy metals in drinking water). Water...
1
by: Pythor | last post by:
OK I'm trying to create a sql query on our as400. I have a main table like this: acct prf acct no. sku AAA 123 ABCD AAA 123 XYZ I have...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.