Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

How to prevent dupes

Discussion in 'Information Technology' started by eadmati@yahoo.com, Nov 11, 2005.

Tags:
  1. eadmati@yahoo.com

    eadmati@yahoo.com
    Expand Collapse
    Guest

    I found this article: http://www.aspfaq.com/show.asp?id=2509. It has
    been a while since I have used SQL, and it was Oracle at the time -
    many years ago. How and where in Access does one enter the following:

    CREATE TABLE blat
    (
    email VARCHAR(128) PRIMARY KEY
    )
    GO

    Is it in the area for the existing database, and then in Tables,
    create?

    Thanks very much

    Eric
     
  2. Loading...

    Similar Threads Forum Date
    How to prevent sikh erosion? Blogs Oct 21, 2015
    Leisure Stomach Protection / Prevention for travelling to India?? Business, Lifestyle & Leisure Oct 18, 2013
    Controversial Panch Pardhani leader arrested; prevented from attending Shaheedi samagam of Bhai Jaspal Singh Hard Talk Mar 30, 2013
    World Women must play greater role in conflict prevention, UN says Breaking News Oct 28, 2011
    Sikh Coalition Bullying Prevention Summit. Register Today! Sikh Organisations Oct 19, 2011

  3. Allen Browne

    Allen Browne
    Expand Collapse
    Guest

    Interface
    ======
    To create this table in Access, you would normally use the interface:
    1. Select the Table tab of the Database window.
    2. Click New.
    3. Type your field name email, and choose the Data type Text.
    4. Click the Key icon on the toolbar to make it the primary key.
    5. Save the table with the name blat.

    SQL
    ===
    If you wanted to execute a DDL query, you could:
    1. Select the Query tab of the Database window.
    2. Click New, and close the dialogs Access offers.
    3. Switch the query to SQL View (View menu).
    4. Type in your SQL statement.
    5. Execute it by clicking Run on the Toolbar.
    I'm not sure it will recognise VARCHAR in this context.
    JET normally expects TEXT.
    For a comparison of the various names for fields, see:
    http://allenbrowne.com/ser-49.html

    Code
    ====
    If you wanted to do this in a code context, you could:
    1. Press Ctrl+G to open the Immediate window
    2. Enter this (one line):
    dbEngine(0)(0).Execute "CREATE TABLE blat (email TEXT(128) PRIMARY
    KEY)", dbFailOnError

    --
    Allen Browne - Microsoft MVP. Perth, Western Australia.
    Tips for Access users - http://allenbrowne.com/tips.html
    Reply to group, rather than allenbrowne at mvps dot org.

    <eadmati@yahoo.com> wrote in message
    news:1131668878.751860.97900@g49g2000cwa.googlegroups.com...
    >I found this article: http://www.aspfaq.com/show.asp?id=2509. It has
    > been a while since I have used SQL, and it was Oracle at the time -
    > many years ago. How and where in Access does one enter the following:
    >
    > CREATE TABLE blat
    > (
    > email VARCHAR(128) PRIMARY KEY
    > )
    > GO
    >
    > Is it in the area for the existing database, and then in Tables,
    > create?
    >
    > Thanks very much
    >
    > Eric
     

Share This Page