473,326 Members | 2,182 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,326 software developers and data experts.

Insert question

ams
I set up a database of civic league members and residences.
I set the primary key to conform to addresses by street numbers.
Unfortunately, I omitted two buildings.
How do I insert the data for these two items where they should be ?
The Primary Key doesn't seem to like that :(

Thanks much,
newbie here
Nov 12 '05 #1
4 1511
OM
"ams" <no**@cox.net> wrote in message
news:m2Lqc.31352$Md.29945@lakeread05...
I set up a database of civic league members and residences.
I set the primary key to conform to addresses by street numbers.
Unfortunately, I omitted two buildings.
How do I insert the data for these two items where they should be ?
The Primary Key doesn't seem to like that :(

Thanks much,
newbie here


I've just done this (and probably did it a very roundabout way), but I used
a make table query, with the records sorted the way I wanted, but without
the Primary key, to make a new Temp table. I then deleted all the records
from the original table, and used an append query to add the sorted ones
from my new Temp table, then deleted the Temp table.

Hey ! Worked for me !

Rob Lepper
Nov 12 '05 #2
ams

"OM" <le******@loxinfo.dot.co.th> wrote in message
news:c8**********@news.loxinfo.co.th...
"ams" <no**@cox.net> wrote in message
news:m2Lqc.31352$Md.29945@lakeread05...
I set up a database of civic league members and residences.
I set the primary key to conform to addresses by street numbers.
Unfortunately, I omitted two buildings.
How do I insert the data for these two items where they should be ?
The Primary Key doesn't seem to like that :(

Thanks much,
newbie here
I've just done this (and probably did it a very roundabout way), but I

used a make table query, with the records sorted the way I wanted, but without
the Primary key, to make a new Temp table. I then deleted all the records
from the original table, and used an append query to add the sorted ones
from my new Temp table, then deleted the Temp table.

Hey ! Worked for me !

Rob Lepper

Thanks, Rob. I did the round-about as well. I exported in Excel format.
Inserted the two buildings, and imported back into Access with a new table
name.

Much appreciated.
ams
Nov 12 '05 #3
The order that items are in a table should be irrelevant to you. If you want
them sorted, use a query. You can set sorting options in a query. Also, if
by inserting into the primary key, you mean that you have an autonumber and
you want to insert into the middle of it then - don't. Autonumbers will give
each record a unique ID, beyond that they have no meaning. You shouldn't
expect to be able to keep them lined up. If you need a field to do that,
you'll need to create one yourself. You could then have updated the ones
beyond where you wanted to insert by running an Update Query to add 2 to
each of the values beyond that point then inserted your other 2 records,
setting the field value to the sequence that you want.

--
Wayne Morgan
Microsoft Access MVP
"ams" <no**@cox.net> wrote in message
news:m2Lqc.31352$Md.29945@lakeread05...
I set up a database of civic league members and residences.
I set the primary key to conform to addresses by street numbers.
Unfortunately, I omitted two buildings.
How do I insert the data for these two items where they should be ?
The Primary Key doesn't seem to like that :(

Thanks much,
newbie here

Nov 12 '05 #4
ams
Wayne,

I was more or less asking, how do you insert a new row with new data in
between existing
rows that already have a primary key assigned. For some reason, in the
table dataview mode,
I am unable to insert such a row between existing ones. I will try out the
Update Query as you
suggested.

I know, I am not explaining myself well. Sorry.
Thank you,
ams
"Wayne Morgan" <co***************************@hotmail.com> wrote in message
news:gK******************@newssvr31.news.prodigy.c om...
The order that items are in a table should be irrelevant to you. If you want them sorted, use a query. You can set sorting options in a query. Also, if
by inserting into the primary key, you mean that you have an autonumber and you want to insert into the middle of it then - don't. Autonumbers will give each record a unique ID, beyond that they have no meaning. You shouldn't
expect to be able to keep them lined up. If you need a field to do that,
you'll need to create one yourself. You could then have updated the ones
beyond where you wanted to insert by running an Update Query to add 2 to
each of the values beyond that point then inserted your other 2 records,
setting the field value to the sequence that you want.

--
Wayne Morgan
Microsoft Access MVP
"ams" <no**@cox.net> wrote in message
news:m2Lqc.31352$Md.29945@lakeread05...
I set up a database of civic league members and residences.
I set the primary key to conform to addresses by street numbers.
Unfortunately, I omitted two buildings.
How do I insert the data for these two items where they should be ?
The Primary Key doesn't seem to like that :(

Thanks much,
newbie here


Nov 12 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: TThai | last post by:
HI, I'm trying to insert records to a table using bcp command. The problem is the input file to the bcp is a text file that looks like this: Text file data: 1234 abc def ghi jkl mno ...
1
by: Mattias B | last post by:
Hello! I have a question about how stl's insert works on containers and on vector in particular. The question is: is it OK to insert a value before end() with something like: vector<int>...
20
by: akej via SQLMonster.com | last post by:
Hi, i have table with 15 columns CREATE TABLE . ( PRIMARY KEY , NULL , NULL , NULL , NULL , (50) NULL , NULL
11
by: Jean-Christian Imbeault | last post by:
I have a table with a primary field and a few other fields. What is the fastest way to do an insert into that table assuming that sometimes I might try to insert a record with a duplicate primary...
2
by: Daniel Tan | last post by:
I got a syntax error in SQL insert into statement , hope someone can help me .Thanks. job_search = "='" & Me.Jobno & "' " sqlstr = "INSERT INTO Custorder (job_order) " & _ "values " &...
2
by: Russ Schneider | last post by:
I downloaded the port for Postgres for PHP-NUKE. All insert statements are as follows: For table: Table "nuke_referer" Column | Type | Modifiers...
9
by: David Eades | last post by:
Hi all Complete newbie here, so apologies if this is the wrong forum. I've been asked to use mysql and asp to make a simple bidding system (rather like a simple ebay), whereby users can use a...
2
josie23
by: josie23 | last post by:
Egad, I'm not a coder/programmer by nature or occupation but understand things like html and css and a small amount of perl. So, basically, I'm a perl/mysql imbecile. But, I've been trying to...
1
by: PrakashRS | last post by:
Given the table T1, created by: CREATE TABLE t1 (id INTEGER GENERATED BY DEFAULT AS IDENTITY, c1 CHAR(3) ) The following SQL statements are issued: INSERT INTO t1 VALUES (1, 'ABC') INSERT INTO...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.