Results 1 to 2 of 2

Thread: changing DAO field types and field order from VB?

  1. #1

    Thread Starter
    Fanatic Member crispin's Avatar
    Join Date
    Aug 2000
    Location
    2 clicks west of a Quirkafleeg...Cornwall, England
    Posts
    754

    Question

    DAO 3.6 and Access 2000:

    I want to change the data type of a field from number to text, to perform some other operations on it. I have a feeling the Type property is read only from VB - although you can do this from the Access GUI.

    Second I have performed lots of other field operations on my data and the field order (in the table definition screen) is now different to when I started. Once again in the access GUI you can drag the fields and reposition them as you wish - can you do it from VB? i.e. is there a way to order the fields collection.

    Thanks in advance

    Crispin
    VB6 ENT SP5
    VB.NET
    W2K ADV SVR SP3
    WWW.BLOCKSOFT.CO.UK

    [Microsoft Basic: 1976-2001, RIP]

  2. #2
    PowerPoster BruceG's Avatar
    Join Date
    May 2000
    Location
    New Jersey (USA)
    Posts
    2,628
    As far as I know, you cannot change the Type property of a field through DAO code. The way around this is to create a new field, copy the data from the old field to the new field, the drop the old field. You can change the field order via the OrdinalPosition property of a field.
    "It's cold gin time again ..."

    Check out my website here.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width