I have an MS SQL database, I want to be able to create a new record based on a prevoius record, the SQL statement I have is this:
strSQL = "INSERT INTO tableX " & _ "SELECT * FROM tableX WHERE " & _ "id='1'"
The problem I have is that the primary Key (id) is set to Identity and so won't allow duplicates, I need this SQL to work but give the id value a new unique value.
I have a booking form, called classroomform. On this form the user requests a classroom number, location, date, start/end time and number of students.
As it stands, the data is submitted via a submit button and an insert query created using Dreamweaver.
I already have various validation on the form, such as javascript which error checks for invalid times etc and asp validation which checks for correct dates etc.
However, the final touch that I'm looking to do is to add some code to the form which checks for duplicate entries that are in the database. I basically want an error check which doesn't allow the user to enter a duplicate record that is based on classroom number, location, date, start/end time.
when i want to insert my data into my table but i encounter the following error
Error Type:
Microsoft OLE DB Provider for SQL Server (0x80040E2F) Violation of PRIMARY KEY constraint 'PK_sDetail'. Cannot insert duplicate key in object 'sDetail'. /fsearch/InsertTable.asp, line 153
For example, now my 1st page is a search page, i use it to search for all records that has the same Business_unit, so it goes to a second page where a table of the records is shown.
Now this page has a link to a 3rd page, where i wan an exact duplicate of the second page, is it feasible, is there anyway to display the exact saem table on the 3rd page?
My table in the database may contain duplicate records, which means except the primary key (auto_increment) field is unique, all or almost of all the fields are with the same content. How can I select them to display and delete them?
I have a problem with Insert statement. Though My SQL Statement executed once only, there are 2 records entered in DB. I am using ASP and SQL Server. Does anybody know the solution?
I have a fairly complicated web site with multiple sub-folders running on W2k server (IIS5?).
I would like to duplicate this to another web site on the same server for testing. For instance, the current root web of the server is located atF:Web. The production site is F:WebMyApp.I want to create another siteat F:WebMyAppTest.
The only thing that prevents me from just copying everything from one to the other is the links and includes of the pages, such as:
I then need to go thru every source file, and change /MyApp to /MyAppTest.Is there a way to accomplish this via IIS, or by changing the way I reference the includes and link?
I have a form with home address & business address fields.When a user goes to this form, the fields pull the information that is stored in the database,then they can update their information.
What I would like to do is have a checkbox/radio button/button that allows the user to specify that the business address is the same as the home address and replace all the business addy fields to the same value as the home addy.
So when you click/select this button, the business address fills in (if empty) or changes (if it has values) to the same values as home.Then when the form is submitted, these changes are written as normal.Is this possible and if so, can someone point me to an example?
My database has the "email" field set to not accept duplicates. If someone tries to enter a duplicate email, I get an error message. Is there a way to just redirect them back to the registration page if their email address is duplicate?
i have a form by asp and database by MS access.so i want to prevent the duplicate value in empID because when i add a new employee with the same id ASP gives me this error.
Error Type: Microsoft OLE DB Provider for ODBC Drivers (0x80040E14) [Microsoft][ODBC Microsoft Access Driver] 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. /employee/admin/addemp1.asp, line 48
so i want the employee to get a message like this empID already exist or somthing like this.
I am trying to do a simple INSERT into SQL. I've done it tons of times before with the same code, but this time is is placing duplicate entries in the table. Any ideas why this would be happening? Here is my ASP code doing the form processing:
<% set conn=server.createobject("adodb.connection") conn.Open "Driver={SQL Server}; Server=SERVERNAME; Database=DATABASENAME; UID=USER; PWD=PASSWORD" set rs = Server.CreateObject("ADODB.RecordSet")
i want to hide duplicate values of a column in a asp form, lets suppose i have a field schoolname, and studentname, so it is possible a school have so many studnets, so i dont want to show school name infront of each student name, how can i hide it,
Yes different users can post images with the same name and they should be renamed as you state.
However you can not upload an image with the same name if you have already done so and give msgbox that duplicate image name pls check image name and image size is not larger then 13kb.
I'm connecting to an MS Access database using ASP. Within my database I have duplicate records (more specifically records with the same serial no.). When I search by the serial number only the first record is displayed. I would like to display all records containing the given serial no.
The table is full of records; many are duplicates.
What would be the correct syntax to show ONLY those records appearing more than once?
A. Please do not use Stored Procedures B. Please do not use User Defined Functions C. Please do not use Variables D. Please do not use Temporary Tables E. Please do not use Views
I have a form to enter details about companies into a access DB, it all works fine the way it is set up except this one small problem.
The same company details can be entered again by mistake and take a new record set. Now what I need to know is how to stop this from happening, do I use ASP code to check the DB (if so could someone tell me how it is done) or do I set this up in the Access DB itself.
What I want to happen is if the same company details are entered then the user gets a warning telling them that that company has already been entered.
i want to hide duplicate record fields in an asp form, i have access database, e.g, i have a field schoolname, and studentname, 1 school have many students, so i want to print or display schoolname only once.
Is it at all possible to display only one of possible duplicate records from a database in a recordset. The field that needs to be recognised as a possible duplicate is a column for names but then needs to show the one with the highest score only.Fields are name and total (numerical). Currently I have only a basic recorset which is all that was needed until now:
I am looking for some help in writing an ASP script to check for duplicate values in a database. Using a web form to add and edit the records, the user will type/edit the data including phone number.
If the user types in a phone number or email address that is already in the database, I would like an alert box to indicate the name of the person with that phone number when the form is submitted. This is a more user friendly error instead of "Microsoft JET Database Engine error '80004005' ".
[Room,Subject,Time,Day] When the admin enter data to the form, the data will go to another page and will be displayed in a classtimetable form,according to the time, day and room number. i am using Macromedia Ultradev 4 to develiop this page. what i want to do some programming here is.. when the admin enter the data,
1. Room and Time can be same, but in different Room, 2. Room and Time cannot be same(with previous data) in the same Room,
i need to delete duplicate data row in my database... i run my code n there is error n i can't figure out what is going wrong, hope can help me check it or give me others laternative ways to solve it. here is my code
dim sql sql= "DELETE FROM employee_att WHERE (rowid, data_serial_no) NOT IN (SELECT MIN(rowid), data_serial_no FROM employee_att GROUP BY data_serial_no)" on error resume next objConn.execute(sql)
if err.number <> 0 then response.write "an error has occurred....no data added<br>" else response.write "deleted.<br>" end if
I have my register page, which I am using dreamweaver to develop this site. I can't get my Request.ServerVariables("LOGIN_USER") to work, so I have to code something that will give a response back to the user saying that username already exists incase they try and register again.
Since I'm using dreamweaver and it likes to code lots of information in different ways I am having a hard time trying to figure where to put my if statement to start checking for duplicates for the username (which is the unique ID). Here is the complete code. My question is where do I start to accomplish this task?? Code:
I've written an email sending script to mass send to our database - some of our subscribers are subscribed to multiple list, and so when selecting the entire database, I want to ensure I don't have Duplicates.
To avoid this, I am selecting the recordset of all users, ordering by Email address, sending the email, moving onto the next record and then starting a loop to keep looping until the email address is different, but it doesn't work... see example below... Code:
I'm running into a problem where in code I'm definitely only saying jmail.execute one time, but am receiving two emails. The time stamps and content are identical, but the message id is different.
It does not happen everytime. Is this a known bug with jmail? Has anyone run into this? The message id being different should be enough proof that it's not a problem with the mail server.