SIMIN Posted March 23, 2008 Posted March 23, 2008 Hi, I want to create a table in my database, and also create a field in it named "Names" which is text, and also set a primary key named ID. So I use this string connection: "CREATE TABLE '" + TableTextBoxX.Text + "' (ID INT PRIMARY KEY, Names Text(255))" But I get syntax error! I played around with that but could not find how it should be correct! Please help me:( Quote
Administrators PlausiblyDamp Posted March 23, 2008 Administrators Posted March 23, 2008 Does the table name need the single quotes around it? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
SIMIN Posted March 24, 2008 Author Posted March 24, 2008 PlausiblyDamp really thank you! you are great! It works now, just one problem is that it does not create the primary key for my table I want ID to be primary key. Where I am wrong? :confused: Quote
Administrators PlausiblyDamp Posted March 24, 2008 Administrators Posted March 24, 2008 IIRC that syntax should work for access - are you getting any errors? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
SIMIN Posted March 24, 2008 Author Posted March 24, 2008 No, thanks:) My problem solved! God bless you, you are very kind! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.