Connecting Tech Pros Worldwide Forums | Help | Site Map

Create Table

James Bond
Guest
 
Posts: n/a
#1: Jun 20 '06
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
Guest
 
Posts: n/a
#2: Jun 20 '06

re: Create Table


In article <4497d5ec$0$872$ba4acef3@news.orange.fr>,
James.Bond@Secret.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.ActiveConnection = CurrentProject.AccessConnection
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
James Bond
Guest
 
Posts: n/a
#3: Jun 20 '06

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.1f01ace486159943989681@news.psci.net...[color=blue]
> In article <4497d5ec$0$872$ba4acef3@news.orange.fr>,
> James.Bond@Secret.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.ActiveConnection = CurrentProject.AccessConnection
> 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]


Mike Gramelspacher
Guest
 
Posts: n/a
#4: Jun 20 '06

re: Create Table


In article <4497f110$0$846$ba4acef3@news.orange.fr>,
James.Bond@Secret.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
Closed Thread