Results 1 to 2 of 2

Thread: VBS and SQL

  1. #1
    Guest
    I cannot get the following code to work:

    SELECT [Declares].[Name] INTO [Temporary Table]
    FROM [Declares] in "C:\open.mdb" LEFT JOIN [new Trial] ON
    [Declares].[Name] = [new Trial].[New Src Var]
    GROUP BY [Name]
    HAVING ((([new Trial].[New Src Var]) Is Null));

    c:\open.mdb exists and contains the table declares with the appropriate variables.

    [new trial] exists in the executing database, with the appropriate variables.

    Syntax error in FROM clause is the error message.

    Any suggestions? I'm probably doing something stupid, but for the life of me I can't see it.

    Thanks
    DerFarm

  2. #2
    Guest
    Ok, the answer (I just found out) is that you can only reference ONE database in a query....at least as far as VB and Access are concerned.

    Once you have referenced the first database (IN .....) you are stuck with the tables/queries that exist there. Obviously this does not address the linked tables.

    For an interesting experience try this in a blank sql qrid in Access:

    SELECT Declares.Name INTO [Temporary Table]
    FROM Declares IN 'C:\open.mdb';

    Now click the blue title bar and select "query design".
    Now select the Query->Show table from the menu.

    The only tables you have access to are the tables in the foreign database.

    Weirdness...I don't do weirdness....

    DerFarm

Posting Permissions

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



Click Here to Expand Forum to Full Width