create DSN linked to Access database

  • Hello,

    How to create DSN linked to Access database from batch file?

  • You are going to need to do it in vb script. Friend of mine gave me this link but I did not end up trying at as the infrastructure guys found a better way.

     

    http://www.databasejournal.com/features/mssql/article.php/2238221


    ------------------------------
    The Users are always right - when I'm not wrong!

  • Use ADP in access. It is best way to do it.

  • If you're doing this from within Access, you can use the RegisterDatabase method, like below...

        strAttributes = "Database=yourDBname" & vbCr _

                      & "Description=yourDescription" & vbCr _

                      & "OemToAnsi=No" & vbCr _

                      & "Trusted_Connection=Yes" & vbCr _

                      & "Server=yourServerName"

        DBEngine.RegisterDatabase "yourDSNname", "SQL Server", True, strAttributes

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply