Results 1 to 2 of 2

Thread: create database table using ADO

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2004
    Posts
    100

    create database table using ADO

    Can anyone here guide me how to create database table using ADO?
    I dont wish you all to code for me.
    At least give me some tips,links,sample programs and so forth.
    I have one sample that use CREATE TABLE but it only allows to name the table inside the code.
    I mean, I want my system user to name the table by her/his self..
    How is that?
    I am new into VB..pls help..

    TQ in advance.

  2. #2
    Addicted Member
    Join Date
    Jun 2002
    Location
    Brugge, Belgium
    Posts
    208
    first create a database connection

    Code:
    Set MySQLConn = New ADODB.Connection
        With MySQLConn
            .ConnectionString = conn 'this is the connection string which differs depending on what database u use. eg Mysql, Access
            .CursorLocation = adUseClient
            
            .Open
        End With
    Then create the table

    Code:
    MySQLConn.Execute "create table Material (matnr char(18), maktx char(70));"
    sample connectionstring :
    "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\test.mdb"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width