PC Review


Reply
Thread Tools Rating: Thread Rating: 1 votes, 1.00 average.

Delete Field in Backend Database

 
 
DT
Guest
Posts: n/a
 
      18th May 2010
Access 2007 user looking for code that will delete a field from a specified
table on a backend database. AND/OR...change the Field Size on an existing
field. Thanks!
--
DT
 
Reply With Quote
 
 
 
 
Daniel Pineault
Guest
Posts: n/a
 
      18th May 2010
No user should have this ability. This is a recipe for disaster!!!!

Anywho, To delete a field you'd do something along the line of

Dim db As DAO.Database
Dim tdf As DAO.TableDef
Set db = CurrentDb
set tdf = db.TableDefs ("YourTableName")
tdf.Fields.Delete ("YourFieldName")

or using SQL, something like

Db.Execute "ALTER TABLE YourTableName " & _
"DROP COLUMN YourFieldName;"


As far as resizing a field, check out
http://www.freevbcode.com/ShowCode.asp?ID=4599 for some inspiration.

But as I stated, this is a very bad idea!!!
--
Hope this helps,

Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.



"DT" wrote:

> Access 2007 user looking for code that will delete a field from a specified
> table on a backend database. AND/OR...change the Field Size on an existing
> field. Thanks!
> --
> DT

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How To Duplicate Table From 1 Backend Database To Another Backend Database John W. Vinson Microsoft Access VBA Modules 0 30th Jun 2009 06:01 PM
renamed field in replicated backend database (gen_tempfield*0) =?Utf-8?B?bnRhbmNyZXRv?= Microsoft Access 0 20th May 2006 12:55 AM
Backend Database =?Utf-8?B?V3N0YW5sZXk=?= Microsoft Access Database Table Design 7 9th Mar 2005 10:55 PM
Form in backend database creates new user in frontend database =?Utf-8?B?Sm9uYXRoYW4gQnJvd24=?= Microsoft Access Security 6 23rd Jan 2005 03:04 AM
Adding field in backend database ReidarT Microsoft Access Form Coding 9 25th Apr 2004 03:57 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:31 PM.