number of columns in table

  • Thread starter arista via AccessMonster.com
  • Start date
A

arista via AccessMonster.com

Hi
I would like to count number of columns in some table. I think it should be
possible with ADOX (columns object) but if not necessary I do not want to
include this reference into my code.
Would it be possible to count the number of columns by some SQL command for
example?
Or perhaps create an array of variant, then assign entire record (e.g. first
row from the table) to this array and finally count the fields in this array ?

Or use somehow object field ?
The number of columns is changing in my table and I need to make further code
accordingly.
Thanks
Ari
 
A

arista via AccessMonster.com

Well, well Ari
I found few minutes afterwards the answer and just hoping it works correctly.

Dim TableSet As New ADODB.Recordset
Dim x As Long

TableSet.Open "tblTemp_v9_CutterStatistics", CurrentProject.Connection,
adOpenDynamic, adLockOptimistic

x = TableSet.Fields.Count

TableSet.Close

Rgs
Ari
 
Top