Using MapPath for "Data Source"

Flovit

Member
Joined
Apr 3, 2004
Messages
18
please tell me what is its problem
thanks

Look at this part of code :
-------------
this.dbCon.ConnectionString = @"Jet OLEDB:Global Partial Bulk Ops=2;
Jet OLEDB:Registry Path=;Jet OLEDB:Database Locking Mode=1;
Data Source="+ Server.MapPath("Databse/myDB.mdb")+";";
Jet OLEDB:Engine Type=5;Provider=""Microsoft.Jet.OLEDB.4.0"";
Jet OLEDB:System database=;Jet OLEDB:SFP=False;
persist security info=False;Extended Properties=;
Mode=Share Deny None;Jet OLEDB:Encrypt Database=False;
Jet OLEDB:Create System Database=False;
Jet OLEDB:Dont Copy Locale on Compact=False;
Jet OLEDB:Compact Without Replica Repair=False;User ID=Admin;
Jet OLEDB:Global Bulk Transactions=1";

----------------------------------
 
Last edited by a moderator:
I wanted to set a custom path for my database
and using MapPath to set the location but everytime I edit it
I get an error again
If you know how I must do this please tell me
thanks
 
What error do you get though? IF you display the connectiom string in a MessageBox or TextBox does it appear correct? Check the end of the line containing the Server.MapPath - looks like there may be an extra ; involved there.
 
Im going to try more ,
but for answer of the question
I get Compile-Time Error for Syntax
and noticed about ";" by the compiler .
thanks
 
Back
Top