Help Me on this query!
-
Is this anything wrong with this query? CREATE TABLE [1384/6] (OrderTable int NOT NULL ,OrderNo int NOT NULL,OrderTypeIDn nvarchar(20) NOT NULL,Report nvarchar(254) NOT NULL,Receptionist nvarchar(50) NOT NULL ,Cashier nvarchar(254) NOT NULL,Day nvarchar(15) NOT NULL,TimeInstant nvarchar(15) NOT NULL,Description nvarchar(254) ):confused: I am using this query with OleDb on an access database. -- modified at 13:25 Wednesday 31st August, 2005
-
Is this anything wrong with this query? CREATE TABLE [1384/6] (OrderTable int NOT NULL ,OrderNo int NOT NULL,OrderTypeIDn nvarchar(20) NOT NULL,Report nvarchar(254) NOT NULL,Receptionist nvarchar(50) NOT NULL ,Cashier nvarchar(254) NOT NULL,Day nvarchar(15) NOT NULL,TimeInstant nvarchar(15) NOT NULL,Description nvarchar(254) ):confused: I am using this query with OleDb on an access database. -- modified at 13:25 Wednesday 31st August, 2005
-
Is this anything wrong with this query? CREATE TABLE [1384/6] (OrderTable int NOT NULL ,OrderNo int NOT NULL,OrderTypeIDn nvarchar(20) NOT NULL,Report nvarchar(254) NOT NULL,Receptionist nvarchar(50) NOT NULL ,Cashier nvarchar(254) NOT NULL,Day nvarchar(15) NOT NULL,TimeInstant nvarchar(15) NOT NULL,Description nvarchar(254) ):confused: I am using this query with OleDb on an access database. -- modified at 13:25 Wednesday 31st August, 2005
Hi there, As far as my knowledge goes, I dont think so you can create tables through queries in an access database.However there is an alternate way for this using the ADOX object.I am not aware of what programming language you are working on but I am quite sure if it works with asp it has to work on any microsoft platform (.Net,vb6) . Dim AccessTable as ADOX.Table AccessTable.Name = "Table1" AccessTable.Columns.Append ("Column1", adInteger) AccessTable.Columns.Append "Column2", adVarWChar, 30 AccessTable.Keys.Append ("PK_Column1", 1, "Column1") 'Add a primary key Hope this helps Mandar Patankar Microsoft Certified professional
-
Is this anything wrong with this query? CREATE TABLE [1384/6] (OrderTable int NOT NULL ,OrderNo int NOT NULL,OrderTypeIDn nvarchar(20) NOT NULL,Report nvarchar(254) NOT NULL,Receptionist nvarchar(50) NOT NULL ,Cashier nvarchar(254) NOT NULL,Day nvarchar(15) NOT NULL,TimeInstant nvarchar(15) NOT NULL,Description nvarchar(254) ):confused: I am using this query with OleDb on an access database. -- modified at 13:25 Wednesday 31st August, 2005
-
Is this anything wrong with this query? CREATE TABLE [1384/6] (OrderTable int NOT NULL ,OrderNo int NOT NULL,OrderTypeIDn nvarchar(20) NOT NULL,Report nvarchar(254) NOT NULL,Receptionist nvarchar(50) NOT NULL ,Cashier nvarchar(254) NOT NULL,Day nvarchar(15) NOT NULL,TimeInstant nvarchar(15) NOT NULL,Description nvarchar(254) ):confused: I am using this query with OleDb on an access database. -- modified at 13:25 Wednesday 31st August, 2005
[kos nagid],the problem was the day nvarchar(15) which Day is a pre reserved word for access........;P
-
[kos nagid],the problem was the day nvarchar(15) which Day is a pre reserved word for access........;P
First) If in Tools menu > Options > Tables/Queries > Is not checked "SQL Server (ANSI 92) Compatible syntax - This database" (which is IMPLICIT option in Access) then NVARCHAR is not recognise by Access. Instead you must use Text data type. Solution: query must be rewrite thus:
CREATE TABLE [1384/6] ( OrderTable int NOT NULL , OrderNo int NOT NULL, OrderTypeIDn text(20) NOT NULL, Report text(254) NOT NULL, Receptionist text(50) NOT NULL , Cashier text(254) NOT NULL, Day text(15) NOT NULL, TimeInstant text(15) NOT NULL, Description text(254) )
Second) If in Tools menu > Options > Tables/Queries > Is checked "SQL Server (ANSI 92) Compatible syntax - This database" then NVARCHAR is now recognise by Access but the problem is "Day" field name wich is reserved word because is the name of DAY function from SQL Server - DAY(date) return a integer representing number of day (between 1 and 31) Solution:CREATE TABLE [1384/6] ( OrderTable int NOT NULL , OrderNo int NOT NULL, OrderTypeIDn nvarchar(20) NOT NULL, Report nvarchar(254) NOT NULL, Receptionist nvarchar(50) NOT NULL , Cashier nvarchar(254) NOT NULL, DayField nvarchar(15) NOT NULL, TimeInstant nvarchar(15) NOT NULL, Description nvarchar(254) )
Ok ? --- object oriented uml oriented iconix oriented sql oriented truespace oriented --- solitare oriented :-)