i want to insert new record from asp file into database, i insert the data for example,product name(Cream Puff), price(1.00), quantity(100pcs) but then when i open my database it display "undefined' for all the field.
7 1908
From the earlier question, i have another error which is it mentioned that there are multiple same data in the table because it a primary key...Sorry i do not remember exactly the error but it soething like that when im inserting new record...I usign asp(javascript) and access
The error for question 2,The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship. Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again.
the sql i use -
sql2="INSERT INTO Login (Username,UserPassword) VALUES ('"+user_Name+"','"+pass_Word+"')";
-
Conn.Execute(sql2);
-
-
sql="INSERT INTO Customer(Customer_ICNumber,Cust_Name,Cust_Address,Cust_PrimaryNumber,Cust_SecondaryNumber,Cust_Company,Cust_CompanyType,Username)VALUES ('"+cust_ICNumber+"','"+cust_Name+"','"+cust_Address+"','"+cust_Primary+"','"+cust_secondary+"','"+cust_Company+"','"+cust_CompanyType+"','"+user_Name+"')";
-
Conn.Execute(sql);
-
jhardman 3,406
Recognized Expert Specialist
Try your query outside of ASP first. Try it in a query analyzer and see what it results.
Jared
Sorry but how to analyze inser statement in access...
jhardman 3,406
Recognized Expert Specialist
I don't use access anymore, but I have Access 2007 on my work computer. I got to a query analyzer by opening access and selecting a table, then I clicked "query tools" and it tried to get me to enter data via a graphical user interface, but I won by clicking "view" -> "SQL view". This provided a large textbox where I could enter the text of the query and a button marked "run". Hope this helps.
Jared
alright...i will try it...i'll let you know...
That error message is telling you that at least one of the fields you are trying to enter data for is required to have a unique value and that the value submitted is already in another record.
Open Access and open the table in design view. If there is a field that has an icon that looks like a yellow key at the left of the line, then that field must be unique. Also, select each field (one at a time) and look at the field properties at the bottom of the field list - if any field has "yes" for "indexed" then that field must also be unique.
There is one other thing you should check. If there are any fields in the table that you are not trying to record values for, be sure that the field properties for all of them either have "no" for "required" and have "yes" for "allow zero length" or have a default value assigned.
This should identify the field or fields causing the error.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Sans Spam |
last post by:
Greetings! I have a table that contains all of the function
permissions within a given application. These functions are different
sections of a site and each has its own permissions (READ, WRITE,...
|
by: serge |
last post by:
I have a scenario where two tables are in a One-to-Many relationship
and I need to move the data from the Many table to the One table so
that it becomes a One-to-One relationship.
I need to...
|
by: Philip Boonzaaier |
last post by:
I want to be able to generate SQL statements that will go through a list of
data, effectively row by row, enquire on the database if this exists in the
selected table- If it exists, then the colums...
|
by: Mike |
last post by:
I know this sounds strange but I am at a loss. I am calling a simple
funtion that opens a connection to a SQL Server 2000 database and executes
an Insert Statement.
private void...
|
by: alexmaster_2004 |
last post by:
hi
i have made an application using C# that access sql2000.
this application is just used to insert data to the database.
i use something like this in my code:
//
string colmnA = TextBox1.Text;...
| |
by: Neil Zanella |
last post by:
Hello,
I am trying to execute ADO.NET INSERT statement where one of the
fields
is coming from a password HTML control. When I access the text with
password.Value and print with Response.Write...
|
by: Jack |
last post by:
Hi,
I am gathering the input values to a form using Request.form method from the
processing page. After all the data is captured, I am building sql statement
out of it. Using a response.write...
|
by: rn5a |
last post by:
During registration, users are supposed to enter the following
details: First Name, Last Name, EMail, UserName, Password, Confirm
Password, Address, City, State, Country, Zip & Phone Number. I am...
|
by: Red |
last post by:
If auto-format is turned off in VS2008, there is apparently no way to
indent a line. Under Tools->Options->Text Editor->C#->Formatting,
there are three checkboxes. Unchecking those seems to cause...
|
by: Maklar60 |
last post by:
I am attempting to execute an INSERT statement on my page but continually get the following error:
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
Incorrect syntax near '<'.
...
|
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,...
| |
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...
|
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...
|
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...
|
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: 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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
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 ...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |