Results 1 to 4 of 4
  1. #1
    tfulmer is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2011
    Location
    Austin, Texas
    Posts
    19

    Column assignments in an INSERT INTO type of query.


    Self taught access user that doesn't understand how a 3rd party is doing something. I would appreciate any help in getting an explanation.

    I examined the sql that a 3rd party utilizes and I don't understand how they are getting it to work. The 3rd party sends me text files, empty tables in an mdb, and action queries in the mdb. The SQL in the action queries use INSERT INTO statements. When I execute the queries, the empty tables become populated with the text file data.

    Code:
    INSERT INTO PROP_ENT ( prop_id, prop_val_yr,....) SELECT  PROP_ENT_TXT.prop_id, PROP_ENT_TXT.prop_val_yr,...) FROM PROP_ENT_TXT;
    My lack of understanding comes from the fact that the SELECT part of the statement references various source fields when in fact the text files don't have source field names. I pop open the text files in a text editor and I don't see any type of delimiters.

    I would appreciate if someone could take a minute and explain to me how this is working without field names being assigned in the text files.

    Thanks for helping out a novice user.

    Tom in Austin, Texas

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    49,150
    The mdb must have link set to text file. The link is probably set up with wizard through which the delimiter and field names are established. I suspect the delimiter used is space.

    Why doesn't 3rd party just import the data instead of simply setting link? It's the same wizard.

    That SQL snip you show has an extra ).
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    tfulmer is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jul 2011
    Location
    Austin, Texas
    Posts
    19
    Thanks.
    Is there a way that I can see where they have done this?

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    49,150
    In the navigation pane, linked datasource will have a little arrow at the left
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. INSERT query: insert new data only
    By drh in forum Access
    Replies: 2
    Last Post: 04-04-2014, 05:31 PM
  2. Replies: 87
    Last Post: 05-21-2013, 11:48 PM
  3. Insert Into = Type Mismatch
    By joelmeaders in forum Queries
    Replies: 3
    Last Post: 02-07-2012, 11:52 AM
  4. Import to Excel from Access column of LOOKUP data type
    By Derek in forum Import/Export Data
    Replies: 1
    Last Post: 12-06-2010, 06:27 PM
  5. Attachment data type INSERT INTO not working
    By LouisLouis in forum Programming
    Replies: 0
    Last Post: 09-27-2009, 02:23 PM

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 - Senior Forums