Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2008

    Unanswered: why table name is required?

    what is the difference between table_name.Colum and colum when write sql quries for access?

    When i coded in
    "select * from table_name where colum=50"

    return nothing bu after chancing my code like

    "select * from table_name where table_name.colum=50"

    it is working. in vb6 firts code was working also my workbook use first code all examples. So where is the problem?

  2. #2
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    some SQL engines are more picky about the format of the SQL.

    however my version of Access (OfficeXP / 2003) using JET 4.1 (I think) accepts either format. the only time I've had to overtly declare the table name in a where clause is if there is ambiguity in a where clause (ie you have more than one column with the same name). Although many would argue its good practise to fully qualify each element, which is the behaviour of the query designer, but that also adds brackets like there is no tomorrow

    all in all another good reason in my books never to use select *.. its just plain lazy SQL development

Posting Permissions

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