none
Test ODBC DSN Connectivity from command line

    Question

  • Hi ,

    Operating system : Windows 2008 Server R2 64 bit

    Database : MS Access 2003 (mdb) secured by Workgroup Information file (WGI) (placed on shared network drive)

    Created a 32 bit DSN based on above DSN.

    I want to check if DSN is connecting properly from comman line or any other way provided by OS since odbc administrator does not give functionality to test connection based on access DB.

    Any information would be appreciated !

    Regards,

    Anup Wadhekar

    Wednesday, May 28, 2014 7:28 PM

Answers

  • You could e.g. use VBScript - e.g. in an ASP page:

    - Get the right connection string for your DSN, e.g. from http://www.connectionstrings.com

    - Add the web server role with classical ASP

    - Create a new folder and add an ASP page including something like this:

    strConn = [Your connection string]
    set dbConn = Server.CreateObject("ADODB.Connection")
    dbConn.Open strConn

    - Create an application associated with this folder.

    - The application pool of IIS needs to be configured for 32bit apps. on a 64bit server (Advanced properties of the app. pool)

    It should also work without the web server, just in a script - but I think then you need to be careful to run cscript from SysWOW64 instead of system32.

    Elke

    PS: I think this is not quite the correct forum for that question but accidentally I played with similar stuff recently :-)

    Wednesday, May 28, 2014 8:15 PM
  • I has been such a long time that I used MS Access workgroup security, so I can't answer questions related to how to configure the workgroup settings and mdw file - sorry.

    In case you are looking for the connection string for connecting to a DSN over ODBC, based on an Access DB protected by workgroup security the Access section of www.connectionstrings.com says that you need:

    Driver={Microsoft Access Driver (*.mdb, *.accdb)};Dbq=C:\mydatabase.accdb;SystemDB=C:\mydatabase.mdw;

    You could test it using the VBScript method I mentioned above. But probably it would be easier just using the client application that should connect to it anyway?

    As this is a forum on Network Access Protection, that is: mainly Microsoft NPS = Microsoft's radius server and network authentication, e.g. wireless LAN, 802.1x and the like, I would recommend posting your question again to a forum dedicated to MS Access or ODBC. I couldn't just resist adding a reply as I was playing with an Access DB recently (though without workgroup security).

    Elke

    Thursday, May 29, 2014 12:16 PM
  • I did a quick search for forums concerned with ODBC, Access, etc., and it seems here people are discussing such questions:

    SQL Server Data Access forum at Technet

    I would recommend posting the question again over there!

    Elke


    Thursday, May 29, 2014 12:21 PM

All replies

  • You could e.g. use VBScript - e.g. in an ASP page:

    - Get the right connection string for your DSN, e.g. from http://www.connectionstrings.com

    - Add the web server role with classical ASP

    - Create a new folder and add an ASP page including something like this:

    strConn = [Your connection string]
    set dbConn = Server.CreateObject("ADODB.Connection")
    dbConn.Open strConn

    - Create an application associated with this folder.

    - The application pool of IIS needs to be configured for 32bit apps. on a 64bit server (Advanced properties of the app. pool)

    It should also work without the web server, just in a script - but I think then you need to be careful to run cscript from SysWOW64 instead of system32.

    Elke

    PS: I think this is not quite the correct forum for that question but accidentally I played with similar stuff recently :-)

    Wednesday, May 28, 2014 8:15 PM
  • Hi Elke,

    Thank you very much for the reply.I am using this forum first time due to which I couldn't post in the exact forum.

    I also wouldl ike to know if I want to create file DSN based on above databse what would be the content of file

    that is how would I specifuy mdb and WGi file

    Thanks in advance

    Thursday, May 29, 2014 11:55 AM
  • I has been such a long time that I used MS Access workgroup security, so I can't answer questions related to how to configure the workgroup settings and mdw file - sorry.

    In case you are looking for the connection string for connecting to a DSN over ODBC, based on an Access DB protected by workgroup security the Access section of www.connectionstrings.com says that you need:

    Driver={Microsoft Access Driver (*.mdb, *.accdb)};Dbq=C:\mydatabase.accdb;SystemDB=C:\mydatabase.mdw;

    You could test it using the VBScript method I mentioned above. But probably it would be easier just using the client application that should connect to it anyway?

    As this is a forum on Network Access Protection, that is: mainly Microsoft NPS = Microsoft's radius server and network authentication, e.g. wireless LAN, 802.1x and the like, I would recommend posting your question again to a forum dedicated to MS Access or ODBC. I couldn't just resist adding a reply as I was playing with an Access DB recently (though without workgroup security).

    Elke

    Thursday, May 29, 2014 12:16 PM
  • I did a quick search for forums concerned with ODBC, Access, etc., and it seems here people are discussing such questions:

    SQL Server Data Access forum at Technet

    I would recommend posting the question again over there!

    Elke


    Thursday, May 29, 2014 12:21 PM