Table creation using Access type library...

C

Colin Basterfield

Hi,

I have imported a type library into my chosen development language and am
trying to create an 'AutoNumber' field but can't seem to get it to work.

I can successfully do it for all other fields by using

db := __DBEngine36.OpenDatabase('c:\viaducapp\livedb\norman2000.mdb',
True, False, '');

and then

td := db.CreateTableDef ('AUTO_MAIL', 0, '', '');
td.Fields.Append (td.CreateField ('AUTO_MAIL_ID', dbLong, 0));

and so I thought I would do this to make it an AutoNumber

td := db.CreateTableDef ('MAIL_MSG', 0, '', '');
fld := td.CreateField ('AUTO_MSG_ID', dbLong, 0);
fld.Attributes := dbAutoIncrField;
td.Fields.Append (fld); { mmMsgId }

but it didn't work.

Any ideas anyone?

TIA
Colin B
p.s. I'm using Delphi, but didn't put that until now in case anyone poured
scron on it! :)))
 
C

Colin Basterfield

I realise this is not really the place to ask this, so if someone could
point me to a more relevant newsgroup I would be grateful...

Thanks again
Colin B
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top