Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Help Me on this query!

Help Me on this query!

Scheduled Pinned Locked Moved Database
databasehelpquestion
6 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    arashrajaei
    wrote on last edited by
    #1

    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

    S M A A 4 Replies Last reply
    0
    • A arashrajaei

      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

      S Offline
      S Offline
      softty
      wrote on last edited by
      #2

      Did you check up datatype ?? I mean comatibility of nvarchar ??? love2code

      1 Reply Last reply
      0
      • A arashrajaei

        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

        M Offline
        M Offline
        Mandar Patankar
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        • A arashrajaei

          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

          A Offline
          A Offline
          airbus380
          wrote on last edited by
          #4

          Access doesn't recognise nvarchar data type. You must replace nvachar data type with text !

          1 Reply Last reply
          0
          • A arashrajaei

            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

            A Offline
            A Offline
            arashrajaei
            wrote on last edited by
            #5

            [kos nagid],the problem was the day nvarchar(15) which Day is a pre reserved word for access........;P

            A 1 Reply Last reply
            0
            • A arashrajaei

              [kos nagid],the problem was the day nvarchar(15) which Day is a pre reserved word for access........;P

              A Offline
              A Offline
              airbus380
              wrote on last edited by
              #6

              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 :-)

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups