473,654 Members | 2,968 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

101 New Member
Here's what my code looks like:
=============== =============== =========
Set RS = Server.CreateOb ject("ADODB.Rec ordset")
RS.Open "Table", objConn, 1, 3, 2

If Len(Request.For m("AreaID1")) > 0 Then
RS("AreaID1") = Request.Form("A reaID1")
End If

If Len(Request.For m("AreaID2")) > 0 Then
RS("AreaID2") = Request.Form("A reaID2")
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 5746
jhardman
3,406 Recognized Expert Specialist
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 New Member
"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 New Member
Here is my code...
=============== =============== =============== ========

Set RSCorpIdentity = Server.CreateOb ject("ADODB.Rec ordset")
RSCorpIdentity. Open "CorporateIdent ity", objConn, 1, 3, 2

CorpID = Request.Form("U pdate")
'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.For m("Referrer") ) > 0 Then
RSCorpIdentity( "Referrer") = Trim(Request.Fo rm("Referrer") )
Else
RSCorpIdentity( "Referrer") = 0
End If

If Len(Request.For m("FLCityID") ) > 0 Then
RSCorpIdentity( "FLCityID") = Request.Form("F LCityID")
End If

If Len(Request.For m("Webdisplay") ) > 0 Then
RSCorpIdentity( "Webdisplay ") = Request.Form("W ebdisplay")
End If

RSCorpIdentity. Update
May 20 '07 #4
zensunni
101 New Member
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
2068
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, it comes to me this way. <?xml version="1.0" encoding="iso-8859-1" ?>
16
20476
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 can go without the system crashing. An ancillary question is how one resets an auto number so that the sequence starts again at 1. In the case of this file, the auto number field serves no useful purpose except as an
1
2519
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 fine. (Excel XP) 2) The code works fine on a machine in our offices with Excel 2000. 3) On the client machine (with Excel 2000), the code does not work. I wrote some diagnostic tests to further try and see what was going on
5
4642
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 and when I try docWord.BuiltInDocumentProperties("NUMBER OF LINES") it returns an Object. When I look in the debugger, it is of type {System.__ComObject} and appears to have no values. When I get the type - it says the same thing. How can I get...
2
5064
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 because the length of an embedded array instance does not match the declared length in the layout What does it mean?
1
1233
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 something accordinly. I was thinking <xsl:if test="match=one" > will work but it's not ....
32
14653
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 engine doesn't exaust all the
1
1791
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 samples will be sent to a lab for analysis and the lab will send back a report (usually in excel or .txt format), that data will be imported into Access. If the concentration of a heavy metal is lower than the detectable limit of the analysis, the...
1
2255
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 another table
0
8372
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8285
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8814
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8475
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8591
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5621
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4149
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4293
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2709
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.