Find what table a field came from


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 9 of 9

Thread: Find what table a field came from

  1. #1
    Frank Guest

    Find what table a field came from


    After bringing a query back in ADO i need to know what table each field came
    from. Is there a way in ADO that will tell me the table a field came from?

    Thanks

  2. #2
    Douglas J. Steele Guest

    Re: Find what table a field came from

    Um, it's your query. Shouldn't you know what table each field comes from?

    --
    Doug Steele, Microsoft Access MVP
    http://I.Am/DougSteele


    "Frank" <helisomedicali@perneliiint.co.it> wrote in message
    news:3dbd1dae$1@tnews.web.devx.com...
    >
    > After bringing a query back in ADO i need to know what table each field

    came
    > from. Is there a way in ADO that will tell me the table a field came from?
    >
    > Thanks




  3. #3
    Paul Clement Guest

    Re: Find what table a field came from

    On 28 Oct 2002 03:21:18 -0700, "Frank" <helisomedicali@perneliiint.co.it> wrote:


    After bringing a query back in ADO i need to know what table each field came
    from. Is there a way in ADO that will tell me the table a field came from?

    If you are selecting from multiple tables you will need to rename the field using the As keyword in
    your SQL statement. Using this method you can prefix (or append to) the field name with the table
    name.

    I know of no way to do this dynamically.


    Paul ~~~ pclement@ameritech.net
    Microsoft MVP (Visual Basic)

  4. #4
    Guest

    Re: Find what table a field came from


    "Frank" <helisomedicali@perneliiint.co.it> wrote:
    >
    >After bringing a query back in ADO i need to know what table each field

    came
    >from. Is there a way in ADO that will tell me the table a field came from?
    >
    >Thanks



  5. #5
    sdfsdgsd Guest

    Re: Find what table a field came from


    "Frank" <helisomedicali@perneliiint.co.it> wrote:
    >
    >After bringing a query back in ADO i need to know what table each field

    came
    >from. Is there a way in ADO that will tell me the table a field came from?
    >
    >Thanks



  6. #6
    Joe Maki Guest

    Re: Find what table a field came from


    "Frank" <helisomedicali@perneliiint.co.it> wrote:
    >
    >After bringing a query back in ADO i need to know what table each field

    came
    >from. Is there a way in ADO that will tell me the table a field came from?
    >
    >Thanks


    Frank try: .Fields("FieldName").Properties("BASETABLENAME")

    I've only needed to use this a few times so I'm not sure how reliable it
    is in complex joins.

    ...joe



  7. #7
    Joe Maki Guest

    Re: Find what table a field came from


    "Joe Maki" <jmaki@customerlinkone.com> wrote:
    >
    >"Frank" <helisomedicali@perneliiint.co.it> wrote:
    >>
    >>After bringing a query back in ADO i need to know what table each field

    >came
    >>from. Is there a way in ADO that will tell me the table a field came from?
    >>
    >>Thanks

    >
    >Frank try: .Fields("FieldName").Properties("BASETABLENAME")
    >
    >I've only needed to use this a few times so I'm not sure how reliable it
    >is in complex joins.
    >
    >...joe
    >
    >


    Here are the other properties available:
    OPTIMIZE
    KEYCOLUMN
    OCTETLENGTH
    ISUNIQUE
    ISSEARCHABLE
    ISCASESENSITIVE
    ISAUTOINCREMENT
    HASDEFAULT
    DOMAINNAME
    DOMAINSCHEMA
    DOMAINCATALOG
    DEFAULTVALUE
    DATETIMEPRECISION
    COMPUTEMODE
    COLLATINGSEQUENCE
    CLSID
    BASETABLENAME
    BASESCHEMANAME
    BASECOLUMNNAME
    BASECATALOGNAME

    You can using the BASETABLENAME and BASECOLUMNNAME properties identify the
    original source of an aliased field.

    ...joe

  8. #8
    Bernie Guest

    Re: Find what table a field came from


    >
    >Here are the other properties available:
    >OPTIMIZE
    >KEYCOLUMN
    >OCTETLENGTH
    >ISUNIQUE
    >ISSEARCHABLE
    >ISCASESENSITIVE
    >ISAUTOINCREMENT
    >HASDEFAULT
    >DOMAINNAME
    >DOMAINSCHEMA
    >DOMAINCATALOG
    >DEFAULTVALUE
    >DATETIMEPRECISION
    >COMPUTEMODE
    >COLLATINGSEQUENCE
    >CLSID
    >BASETABLENAME
    >BASESCHEMANAME
    >BASECOLUMNNAME
    >BASECATALOGNAME
    >
    >You can using the BASETABLENAME and BASECOLUMNNAME properties identify the
    >original source of an aliased field.
    >
    >...joe


    Hi,

    The Properties collection of the Field-object is Provider-dependant meaning
    they aren't exactly the same among different databases. List all of them
    for the particular provider you are using by running a loop and print the
    names for all of them to the debug-window.

    Bernie


  9. #9
    Joe Maki Guest

    Re: Find what table a field came from


    "Bernie" <magnus.bernroth@rejlers.se> wrote:
    >The Properties collection of the Field-object is Provider-dependant meaning
    >they aren't exactly the same among different databases. List all of them
    >for the particular provider you are using by running a loop and print the
    >names for all of them to the debug-window.
    >
    >Bernie
    >


    Good point, I forget since I always connect to SQL Server <g>

    ...joe


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center