Results 1 to 3 of 3
  1. #1
    johnmerlino is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Oct 2010
    Posts
    97

    command line interface for entering sql in access?

    Hey all,

    Is there a way to use mysql syntax in a command line interface in access, despite it not using mysql as its database? I'm looking to do two things:

    Compare a table with a temporary table to only show records in the table where it and the temp table have certin fields that match and where the temp table has a specific field set to a condition:
    Code:
    Select contacts.first_name, contacts.last_name, contacts.mi, contacts.address FROM contacts INNER JOIN temp_table ON (c.last_name = t.last_name && c.first_name = t.first_name) WHERE temp_table.prop = 'real';
    The other thing is two compare two tables and where last names and first names are the same, change a field of one table and update another field:

    Code:
    UPDATE contacts c
    INNER JOIN temp_table t
    ON (c.last_name = t.last_name && c.first_name = t.first_name)
    SET c.status_change = 1,
    c.updated_at = CURDATE()
    WHERE c.updated_at IS NOT NULL;
    Then I would like to save these sql statements in access for later use, using the Access built-in gui.



    Is this possible?

    Thanks for response.

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    Quote Originally Posted by johnmerlino View Post
    Hey all,

    Is there a way to use mysql syntax in a command line interface in access, despite it not using mysql as its database?
    what do you mean by this? the code example you posted looks like a PHP/MYSQL command. mysql is nothing more than a different syntax for sql, which is universal for all databases.

    for example, translating your mysql code example into the Access version of sql, you would write:
    Code:
    UPDATE contacts ( c )
    INNER JOIN temp_table ( t )
    ON (c.last_name = t.last_name)
    SET c.status_change = 1,
    c.updated_at = date()
    WHERE c.updated_at IS NOT NULL;
    that of course it just temp code, as the syntax is not entirely correct. But then again, what do you mean by your first statement?

  3. #3
    NoellaG's Avatar
    NoellaG is offline VIP
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Jun 2010
    Location
    Belgium
    Posts
    1,044
    Hi John,

    I think, for your purpose, you'd better be off with Toad as an interface on mySQL. Check out this link (it's free for mySQL):

    www.quest.com/toad-for-mysql

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Pass command line parameters
    By lanto3000 in forum Access
    Replies: 2
    Last Post: 03-21-2010, 03:53 PM
  2. Replies: 0
    Last Post: 11-23-2009, 09:19 PM
  3. Replies: 2
    Last Post: 08-28-2009, 05:16 AM
  4. Web interface
    By knightjp in forum Database Design
    Replies: 0
    Last Post: 04-01-2009, 09:31 PM
  5. Replies: 2
    Last Post: 06-25-2006, 09:04 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums