How to create a table in ms access 2003 using MS Visual Basic 6.0 ?

I’m making a project using visual basic 6.0 and ms access 2003, which requires to create a separate a table in every financial year. I’m using ADO-Connection to connect the database.I need to know how can i create a table (using sql queries) from VB 6.0 codes. Plz Help Me.

Use the execute command of the ADO object.

For example

objConnection.Execute "CREATE TABLE customer
(First_Name char(50),
Last_Name char(50),
Address char(50),
City char(50),
Country char(25),
Birth_Date date)"

This example assumed you have declared your ADO connection as objConnection, you will have probably called this something else.

One Response to “How to create a table in ms access 2003 using MS Visual Basic 6.0 ?”

  1. Freddy Says:

    Use the execute command of the ADO object.

    For example

    objConnection.Execute "CREATE TABLE customer
    (First_Name char(50),
    Last_Name char(50),
    Address char(50),
    City char(50),
    Country char(25),
    Birth_Date date)"

    This example assumed you have declared your ADO connection as objConnection, you will have probably called this something else.
    References :

Leave a Reply