#Can't insert values into Access Database

17 messages · Page 1 of 1 (latest)

deep sigil
marble violetBOT
#

This post has been reserved for your question.

Hey @deep sigil! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

deep sigil
#

what I'm I missing here

fluid ivy
#

i guess that's AutoNumber? in which case i'm not sure how you can ask access to autogenerate an id from JDBC

#

maybe try giving 0 or something

#

oh it looks like a foreign key constraint actually, i guess a contact belongs to a client

#

in that case you need to specify the client this contact is for?

deep sigil
#

String sql = "INSERT INTO Contacts (Client_Name, Client_LastName) VALUES " + "('Test', 'TestTest')";

#

so u can see ID_Client is a primary key

#

the rest are regular

#

I don't think It's going to work if I just specified ID_Client nad VALUES ('0') to it, I've tried it and I got a different error.

#

or do I just change the data type for the primary key to auto since In my opition if I haven't specified it, would just give a auto number ?