I am tring to make the below application work with SQL Server 2005 Database
Currently it works for test.mdb, which is in the same folder with the application. How shoud I modify the MapPath to work with SQL Server.
Dim sDSN
' To use a DSN-Less Connection use the following sDSN definition.
' !!! By using this, UTE is able to detect Primary Keys accurately.
sDSN = "Provider=Microsoft.Jet.OLEDB.4.0;" &_
"Data Source=" & Server.MapPath("test.mdb")
' To use a DSN (ODBC) Connection use the following sDSN defintion.
' You need to setup an ODBC data source.
' !!! By using this, UTE is *NOT* always able to detect Primary Keys accurately.
' sDSN = "test"
Dim ute
Set ute = new clsUTE
ute.DBName = "TEST.MDB" ' Name of Database. For display purpose only
'ute.ReadOnly = True ' readonly mode
'ute.ListTables = False ' display toolbutton to list all tables within db
'ute.Filters = False ' display toolbutton to define and activate filters
'ute.Export = False ' display toolbutton to export all data to CSV file
'ute.SQL = False ' display toolbutton to show current sql statement
'ute.Definitions = False ' display toolbutton to show field defintions
ute.Init sDSN ' init must be called *before* any HTML code is
' is written, otherwise the export feature doesn't work !
You don’t need to use Server.MapPath to connect to a SQLServer DB, unlike an *.mdb file you are not connecting to an individual file but to a running instance of SqlServer. See connectionStrings.com for more information.
Your connection string will be something like: