473,598 Members | 2,916 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Any way to remove the AutoIncr / Autonum attribute using DAO?

Hello,

I'd like to change a field from an Autonum to a Long data type using DAO. I
knwo how to set the attribute, but don't know how to remove it. Any ideas?

Thanks!
Feb 27 '06 #1
4 1977
Rico wrote:
Hello,

I'd like to change a field from an Autonum to a Long data type using DAO. I
knwo how to set the attribute, but don't know how to remove it. Any ideas?


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Use a DDL statement like this in the SQL view of a Query, then run the
query.

ALTER TABLE <the table name> ALTER COLUMN <the autonumber column> LONG

Ex:

ALTER TABLE Accounts ALTER COLUMN account_id LONG

--
MGFoster:::mgf0 0 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBRANzo4echKq OuFEgEQKjAACgkL 78xz/ZAwnxL4FcWE90iM 8/OjUAnRAP
hyxx4rYFXpISBx/ENjgQ6qgo
=7rPR
-----END PGP SIGNATURE-----
Feb 27 '06 #2
Hi MG,

Thanks, but is there any way to accomplish this in Access97? I suppose I
should have mentioned that. The client only has Access 97 at this point.

Thanks!
"MGFoster" <me@privacy.com > wrote in message
news:ys******** *******@newsrea d3.news.pas.ear thlink.net...
Rico wrote:
Hello,

I'd like to change a field from an Autonum to a Long data type using DAO.
I knwo how to set the attribute, but don't know how to remove it. Any
ideas?


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Use a DDL statement like this in the SQL view of a Query, then run the
query.

ALTER TABLE <the table name> ALTER COLUMN <the autonumber column> LONG

Ex:

ALTER TABLE Accounts ALTER COLUMN account_id LONG

--
MGFoster:::mgf0 0 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBRANzo4echKq OuFEgEQKjAACgkL 78xz/ZAwnxL4FcWE90iM 8/OjUAnRAP
hyxx4rYFXpISBx/ENjgQ6qgo
=7rPR
-----END PGP SIGNATURE-----

Feb 27 '06 #3
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

You'll have to create a new, temp column in the table. Copy the
contents of the AutoNumber column into the temp column & then delete the
AutoNumber column. To get the old AutoNumber column's name you'll have
to create a new column w/ the old AutoNumber's column name and copy the
temp column's values into the new column w/ the old name. Then delete
the temp column. E.g.:

ALTER TABLE table_name ADD temp_column LONG

UPDATE table_name
SET temp_column = autonumber_colu mn

ALTER TABLE table_name DROP COLUMN autonumber_colu mn

ALTER TABLE table_name ADD autonumber_colu mn_name LONG

UPDATE table_name
SET autonumber_colu mn_name = temp_column

ALTER TABLE table_name DROP COLUMN temp_column

Fun in SQL89.

Each of these statements will have to be run in separate QueryDefs (or
using VBA & the CurrentDB object, in separate Execute methods).
--
MGFoster:::mgf0 0 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBRAOF/oechKqOuFEgEQLm 6QCfScid23s1NjO P4+2ZdKL01Lvi/hsAoLOa
PEpGQB/8EhzgGar+snRc3U Mz
=6A2m
-----END PGP SIGNATURE-----

Rico wrote:
Hi MG,

Thanks, but is there any way to accomplish this in Access97? I suppose I
should have mentioned that. The client only has Access 97 at this point.

Thanks!
"MGFoster" <me@privacy.com > wrote in message
news:ys******** *******@newsrea d3.news.pas.ear thlink.net...
Rico wrote:
Hello,

I'd like to change a field from an Autonum to a Long data type using DAO.
I knwo how to set the attribute, but don't know how to remove it. Any
ideas?


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Use a DDL statement like this in the SQL view of a Query, then run the
query.

ALTER TABLE <the table name> ALTER COLUMN <the autonumber column> LONG

Ex:

ALTER TABLE Accounts ALTER COLUMN account_id LONG

--
MGFoster:::mg f00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBRANzo4echKq OuFEgEQKjAACgkL 78xz/ZAwnxL4FcWE90iM 8/OjUAnRAP
hyxx4rYFXpISB x/ENjgQ6qgo
=7rPR
-----END PGP SIGNATURE-----


Feb 27 '06 #4
Thanks!

"MGFoster" <me@privacy.com > wrote in message
news:jC******** *******@newsrea d3.news.pas.ear thlink.net...
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

You'll have to create a new, temp column in the table. Copy the
contents of the AutoNumber column into the temp column & then delete the
AutoNumber column. To get the old AutoNumber column's name you'll have
to create a new column w/ the old AutoNumber's column name and copy the
temp column's values into the new column w/ the old name. Then delete
the temp column. E.g.:

ALTER TABLE table_name ADD temp_column LONG

UPDATE table_name
SET temp_column = autonumber_colu mn

ALTER TABLE table_name DROP COLUMN autonumber_colu mn

ALTER TABLE table_name ADD autonumber_colu mn_name LONG

UPDATE table_name
SET autonumber_colu mn_name = temp_column

ALTER TABLE table_name DROP COLUMN temp_column

Fun in SQL89.

Each of these statements will have to be run in separate QueryDefs (or
using VBA & the CurrentDB object, in separate Execute methods).
--
MGFoster:::mgf0 0 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBRAOF/oechKqOuFEgEQLm 6QCfScid23s1NjO P4+2ZdKL01Lvi/hsAoLOa
PEpGQB/8EhzgGar+snRc3U Mz
=6A2m
-----END PGP SIGNATURE-----

Rico wrote:
Hi MG,

Thanks, but is there any way to accomplish this in Access97? I suppose I
should have mentioned that. The client only has Access 97 at this point.

Thanks!
"MGFoster" <me@privacy.com > wrote in message
news:ys******** *******@newsrea d3.news.pas.ear thlink.net...
Rico wrote:

Hello,

I'd like to change a field from an Autonum to a Long data type using
DAO. I knwo how to set the attribute, but don't know how to remove it.
Any ideas?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Use a DDL statement like this in the SQL view of a Query, then run the
query.

ALTER TABLE <the table name> ALTER COLUMN <the autonumber column> LONG

Ex:

ALTER TABLE Accounts ALTER COLUMN account_id LONG

--
MGFoster:::m gf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBRANzo4echKq OuFEgEQKjAACgkL 78xz/ZAwnxL4FcWE90iM 8/OjUAnRAP
hyxx4rYFXpIS Bx/ENjgQ6qgo
=7rPR
-----END PGP SIGNATURE-----



Feb 28 '06 #5

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

Similar topics

2
15761
by: Gabe Moothart | last post by:
Hi, I'm writing a program that loads an xml document, modifies it, validates it with an xsd schema, then send it on to another application for processing. I have no control over this aplication. The problem is this: for some reason, this application rejects any xml documents with a namespace (as crazy as that sounds). So I need to strip the xmlns="www.MyNamespace.com" attribute from the document before passing it on.
3
1523
by: Jen LaForge | last post by:
Thanks for the help before I even start... I'm working in Access and I have right now 1024 records. We have a field set to Autonum that gives each new record a new file number. The problem? We have had a number of records deleted and even though our file number is up to 1033, we only have 1024 records. I need to know how to fill in the gaps (have 1033 records and 1033 files (data can be filled in later)) without screwing up the order...
1
1302
by: Jay | last post by:
I have a database that uses AutoNum for Customer Number and every once in a while when entering a new customer the AutoNum goes back and uses a number already used. So instead of using the next number (say 11,150) it'll go back to 10,125 that already has data associated with it and it will then count up from there. Has anyone had this problem and have a solution for it?
0
1140
by: Jonas | last post by:
Hi! I'm working with an ASP.NET web site that needs to conform with XHTML 1.0 Transitional and got an ASP.NET HtmlInputButton which automatically adds the attribute language="javascript" which isn't allowed in XHTML. I've tried to remove this attribute by executing QuickSearchButton.Attributes = ""; or QuickSearchButton.Attributes = null; or QuickSearchButton.Attributes.Remove("language");
4
4167
by: kevanbulmer | last post by:
c# by default the 'border' attribute is added to an asp.net image, how do i remove this attribute, as i cant validate my page as xhtml 1.1 thanks kb
17
2687
by: Rico | last post by:
Hello, I am in the midst of converting an Access back end to SQL Server Express. The front end program (converted to Access 2003) uses DAO throughout. In Access, when I use recordset.AddNew I can retrieve the autonum value for the new record. This doesn't occur with SQL Server, which of course causes an error (or at least in this code it does since there's an unhandled NULL value). Is there any way to retrieve this value when I add a...
2
1971
by: Philip Limbeck | last post by:
Hi, I am currently stuck with a problem concerning reflection. We have to remove a Custom class attribute from an instance before giving the instance to another subsystem. Is this possible using Reflection ? I know one can get the Custom Attributes by array for iteration. Thanks in advance
3
2743
by: patrizio.trinchini | last post by:
Hi, how can remove sibling elements based on the value of an attribute ? For instance, gven the XML document: <root> <parentElment> <testElement name="A"> <removableElement/>
11
4492
by: Richard Maher | last post by:
Hi, I have read many of the copius entries on the subject of IE performance (or the lack thereof) when populating Select Lists. I don't mind the insert performance so much, (I get 100x120byte rows inserted/sec up to 500, and 100rows/6secs up to 3000, which isn't great but then the Row Count is clicking away for the user to see and they can hit the "cancel" button at anytime, so overall I'm happy), what really disappoints me is the...
0
7981
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
7894
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
8284
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
8046
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
8262
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
6711
agi2029
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5847
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5437
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();...
1
1500
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.