Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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.........

Posted

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;")

Posted

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';")

Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...