Welcome to dbFreaks.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Use DAO to add fields to existing Access table

 
   Database Help (Home) -> Visual Basic -> DAO RSS
Next:  VB6 Access 2000 : Error 3085 undefined function,..  
Author Message
JP Bless

External


Since: Feb 23, 2006
Posts: 2



(Msg. 1) Posted: Fri Jun 30, 2006 12:11 pm
Post subject: Use DAO to add fields to existing Access table
Archived from groups: microsoft>public>vb>database>dao (more info?)

How do I use DAO.36 code to add 3 fields to existing Access 2000 table

Thanks in advance

 >> Stay informed about: Use DAO to add fields to existing Access table 
Back to top
Login to vote
Ralph

External


Since: Jan 28, 2008
Posts: 31



(Msg. 2) Posted: Fri Jun 30, 2006 12:21 pm
Post subject: Re: Use DAO to add fields to existing Access table [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"JP Bless" <jp3BlessNoSpam.TakeThisOut@hotmail.com> wrote in message
news:uXKYN$FnGHA.488@TK2MSFTNGP02.phx.gbl...
> How do I use DAO.36 code to add 3 fields to existing Access 2000 table
>
> Thanks in advance
>

Checkout "TableDefs" in help.
Here is the basics for adding a field...

Dim tbl As TableDef
Dim field As field
Set tbl = db.TableDefs(strTableName)
Set field = tbl.CreateField(Name:=strFieldNametoAdd, _
Type:=FieldType)
If (db.Updatable And tbl.Updatable) Then
tbl.Fields.Append field tbl.Fields.Refresh
Else
MsgBox "not updatable"
End If ....

hth
-ralph

 >> Stay informed about: Use DAO to add fields to existing Access table 
Back to top
Login to vote
JP Bless

External


Since: Feb 23, 2006
Posts: 2



(Msg. 3) Posted: Fri Jun 30, 2006 2:45 pm
Post subject: Re: Use DAO to add fields to existing Access table [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Thanks


"Ralph" <nt_consulting64.TakeThisOut@yahoo.com> wrote in message
news:le6dncbUT8_EwDjZnZ2dnUVZ_tidnZ2d@arkansas.net...
>
> "JP Bless" <jp3BlessNoSpam.TakeThisOut@hotmail.com> wrote in message
> news:uXKYN$FnGHA.488@TK2MSFTNGP02.phx.gbl...
> > How do I use DAO.36 code to add 3 fields to existing Access 2000 table
> >
> > Thanks in advance
> >
>
> Checkout "TableDefs" in help.
> Here is the basics for adding a field...
>
> Dim tbl As TableDef
> Dim field As field
> Set tbl = db.TableDefs(strTableName)
> Set field = tbl.CreateField(Name:=strFieldNametoAdd, _
> Type:=FieldType)
> If (db.Updatable And tbl.Updatable) Then
> tbl.Fields.Append field tbl.Fields.Refresh
> Else
> MsgBox "not updatable"
> End If ....
>
> hth
> -ralph
>
>
>
 >> Stay informed about: Use DAO to add fields to existing Access table 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Error after converting from Access 97 to Access 2002-2003 .. - Hello, I convert my Access 97 Database to Access 2002-2003, because I’m now using WinXP. And now when I run my VB program, I get Runtime error '3343' - Unrecognized database format. I'm using DAO350.DLL. Do I have to change to another DLL? Thanks. ....

VB6 Access 2000 : Error 3085 undefined function, works wh.. - I've been using VB6 with DAO 3.6 and an Access 2000 format database fine for a few years. I recently added a module function that one of the Access queries uses. It is only called from with the Access query. When I try to set the first parameter from....

Copy a table from one MDB file to another? - Is there a relatively simple DAO (or SQL) statement that I can execute in my VB6 program that will copy a table (structure only - no data) from one MDB file to another MDB file?

DAO reference / Access 2007 - while using an Access 2007 .accdb file I can access the dao. object very easily. the following code in VBA works well : Function getrecordcount(strTableName As String) As Long Dim dbCurrent As DAO.Database Set db = CurrentDb Dim rstRecords A...

Can't access newsgroup using NNTP Newsreader - Hi. I've been unable to access the newsgroup Vb.database.dao using NNTP newsreader. However, I can access it through the browser. The message that appeared is : The newsgroup 'msnews.microsoft.com/microsoft.public.vb.database.dao' was not availabl...
   Database Help (Home) -> Visual Basic -> DAO All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]