Create a Table in VB

MarionD

Registered User.
Local time
Today, 13:42
Joined
Oct 10, 2000
Messages
431
Hi there,

I'm still having a problem creating fields in a Table in VB

I need to : Create a Table with only 3 fields in it.
SMID - must be counter ( I only have Integer)
HLink - must be type Hyperlink ( I only have Text)
docdate - type Date - no problem

Can anyone tell me how to set the types to Auto-counter and Hyperlink?

Set td = db.CreateTableDef("Docs2tbl")
Set fld = td.CreateField("SMID", dbInteger )
td.Fields.Append fld
Set fld = td.CreateField("Hlink", dbTEXT, 50)
td.Fields.Append fld
Set fld = td.CreateField("docdate", dbDate, 50)
td.Fields.Append fld
db.TableDefs.Append td
 
Hi Marion
After you have defined the field and before you have appended it
use the attributes property, e.g. td.Fields![SMID].Attributes = dbAutoIncrField
You will also need to make the field dbLong rather than integer.

hyperlink is similar but the field needs to be described as dbmemo.
 
Thank you Keith - You are a star!

Marion
 

Users who are viewing this thread

Back
Top Bottom