CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2002
    Location
    Piscataway, NJ, USA
    Posts
    23

    Creating Tables with ADO

    Hello again,
    I am here with anopther easy(!) question for most. What am I going to select from references to creat Access Table with ADO 2.7?

    Thanks a mil...

    Leo
    Logic is the future...

    leokoach.com

  2. #2
    Join Date
    May 2002
    Location
    Colombo,Sri Lanka
    Posts
    1,110
    Dim conn as new adodb.connection

    conn.execute "Create Table tt ( [Fileds1] number,[Field2] text(25))"

  3. #3
    Join Date
    Sep 2001
    Location
    Québec, Canada
    Posts
    1,923
    Should also work with 2.7 ( mine with ADO 2.5)

    Code:
    Private Sub Command1_Click()
        Dim db As ADODB.Connection
        
        Set db = New ADODB.Connection
        
        db.ConnectionString = Adodc1.ConnectionString
        db.Open
        
        
        db.Execute ("CREATE TABLE TableToto(NameOfMyField1 TEXT, NameOfMyField2 TEXT)")
        
        db.Close
        
        
    End Sub
    JeffB - hope it helps

  4. #4
    Join Date
    Jul 2002
    Location
    Piscataway, NJ, USA
    Posts
    23
    Thanks
    Logic is the future...

    leokoach.com

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

Featured