Create Table

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • James Bond

    #1

    Create Table

    Hello,

    i create a Table in Access via SQL

    CREATE TABLE CRITERES (
    [CRT_CODE] VARCHAR(15) NOT NULL,
    [CRT_FIELDNAME] VARCHAR(30) NOT NULL,
    [CRT_NUMERO] INTEGER NULL,
    [CRT_LIBELLE] VARCHAR(50) NULL)

    but, the field CRT_LIBELLE must be filled and cannot be empty.

    I got a error when i do : (because CRT_LIBELLE is empty)

    INSERT INTO CRITERES VALUES ('TOTO', 'TITI', 0, '')


    Chaine vide authorisée : Non

    How can i do to put YES (to allow empty string) via SQL ?
    Comment faire pour y mettre oui en passant par SQL ?


  • Mike Gramelspacher

    #2
    Re: Create Table

    In article <4497d5ec$0$872 $ba4acef3@news. orange.fr>,
    James.Bond@Secr et.com says...[color=blue]
    > INSERT INTO CRITERES VALUES ('TOTO', 'TITI', 0, '')
    >[/color]
    I just pasted your DDL into Access SQL query view, saved it and ran it.
    No problem.

    I then ran the INSERT statement. No problem

    Sub test()
    Dim cmd As New ADODB.Command
    Dim strSQL As String

    cmd.ActiveConne ction = CurrentProject. AccessConnectio n
    strSQL = "INSERT INTO CRITERES VALUES ('TOTO', 'TITI', 0, '')"
    cmd.CommandText = strSQL
    cmd.Execute
    End Sub

    No idea why it did not work for you.

    Mike GRamelspacher

    Comment

    • James Bond

      #3
      Re: Create Table

      Because i don't do it in Access but via Delphi !

      "Mike Gramelspacher" <gramelsp@psci. net> a écrit dans le message de news:
      MPG.1f01ace4861 59943989681@new s.psci.net...[color=blue]
      > In article <4497d5ec$0$872 $ba4acef3@news. orange.fr>,
      > James.Bond@Secr et.com says...[color=green]
      >> INSERT INTO CRITERES VALUES ('TOTO', 'TITI', 0, '')
      >>[/color]
      > I just pasted your DDL into Access SQL query view, saved it and ran it.
      > No problem.
      >
      > I then ran the INSERT statement. No problem
      >
      > Sub test()
      > Dim cmd As New ADODB.Command
      > Dim strSQL As String
      >
      > cmd.ActiveConne ction = CurrentProject. AccessConnectio n
      > strSQL = "INSERT INTO CRITERES VALUES ('TOTO', 'TITI', 0, '')"
      > cmd.CommandText = strSQL
      > cmd.Execute
      > End Sub
      >
      > No idea why it did not work for you.
      >
      > Mike GRamelspacher[/color]


      Comment

      • Mike Gramelspacher

        #4
        Re: Create Table

        In article <4497f110$0$846 $ba4acef3@news. orange.fr>,
        James.Bond@Secr et.com says...[color=blue]
        > Because i don't do it in Access but via Delphi ![/color]

        Sorry. I must have overlooked the part about Delphi. Perhaps ask in a
        Delphi newsgroup.

        Mike Gramelspacher

        Comment

        Working...