Hi,
Hope someone can help me. I'm trying to create an Access Db with VB6. Creating the Db isn't a problem and neither is creating a table or inserting data into the table when I explicitly declare the column definition like this:
tbl.Columns.Append "Column 1", adVarWChar, 40
However, I want the table column names to be fed from an array called Head().
When I use the following code, the table isn't created:
'Create a new table.
Set tbl = New ADOX.Table
tbl.Name = "NameAddress"
'enter the headings into the first row of the flexgrid
For Counter = 1 To lngColumnsCount + 1
tbl.Columns.Append Head(Counter), adVarWChar, 40
Next Counter
cat.Tables.Append tbl
However, the table is created if I use the following line in the code above:
tbl.Columns.Append Head(Counter) & Counter, adVarWChar, 40
Any ideas or solutions will be gratefully received.
Thanks.
Hope someone can help me. I'm trying to create an Access Db with VB6. Creating the Db isn't a problem and neither is creating a table or inserting data into the table when I explicitly declare the column definition like this:
tbl.Columns.Append "Column 1", adVarWChar, 40
However, I want the table column names to be fed from an array called Head().
When I use the following code, the table isn't created:
'Create a new table.
Set tbl = New ADOX.Table
tbl.Name = "NameAddress"
'enter the headings into the first row of the flexgrid
For Counter = 1 To lngColumnsCount + 1
tbl.Columns.Append Head(Counter), adVarWChar, 40
Next Counter
cat.Tables.Append tbl
However, the table is created if I use the following line in the code above:
tbl.Columns.Append Head(Counter) & Counter, adVarWChar, 40
Any ideas or solutions will be gratefully received.
Thanks.