Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Do I have the right DSN for a linked table?

Discussion in 'Information Technology' started by Dennis, Jul 28, 2006.

  1. Dennis

    Dennis
    Expand Collapse
    Guest

    Here's the situation (Access 2002). Many of my agency's applications use
    linked tables (to SQL tables). Is there a way that I can "test" to see, table
    by table, whether or not a user has the correct DSN/ODBC connection(s) to
    access the table(s)?

    What I want to do is spin through each table, checking to see if it's
    accessible. If not, I want to generate a MsgBox, saying something like:

    "You do not currently have the correct DSN setup for table 'myTable'. Please
    contact the Helpdesk for assistance."

    I'd rather do that than have to trap an error in a critical routine
    somewhere else in the application. I can run this module right at startup,
    and let a (new?) user know that they need something setup before they can run
    the application.

    Any ideas would be MOST appreciated.

    Thanks!!
     
  2. Loading...


  3. Douglas J Steele

    Douglas J Steele
    Expand Collapse
    Guest

    Look at the Connect property of the table. The DSN name will be contained as
    part of it.

    --
    Doug Steele, Microsoft Access MVP
    http://I.Am/DougSteele
    (no e-mails, please!)


    "Dennis" <Dennis@discussions.microsoft.com> wrote in message
    news:C3A71FE4-1E92-477C-BB73-9905C47CE01F@microsoft.com...
    > Here's the situation (Access 2002). Many of my agency's applications use
    > linked tables (to SQL tables). Is there a way that I can "test" to see,

    table
    > by table, whether or not a user has the correct DSN/ODBC connection(s) to
    > access the table(s)?
    >
    > What I want to do is spin through each table, checking to see if it's
    > accessible. If not, I want to generate a MsgBox, saying something like:
    >
    > "You do not currently have the correct DSN setup for table 'myTable'.

    Please
    > contact the Helpdesk for assistance."
    >
    > I'd rather do that than have to trap an error in a critical routine
    > somewhere else in the application. I can run this module right at startup,
    > and let a (new?) user know that they need something setup before they can

    run
    > the application.
    >
    > Any ideas would be MOST appreciated.
    >
    > Thanks!!
     
  4. Dennis

    Dennis
    Expand Collapse
    Guest

    Okay. But how do I *use* that? I understand that I can view the DSN name, but
    how do I check to see if the user has that one defined on his PC?

    "Douglas J Steele" wrote:

    > Look at the Connect property of the table. The DSN name will be contained as
    > part of it.
    >
    > --
    > Doug Steele, Microsoft Access MVP
    > http://I.Am/DougSteele
    > (no e-mails, please!)
    >
    >
    > "Dennis" <Dennis@discussions.microsoft.com> wrote in message
    > news:C3A71FE4-1E92-477C-BB73-9905C47CE01F@microsoft.com...
    > > Here's the situation (Access 2002). Many of my agency's applications use
    > > linked tables (to SQL tables). Is there a way that I can "test" to see,

    > table
    > > by table, whether or not a user has the correct DSN/ODBC connection(s) to
    > > access the table(s)?
    > >
    > > What I want to do is spin through each table, checking to see if it's
    > > accessible. If not, I want to generate a MsgBox, saying something like:
    > >
    > > "You do not currently have the correct DSN setup for table 'myTable'.

    > Please
    > > contact the Helpdesk for assistance."
    > >
    > > I'd rather do that than have to trap an error in a critical routine
    > > somewhere else in the application. I can run this module right at startup,
    > > and let a (new?) user know that they need something setup before they can

    > run
    > > the application.
    > >
    > > Any ideas would be MOST appreciated.
    > >
    > > Thanks!!

    >
    >
    >
     
  5. Douglas J Steele

    Douglas J Steele
    Expand Collapse
    Guest

    Sorry, I thought you were wanting to check that they were linked using the
    correct DSN.

    DSN information is simply stored in the registry.

    User DSNs are under HKCU\Software\ODBC, System DSNs are under
    HKLM\Software\ODBC

    Grab code that can read the registry (like, for instance,
    http://www.mvps.org/access/api/api0015.htm at "The Access Web") and check
    whether the necessary key(s) exist.

    --
    Doug Steele, Microsoft Access MVP
    http://I.Am/DougSteele
    (no e-mails, please!)


    "Dennis" <Dennis@discussions.microsoft.com> wrote in message
    news:337C8E5A-75B7-4AA8-B1FB-2C05488734E6@microsoft.com...
    > Okay. But how do I *use* that? I understand that I can view the DSN name,

    but
    > how do I check to see if the user has that one defined on his PC?
    >
    > "Douglas J Steele" wrote:
    >
    > > Look at the Connect property of the table. The DSN name will be

    contained as
    > > part of it.
    > >
    > > --
    > > Doug Steele, Microsoft Access MVP
    > > http://I.Am/DougSteele
    > > (no e-mails, please!)
    > >
    > >
    > > "Dennis" <Dennis@discussions.microsoft.com> wrote in message
    > > news:C3A71FE4-1E92-477C-BB73-9905C47CE01F@microsoft.com...
    > > > Here's the situation (Access 2002). Many of my agency's applications

    use
    > > > linked tables (to SQL tables). Is there a way that I can "test" to

    see,
    > > table
    > > > by table, whether or not a user has the correct DSN/ODBC connection(s)

    to
    > > > access the table(s)?
    > > >
    > > > What I want to do is spin through each table, checking to see if it's
    > > > accessible. If not, I want to generate a MsgBox, saying something

    like:
    > > >
    > > > "You do not currently have the correct DSN setup for table 'myTable'.

    > > Please
    > > > contact the Helpdesk for assistance."
    > > >
    > > > I'd rather do that than have to trap an error in a critical routine
    > > > somewhere else in the application. I can run this module right at

    startup,
    > > > and let a (new?) user know that they need something setup before they

    can
    > > run
    > > > the application.
    > > >
    > > > Any ideas would be MOST appreciated.
    > > >
    > > > Thanks!!

    > >
    > >
    > >
     
  6. Dennis

    Dennis
    Expand Collapse
    Guest

    I'll look into this. Thanks for the info!

    "Douglas J Steele" wrote:

    > Sorry, I thought you were wanting to check that they were linked using the
    > correct DSN.
    >
    > DSN information is simply stored in the registry.
    >
    > User DSNs are under HKCU\Software\ODBC, System DSNs are under
    > HKLM\Software\ODBC
    >
    > Grab code that can read the registry (like, for instance,
    > http://www.mvps.org/access/api/api0015.htm at "The Access Web") and check
    > whether the necessary key(s) exist.
    >
    > --
    > Doug Steele, Microsoft Access MVP
    > http://I.Am/DougSteele
    > (no e-mails, please!)
    >
    >
    > "Dennis" <Dennis@discussions.microsoft.com> wrote in message
    > news:337C8E5A-75B7-4AA8-B1FB-2C05488734E6@microsoft.com...
    > > Okay. But how do I *use* that? I understand that I can view the DSN name,

    > but
    > > how do I check to see if the user has that one defined on his PC?
    > >
    > > "Douglas J Steele" wrote:
    > >
    > > > Look at the Connect property of the table. The DSN name will be

    > contained as
    > > > part of it.
    > > >
    > > > --
    > > > Doug Steele, Microsoft Access MVP
    > > > http://I.Am/DougSteele
    > > > (no e-mails, please!)
    > > >
    > > >
    > > > "Dennis" <Dennis@discussions.microsoft.com> wrote in message
    > > > news:C3A71FE4-1E92-477C-BB73-9905C47CE01F@microsoft.com...
    > > > > Here's the situation (Access 2002). Many of my agency's applications

    > use
    > > > > linked tables (to SQL tables). Is there a way that I can "test" to

    > see,
    > > > table
    > > > > by table, whether or not a user has the correct DSN/ODBC connection(s)

    > to
    > > > > access the table(s)?
    > > > >
    > > > > What I want to do is spin through each table, checking to see if it's
    > > > > accessible. If not, I want to generate a MsgBox, saying something

    > like:
    > > > >
    > > > > "You do not currently have the correct DSN setup for table 'myTable'.
    > > > Please
    > > > > contact the Helpdesk for assistance."
    > > > >
    > > > > I'd rather do that than have to trap an error in a critical routine
    > > > > somewhere else in the application. I can run this module right at

    > startup,
    > > > > and let a (new?) user know that they need something setup before they

    > can
    > > > run
    > > > > the application.
    > > > >
    > > > > Any ideas would be MOST appreciated.
    > > > >
    > > > > Thanks!!
    > > >
    > > >
    > > >

    >
    >
    >
     

Share This Page