LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

activex and ms-access

Hi
I'm trying desperately to create a table with activeX-commands in a ms-access database. does anybody have an idea or an example?
thanks alot for your help
Yves
0 Kudos
Message 1 of 3
(2,746 Views)
There are quite a few examples floating around the dev zone on using ActiveX. I haven't seen any that create tables though. I would definitely look into getting the Database connectivity toolset that you can get for Labview. It will save you tons of time.
0 Kudos
Message 2 of 3
(2,746 Views)
Hi Yves,
the best place to search is MS Access help part dedicated to Visual Basic for Applications. Thus, you can find out what methods and properties to use.As far as I remember, CreateTableDef is the method you need.

Good Luck!

p.s.: take this piece of vb code and try making the same calls ... let me know if it's working

"The following example creates a new TableDef object and appends it to the TableDefs collection of the current database.

Sub NewTable()
Dim dbs As Database, tdf As TableDef, fld As Field

' Return reference to current database.
Set dbs = CurrentDb
' Return TableDef object variable that points to new table.
Set tdf = dbs.CreateTableDef("Contacts")
' Define new field in table.
Set fld = tdf.CreateField("ContactNam
e", dbText, 40)
' Append Field object to Fields collection of TableDef object.
tdf.Fields.Append fld
tdf.Fields.Refresh
' Append TableDef object to TableDefs collection of database.

dbs.TableDefs.Append tdf
dbs.TableDefs.Refresh
Set dbs = Nothing
End Sub"
0 Kudos
Message 3 of 3
(2,746 Views)