Server.MapPath and ASP.Net
I have this code:
Code:
Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\unzipped\exceldotnet[1]\exceltest.xls;" & _
"Extended Properties=Excel 8.0;"
which works fine. I have copied the .xls-file to my project folder and tries this code:
Code:
Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & server.mappath("exceltest.xls") & ";" & _
"Extended Properties=Excel 8.0;"
But then I receive an error saying:
Code:
The Microsoft Jet database engine cannot open the file ''. It is already opened exclusively by another user, or you need permission to view its data.
What's wrong, can't I use the server.mappath?