kvarnerexpress 0 Report post Posted November 8, 2005 I'm trying to learn asp using vbscript and am specifically trying to connect to a database.I am getting the following error from the following code:Quote: Server.MapPath(), ASP 0172 (0x80004005)The Path parameter for the MapPath method must be a virtual path. A physical path was used./html/objconn.asp, line 11 The code is as follows.Code:set conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open(Server.Mappath("C:\Documents and Settings\jk\My Documents\testdb.mdb"))set rs = Server.CreateObject("ADODB.recordset")rs.Open "SELECT Companyname, Contactname FROM Customers", conn Would very much appreciate any help as to where i'm going wrong here. Many Thanks,kvarnerexpress Share this post Link to post Share on other sites
magiccode9 0 Report post Posted November 9, 2005 Server.MapPath(), ASP 0172 (0x80004005) The Path parameter for the MapPath method must be a virtual path. A physical path was used. /html/objconn.asp, line 11 as you can see, the error message stated that you should provide a virtual path instead of physical path, so, in this case: virtual path means the url address exclude the domain name parts, for instance, the url of http://forums.xisto.com/no_longer_exists/ would be /forum/admin. physical path means from local drive name + path to resourse data, for instance, as your code written in above post. since then, have a change the Server.MapPath(physical path) statement to Server.MapPath(virtual path). P.S. FYI, virtual path you provides can be relative virtual path. and you go here to learn more. - hope this help Share this post Link to post Share on other sites