Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Server.MapPath( )

Status
Not open for further replies.

lxon

Technical User
Aug 25, 2002
7
SG
<%
Dim strDatabaseType

'Choose one of the following two lines, and comment out the other
strDatabaseType = &quot;Access&quot;
'strDatabaseType = &quot;MSDE&quot;

'Now we use this selection to specify the connection string'
If strDatabaseType = &quot;Access&quot; Then
strConnect = &quot;Provider=Microsoft.Jet.OLEDB.4.0;&quot; & _
&quot;Data Source=Server.MapPath(&quot;new_survey.mdb&quot;);&quot; & _
&quot;Persist Security Info=False&quot;


Else
' strConnect = &quot;Provider=SQLOLEDB;Persist Security Info=False;&quot; & _
'&quot;User ID=sa;Initial Catalog=Movie;&quot; & _
'&quot;Initial File Name=C:\MSSQL7\Data\Movie2000.mdf&quot;
End If
%>

Currently this code gives me this error
Error Type:
Microsoft VBScript compilation (0x800A0401)
Expected end of statement
/AP/Web_Survey/DataStore.asp, line 11, column 29
can someone please tell me what's wrong coz i've been trying to fix the problem. Thanks a lot for any help rendered.

 
It's the extra quotes inside your server.MapPath, that stament shouldn't be aprt of the string, but concatenated in like so:
Code:
strConnect = &quot;Provider=Microsoft.Jet.OLEDB.4.0;&quot; & _
                 &quot;Data Source=&quot;&Server.MapPath(&quot;new_survey.mdb&quot;)&&quot;;&quot; & _
                 &quot;Persist Security Info=False&quot;

-Tarwn If your happy and you know it...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top