Results 1 to 7 of 7
  1. #1
    Join Date
    Jan 2003
    Posts
    54

    Unanswered: Syntaxe d'ajout de champ

    Ou puis je trouver la liste des champs compréhensible par Access et SQL.

    C'est à dire , si j'ajoute un champs dans une table :
    exemple :

    alter table dgl add (addresse varchar(50)) ;

    ici j'ai utlisé "varchar"

    comment connaitre tous le stype de champ reconnus par Access
    et utilisable dans un commande SQL.

    Et si possible les équivalences sur SQLserver , MySQL , Oracle.

    Merci pour toute information.
    Pierre.
    Pierre (Pl-Arts)

  2. #2
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    This is an English speaking forum! Please repost your problem in English if you want us to be able to help you.
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  3. #3
    Join Date
    Jan 2003
    Posts
    54
    Where can I find this of syntax fields type to be used under SQL to add a table in Access.

    I mean, If I add a field in a table :
    Example :
    alter table dgl add (addresse varchar(50)) ;

    I used here varchar(50)

    How to know all existing type of fields which can be used under SQL
    for Access.

    And if possible, all equivalence for SQLserver, MySQL, Oracle.

    Thanks for any information.
    Pierre.
    Pierre (Pl-Arts)

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    Like virtually every SQL engine Access departs form the SQL standard, some would argue that Access's variation is the largest / most significant).

    Access doesn't support the varchar data type

    what t does do is have either TEXT or MEMO datya types

    TEXT is equivalent to Char, so you can specify Text(50) in place of varchar(50)

    MEMO mimics the varchar (and blob) datatypes in some ways ie it is an unspecified length.. I think up to 2096 chars off hand.. I forget. However as you are limiting your varchar column to 50 id recommend going with a text(50)
    I'd rather be riding on the Tiger 800 or the Norton

  5. #5
    Join Date
    Nov 2004
    Location
    Norway
    Posts
    441
    healdem, there's the frontend (Access) and the database engine (Jet).

    Jet does indeed support both Varchar and Longtext, if executed through an ADO/OLEDB connection.

    dim cn as adodb.connection
    set cn = currentproject.connection ' or open a connection
    cn.execute "ALTER TABLE myTable ADD COLUMN myText Varchar(25), myMemo LongText"

    Note - Jet also supporst CHAR - but be aware that this will produce a fixed width text field vs Varchar which is variable length.

    Access also supports varchar/longtext, but not in the default "dialect" which is "ANSI 89" mode. You can, however, choose "ANSI 92" syntax (Tools | Options | tables/queries tab - SQL Server Compatible Syntax (ANSI 92)), in which mode the above statement will run in the query designer.

    In the 2007 version, I don't think you need to make any change for it to work.

    One might find more information for instance here http://msdn2.microsoft.com/en-us/lib...ffice.10).aspx also check out the two other articles linked to at the bottom.
    Roy-Vidar

  6. #6
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Accesss data types from memory:
    • Text
    • Memo
    • Number
    • AutoNumber
    • Date/Time
    • Currency
    • Object (?)
    • Hyperlink (?)
    George
    Home | Blog

  7. #7
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    Quote Originally Posted by RoyVidar
    healdem, there's the frontend (Access) and the database engine (Jet).

    Jet does indeed support both Varchar and Longtext, if executed through an ADO/OLEDB connection.
    ...interesting.. hadn't realised that JET could support Varchar.. but then again, Ive only used JET inside an Access front end thanks for that RoyVidar.

    BTW I am very aware that Access isnt a db.. and that JET is the default, but by no means only back end.. I felt it may cause a potential for confusion for Plarde by referring to JET.
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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