473,386 Members | 1,796 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,386 software developers and data experts.

Is it possible to insert a record between autonumbered records?

2
I'm using an autonumbered field, incrementing by 10, and will need occasionally to insert a record between those autonumbered e.g. record 15, between 10 and 20. Is this possible? I'm using Access 2002. Many thanks.
Jun 23 '10 #1
2 1076
vb5prgrmr
305 Expert 100+
Yes it is possible but depending upon how many records are in that table, the last part of this solution may take some time to execute...

You will need to issue an alter table statement to drop the primary key constraint. Then you will be able to insert the record, which will actuall be inserted at the end of the recordset but if you pull the data out ordered by the primary key, then it will come out in the order you want. Which means of course that you will have to issue another alter table statement to reapply the primary key...



Good Luck
Jun 23 '10 #2
Plec
2
@vb5prgrmr
Thanks Vb5 for your speedy reply. As I'll probably be inserting more records than I originally thought and the final record set will only amount to 400 or so, it might be easier to forgo the autonumber option and enter the key manually.

Many thanks again.
Jun 24 '10 #3

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

Similar topics

1
by: Paul | last post by:
Hi all Just a quick question more about the flow of an asp page. IF I have code as below: - MyDBConnection.Execute "Insert Record Into A Table" MyRecordset.Open "Retreive the same record from...
1
by: jaYPee | last post by:
i'm wondering how can i insert record into my sql server 2000. i have already created a connection to my sql server 2000 using the wizard. i added 4 sqldataadapter and 1 dataset. because i am an...
10
by: jaYPee | last post by:
as of now i am using a stored procedure from my sql server 2000 to insert record from another table. what i need now is on how can i insert record by not using the stored procedure and insert it...
1
by: siujean | last post by:
Hi All, I met a problem when insert over 1000 records to db2 via servlet, it show me the error message is "DB2 SQL error: SQLCODE: -911, SQLSTATE: 40001, SQLERRMC: 68 DB2ConnectionCorrelator:...
1
by: swatijogdand | last post by:
Hi all, I want to insert a record at a time from front end i.e. vba in a table located on sql server. But, one field on that table has an 'identity' constraint which is not enabling me to insert...
3
by: ebru | last post by:
about insert/delete/update records in mysql server with asp code how can I insert record in mysql database.. I insert into database but if I leave one text box empty, its give me error how can...
0
ak1dnar
by: ak1dnar | last post by:
There is a Error getting while i am entering records using this jsp file. <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %> <%@ include...
10
by: oracle newbie | last post by:
How to create a pl sql program which enable to insert record into database? Can anyone can give details or steps in creating a pl sql program which enable to insert record into database using the...
3
by: svgeorge | last post by:
Please tell me how to Insert Web Interface records to SQL database table on Button click I have several records for approving payment and these records needs to be inserted into a table Payment...
3
by: Rohullah | last post by:
I want to insert record into two table at a time. For example i have two table student1 and student2 with the same structure now i want to insert record into student1 the record of student1 should...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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,...
0
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 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.