Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2004
    Location
    Dallas, TX
    Posts
    77

    Unanswered: how can i get the link table's DSN and database name?

    how to write the code to get the linked table's DSN and Databasename?
    as i know the table.connect can return string with all the information with it. But i can't seperate it out.

    or anybody know how to get the substring of a string?
    for example i has string: ODBC;DSN=XXX;DATABASE=YYYYY
    since XXX, and YYY length is unsure, so how can i get the string xxx and yyy?

    thanks a llt

  2. #2
    Join Date
    Sep 2004
    Posts
    161
    Use the mid function and instr
    DSNName=Mid(Table.connect,Instr(1, Table.connect,"DSN=")+4, instr(Instr(1, Table.connect,"DSN="),Table.connect,";"))
    I have not try this syntax and you must make some adjust.

  3. #3
    Join Date
    Sep 2004
    Location
    Dallas, TX
    Posts
    77
    thanks a lot. it's working
    I don't know the instr function before. this one give me good idea how to get substring.

    million thanks

Posting Permissions

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