Hi Everyone,

I've been trying to create a table in MS Access with PHP/Apache using ODBC.

I can create a simple table, but the problem is when I add the PRIMARY KEY attribute to the ir_no field it returns an error.

The SQL code is as follows:

Code:
		$sql = "CREATE TABLE Incident (" .
		"ir_no INT PRIMARY KEY, " .
		"vendor_incident_no INT, " .
		"date_raised DATE NOT NULL, " .
		"short_desc TEXT, " .
		"review_comments TEXT, " .
		"raised_by INT NOT NULL, " .
		"severity INT NOT NULL, " .
		"application INT NOT NULL, " .
		"priority INT NOT NULL, " .
		"status INT NOT NULL " .
		")";

		$cur = odbc_exec( $cnx, $sql );
When I take out the PRIMARY KEY attribute, it works fine! But as soon as I add it back, no joy. It's enough to make you cry!

Also, I want the ir_no field to be auto incremented. I tried adding the AUTO_INCREMENT attribute to the ir_no field, but again it didn't like the SQL statement.

What am I doing wrong???

Thanks, and merry Christmas!