Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / Database Access / July 2008



Tip: Looking for answers? Try searching our database.

Insert a new field into a table?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Martin - 11 Jul 2008 12:43 GMT
I'm using the following code to append a new field to an existing
table in an MDB file.

  Set td = db.TableDefs("MainData")
  Set fld = New Field
  fld.Name = "NewFieldName"
  fld.Type = dbInteger
  td.Fields.Append fld

This, of course, adds the new field at the end of the list of current
fields.

What I would like to do is INSERT the new field at a specified place
in the list of existing fields. Is it possible to do this? If so, how?

Thanks.
roame - 13 Jul 2008 11:56 GMT
> I'm using the following code to append a new field to an existing
> table in an MDB file.
[quoted text clipped - 12 lines]
>
> Thanks.

Do you have a syntax table for your compiler?
Douglas J. Steele - 14 Jul 2008 01:40 GMT
What difference does it make? I'm not trying to be facetious, but really
where the field is in the table shouldn't matter. If you've got some
specific output that you want in a specific order, use a query with the
fields arranged as you need.

If you're really determined to change it, though, take a look at the
OrdinalPosition property.

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)

> I'm using the following code to append a new field to an existing
> table in an MDB file.
[quoted text clipped - 12 lines]
>
> Thanks.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.