mazlina Posted August 27, 2003 Posted August 27, 2003 below is my connection string............. myConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=Server.MapPath/AttendanceReport.mdb;") i've got this error............. 'C:\WINNT\system32\Server.MapPath\AttendanceReport.mdb' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides. which means that it read the wrong path of my database. how can i make changes of my server.mappath so that it read C:\Inetpub\wwwroot......... Quote
jspencer Posted August 27, 2003 Posted August 27, 2003 Server.MapPath is a variable and shouldn't be part of the string. Try: myConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath & "/AttendanceReport.mdb;") Quote
mazlina Posted August 27, 2003 Author Posted August 27, 2003 i still got this error msg.... Format of the initialization string does not conform to specification starting at index 88. Line 63: myConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source= & Server.MapPath & '/AttendanceReport.mdb';") Quote
jspencer Posted August 27, 2003 Posted August 27, 2003 Sorry mate, it's been a while since I've done anything in asp. The connection string is more like this: "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.MapPath ("dbfolder/AttendanceReport.mdb") The hard bit is finding out the path to your database. If the dbfolder is a sub folder of wwwroot, then you can use ../dbfolder/AttendanceReport.mdb etc. It's going to be a bit of trial and error, but if you post some more information about the folder structure, then it will be easier for us. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.