Results 1 to 2 of 2
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    how to create sql database in visual basic (6.0)

    I have create this little code but have a few questions:
    1) where (if is required) i insert nothing Statement
    2) I have set the filed in test as "varchar" and i donk know other... Existis a guide or a list of statement to set the fileds, for example corect sintiax for time, unique di, no null ecc...


    Private Sub Command1_Click()

    Dim objConn As ADODB.Connection
    Set objConn = New ADODB.Connection

    objConn.ConnectionString = "driver={SQL Server};server=DVD377-14D9E48CSQLEXPRESS;uid=;pwd=;database=master"
    objConn.Open

    objConn.Execute "CREATE DATABASE DATABASE15"
    objConn.Close

    objConn.ConnectionString = "driver={SQL Server};server=DVD377-14D9E48CSQLEXPRESS;uid=;pwd=;database=DATABASE15"
    objConn.Open

    'objConn.Execute "Create TABLE TABLE07" _
    & "(NAME varchar(30), AGE int)"

    objConn.Execute "Create TABLE TABLE07 (NAME varchar(30), NAME1 varchar(30))"

    objConn.Close

    End Sub

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: how to create sql database in visual basic (6.0)

    You can insert

    Set objConn

    immediately above End Sub.

    See Data Types for an overview of available data types.

Posting Permissions

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