SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    ASP Database Creation Error

    I'm using this to try to create a new Access DB:

    CREATE TABLE articles (
    articleid INT NOT NULL PRIMARY KEY,
    date DATE NOT NULL,
    title TEXT NOT NULL,
    body TEXT NOT NULL)


    I get a Syntax error in field definition error. Is my syntax off?

  2. #2
    SitePoint Wizard big_al's Avatar
    Join Date
    May 2000
    Location
    Victoria, Australia
    Posts
    1,661
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    HI,

    if you are trying to create a database your 1 step ahead of yourself you are tryig to create a table, not a database, not quite sure how you do it in access but SQL would look somthing like this.

    CREATE DATABASE SOMENAME
    ON
    (NAME = 'SomeName',
    FILENAME = 'c:\mssql7\data\SomeNAme.mdf',
    SIZE = 10,
    MAXSIZE = 50,
    FILEGROWTH = 5 )
    LOG ON
    (NAME = 'SOmeNAme',
    FILENAME = 'c:\mssql7\data\SomeName.ldf',
    SIZE = 2MB,
    MAXSIZE = 25MB,
    FILEGROWTH = 5MB )
    .NET Code Monkey

  3. #3
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    DB already created. I'm very comfortable with MySQL, and most of SQL Server, but I have no experience with Access, or creating tables in SQL Server, and the former is unfortunatly something I have to do now.

  4. #4
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Does anyone by any chance use Brinkster.com? I'm just messing around with ASP a bit and would love it if someone could walk me through a few things to get my DB up and running there.

  5. #5
    SitePoint Addict
    Join Date
    Jun 2001
    Location
    Newcastle, England
    Posts
    268
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think the problem is that one of your fields is called "date", which is a reserved word in Access. I think that if you either rename the field, or add square brackets around it (i.e. call it [date] instead), it ought to work.

  6. #6
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks very much -- that does seem to have helped. Do you know how I can set the articleid field to automatically increment, however? I find INT NOT NULL PRIMARY KEY doesn't do it.

  7. #7
    Just Blow It bronze trophy
    DaveMaxwell's Avatar
    Join Date
    Nov 1999
    Location
    Mechanicsburg, PA
    Posts
    7,263
    Mentioned
    115 Post(s)
    Tagged
    1 Thread(s)
    Try using autonumber instead of int....
    Dave Maxwell - Manage Your Site Team Leader
    My favorite YouTube Video! | Star Wars, Dr Suess Style
    Learn how to be ready for The Forums' Move to Discourse

  8. #8
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    LOL, I just found the answer not long ago. Thanks though -- you are indeed correct.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •