Access Field Types

  • Thread starter Thread starter OHM
  • Start date Start date
O

OHM

OK, before you flame me because this is not an VB/ADO/INTEROP question
rather than a VB.NET/ADO.NET/Interop question, I have not had much luck with
this so you guys are a last resort.

I wonder is someone could help me. We have an Access DB which has a field
type/size we need to change programatically.

I'm sure this can be done via interop, does anyone have a code snippet or
link which would help.

Cheers
 
Because the customer has the database, but not the access application.
Therfore, we need to generate a service pack to update not only code over
hundreds of sites, but also the Access Tables.

As the tables are full of data, I dont want to delete and recreate the
fields. However, I know a work around is to create a new field, do an action
query and then delete the old column of data, but I want to to this like
access would.

Regards - OHM
 
I kind of gathered this, but didnt want to use this route. I was looking for
an Interop solution really.

Thanks anyway !

Regards - OHM


eh said:
Im ***real*** rusty with Access but you should be able to drop columns and
then create new ones programatically using access sql, then copy the data
back from the backup you have made :-)
 
Thanks Ken, was really looking for a more code based solution. In other
words I want to do what access does, but do it via Interop. I cant find good
material on this, Im sure its there, But I cant see it.

Regards - OHM
 
OHM:

Are you trying to use Interop or avoid it? AFAIK, you'll need to use DAO to
fire those changes with access.
 
Hi,

I have reviewed the newsgroup and find that you have post a similar post in
the group below.

Subject: Changing Field Type On MS Access using ADO/VB
Newsgroups: microsoft.public.vb.database.ado

I think Gary's suggestion in the group above that to use the ADOX to do the
job is an approach.
Also because ADOX is an COM object we can use it in .NET easier by simply
adding reference to the ADOX library and the VS.NET will generate the
assembly which is used to interop with ADOX COM object automatically.
e.g.
1. right click on the reference in the solution explorer and select add
reference
2. in the Add reference dialog select the COM tab and select the Microsoft
ADO Ext. 2.7 for DDL and Security COM library and click OK

After that we can use the ADOX object in VB.NET similar with what will do
in VB6, you may follow the link that Gary provided.

If you still have any concern on this issue, please feel free to post here.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Thank you, this infomation along with Gary's was most helpful. Also thanks
to everyone else who has replied to my original post.

Best Regards - OHM
 
Back
Top