Hi. I am being dumb and I just can see what I am sure is a simple issue. Sorry in advance. I am trying to help my son with his school project which requires demonstrating SQL coding. I have created a table using SQL (Access DB set to SQL standard):
Code:
CREATE TABLE Customer(CustomerEmail VARCHAR(30) NOT NULL, CustomerFirstname VARCHAR(20) NOT NULL,CustomerLastname VARCHAR(20) NOT NULL, CustomerTel VARCHAR(20), HouseNoName VARCHAR(15) NOT NULL,PostCode VARCHAR(6) NOT NULL,City VARCHAR(30) NOT NULL,County VARCHAR(20) ,Country VARCHAR(15) NOT NULL,CustomerAge INTEGER, CustomerType CHAR(2) NOT NULL, CONSTRAINT CUSTPK PRIMARY KEY(CustomerEmail), CONSTRAINT CUSTTPE FOREIGN KEY(CustomerType) REFERENCES CustomerType(CustomerType) ON UPDATE CASCADE ON DELETE CASCADE);
This seems to create the table fine. I can manually enter the data into each field in the datasheet view in Access.
Now I am trying to insert data using SQL. I find some of the fields are accepted but others think the contents are labels and asks me to enter the data at run time. I cant figure out why. I have put various different formats to try to see what causes some fields to work and other not to work but I am really at a loss as some work fine and the same formatting makes other not work!. The test insert is:
Code:
INSERT INTO CUSTOMERVALUES (Chr$(39) & tonyggatuk.co.uk & Chr$(39), Tony , Grant, 01234567889, '85', 'AL 1234', 'Bister', 'herts', 'uk', 52, WK);
I find fields 1 to 3 at run time it asks me to enter the data in a pop up. 4 - 10 are populated correctly and field 11 is again requesting data in a pop up. I dont understand why for example field 3 is treated differently than field 4? Any help in explaining what is going on would greatly be appreciated.
MANY THANKS
Tony