Add auto field with alter statement in Access/Vb6

Create auto filed ,which automatically generate value, programmatically in Vb6 is easy with two line of code.

What we will do when you need create auto value programmatically or with query.

Here what you need to do

  1. Create a number/text field.
  2. Alter the filed as auto .

  alter table YourTable column [auto] counter(1,1)

You can use the statement with Execute method of ADO connection in VB6  as follows

 adodbconnection.Execute “alter table YourTable  alter column [auto] counter(1,1)”

Published by


A developer,teacher and a blogger obsessed with Python,Dart and open source world from India

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.