CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2003
    Posts
    6

    boolean field in create table query

    hello
    i am writing a query to create table which contains boolean fields
    i tried following code but getting syntax error.

    con.execute "create table exa (boolean paper('TRUE','FALSE'),boolean TW('TRUE','FALSE'))"
    can anybody help me to solve the prob
    thanks

  2. #2
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726
    if it is access:
    Code:
    Option Explicit
    Const dbPathName As String = "Data Source=D:\Cimperiali\Vb\Office\Access\ImportFile\db1.mdb"
    Private Sub Command1_Click()
        Dim strSql As String
        strSql = "Create table abc (paper yesno, Twa yesno)"
        Dim cnn As ADODB.Connection
        Set cnn = New ADODB.Connection
        cnn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & dbPathName
        cnn.Open
        cnn.Execute strSql
        cnn.Close
        Set cnn = Nothing
    End Sub
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

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