473,811 Members | 2,971 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

relative path problem

Hello,

I need to use a relative URL path instead of the system path inside the
<wmx:> tag in the following code:

<wmx:AccessData SourceControl id="AccessDataS ourceControl1" runat="server"
SelectCommand=" SELECT * FROM [ContactInfo]"
ConnectionStrin g="Provider=Mic rosoft.Jet.OLED B.4.0; Ole DB Services=-4; Data
Source=D:/nrcweb2/db/contact.mdb"></wmx:AccessDataS ourceControl>
I have tried to do it this way,

<wmx:AccessData SourceControl id="AccessDataS ourceControl1" runat="server"
SelectCommand=" SELECT * FROM [ContactInfo]"
ConnectionStrin g="Provider=Mic rosoft.Jet.OLED B.4.0; Ole DB Services=-4; Data
Source=" &
Server.MapPath(/nrcweb2/db/contact.mdb")></wmx:AccessDataS ourceControl>

But I always get a parser error. It seems that functions cannot be evaluated
within the tag.

Please help me

Thank you

Mostafa
Nov 17 '05 #1
4 2390
You need to include the vb.net code within server script tags like so:

<wmx:AccessData SourceControl id="AccessDataS ourceControl1" runat="server"
SelectCommand=" SELECT * FROM [ContactInfo]"
ConnectionStrin g="Provider=Mic rosoft.Jet.OLED B.4.0; Ole DB Services=-4; Data
Source=" &
<%# Server.MapPath(/nrcweb2/db/contact.mdb") %>
</wmx:AccessDataS ourceControl>
--
Patrik Löwendahl
cshrp.net - " Elegant code by witty programmers "
cornerstone.se - " IT Training for professionals "

"Mostafa" <mo*****@nospam .com> wrote in message
news:RmZlb.1670 4$B_2.9560@okep read02... Hello,

I need to use a relative URL path instead of the system path inside the
<wmx:> tag in the following code:

<wmx:AccessData SourceControl id="AccessDataS ourceControl1" runat="server"
SelectCommand=" SELECT * FROM [ContactInfo]"
ConnectionStrin g="Provider=Mic rosoft.Jet.OLED B.4.0; Ole DB Services=-4; Data Source=D:/nrcweb2/db/contact.mdb"></wmx:AccessDataS ourceControl>
I have tried to do it this way,

<wmx:AccessData SourceControl id="AccessDataS ourceControl1" runat="server"
SelectCommand=" SELECT * FROM [ContactInfo]"
ConnectionStrin g="Provider=Mic rosoft.Jet.OLED B.4.0; Ole DB Services=-4; Data Source=" &
Server.MapPath(/nrcweb2/db/contact.mdb")></wmx:AccessDataS ourceControl>

But I always get a parser error. It seems that functions cannot be evaluated within the tag.

Please help me

Thank you

Mostafa

Nov 17 '05 #2
It is still not working:

Parser Error
Description: An error occurred during the parsing of a resource required to
service this request. Please review the following specific parse error
details and modify your source file appropriately.

Parser Error Message: The server tag is not well formed.

Source Error:

Line 22: </p>
Line 23: <p>
Line 24: <wmx:AccessData SourceControl
id="AccessDataS ourceControl1" runat="server" SelectCommand=" SELECT * FROM
[ContactInfo]" ConnectionStrin g="Provider=Mic rosoft.Jet.OLED B.4.0; Ole DB
Services=-4; Data Source=" & <%# Server.MapPath(/nrcweb2/db/contact.mdb") %>
</wmx:AccessDataS ourceControl> Line 25:
Line 26: <wmx:MxDataGr id id="MxDataGrid1 " runat="server"
AutoGenerateFie lds="False" DataKeyField="M essageID" DataMember="Con tactInfo"
DataSourceContr olID="AccessDat aSourceControl1 " BorderColor="#C CCCCC"
AllowSorting="T rue" BackColor="Whit e" CellPadding="3" BorderWidth="1p x"
BorderStyle="No ne">

Source File: D:\nrcweb2\cont act2.aspx Line: 24
Mostafa
"Patrik Löwendahl" <pa************ **@csharpsweden .com> wrote in message
news:On******** ******@TK2MSFTN GP12.phx.gbl... You need to include the vb.net code within server script tags like so:

<wmx:AccessData SourceControl id="AccessDataS ourceControl1" runat="server"
SelectCommand=" SELECT * FROM [ContactInfo]"
ConnectionStrin g="Provider=Mic rosoft.Jet.OLED B.4.0; Ole DB Services=-4; Data Source=" &
<%# Server.MapPath(/nrcweb2/db/contact.mdb") %>
</wmx:AccessDataS ourceControl>


--
Patrik Löwendahl
cshrp.net - " Elegant code by witty programmers "
cornerstone.se - " IT Training for professionals "

"Mostafa" <mo*****@nospam .com> wrote in message
news:RmZlb.1670 4$B_2.9560@okep read02...
Hello,

I need to use a relative URL path instead of the system path inside the
<wmx:> tag in the following code:

<wmx:AccessData SourceControl id="AccessDataS ourceControl1" runat="server" SelectCommand=" SELECT * FROM [ContactInfo]"
ConnectionStrin g="Provider=Mic rosoft.Jet.OLED B.4.0; Ole DB Services=-4;

Data
Source=D:/nrcweb2/db/contact.mdb"></wmx:AccessDataS ourceControl>
I have tried to do it this way,

<wmx:AccessData SourceControl id="AccessDataS ourceControl1" runat="server" SelectCommand=" SELECT * FROM [ContactInfo]"
ConnectionStrin g="Provider=Mic rosoft.Jet.OLED B.4.0; Ole DB Services=-4;

Data
Source=" &
Server.MapPath(/nrcweb2/db/contact.mdb")></wmx:AccessDataS ourceControl>

But I always get a parser error. It seems that functions cannot be

evaluated
within the tag.

Please help me

Thank you

Mostafa


Nov 17 '05 #3
Sorry, remove the & and ad an ending "

--
Patrik Löwendahl
cshrp.net - " Elegant code by witty programmers "
cornerstone.se - " IT Training for professionals "

"Mostafa" <mo*****@nospam .com> wrote in message
news:_YZlb.1680 3$B_2.13775@oke pread02...
It is still not working:

Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error
details and modify your source file appropriately.

Parser Error Message: The server tag is not well formed.

Source Error:

Line 22: </p>
Line 23: <p>
Line 24: <wmx:AccessData SourceControl
id="AccessDataS ourceControl1" runat="server" SelectCommand=" SELECT * FROM
[ContactInfo]" ConnectionStrin g="Provider=Mic rosoft.Jet.OLED B.4.0; Ole DB
Services=-4; Data Source=" & <%# Server.MapPath(/nrcweb2/db/contact.mdb") %>
</wmx:AccessDataS ourceControl>

Line 25:
Line 26: <wmx:MxDataGr id id="MxDataGrid1 " runat="server"
AutoGenerateFie lds="False" DataKeyField="M essageID"

DataMember="Con tactInfo" DataSourceContr olID="AccessDat aSourceControl1 " BorderColor="#C CCCCC"
AllowSorting="T rue" BackColor="Whit e" CellPadding="3" BorderWidth="1p x"
BorderStyle="No ne">

Source File: D:\nrcweb2\cont act2.aspx Line: 24
Mostafa
"Patrik Löwendahl" <pa************ **@csharpsweden .com> wrote in message
news:On******** ******@TK2MSFTN GP12.phx.gbl...
You need to include the vb.net code within server script tags like so:

<wmx:AccessData SourceControl id="AccessDataS ourceControl1" runat="server"
SelectCommand=" SELECT * FROM [ContactInfo]"
ConnectionStrin g="Provider=Mic rosoft.Jet.OLED B.4.0; Ole DB Services=-4;

Data
Source=" &
<%# Server.MapPath(/nrcweb2/db/contact.mdb") %>
</wmx:AccessDataS ourceControl>


--
Patrik Löwendahl
cshrp.net - " Elegant code by witty programmers "
cornerstone.se - " IT Training for professionals "

"Mostafa" <mo*****@nospam .com> wrote in message
news:RmZlb.1670 4$B_2.9560@okep read02...
Hello,

I need to use a relative URL path instead of the system path inside the <wmx:> tag in the following code:

<wmx:AccessData SourceControl id="AccessDataS ourceControl1" runat="server" SelectCommand=" SELECT * FROM [ContactInfo]"
ConnectionStrin g="Provider=Mic rosoft.Jet.OLED B.4.0; Ole DB Services=-4; Data
Source=D:/nrcweb2/db/contact.mdb"></wmx:AccessDataS ourceControl>
I have tried to do it this way,

<wmx:AccessData SourceControl id="AccessDataS ourceControl1" runat="server" SelectCommand=" SELECT * FROM [ContactInfo]"
ConnectionStrin g="Provider=Mic rosoft.Jet.OLED B.4.0; Ole DB
Services=-4; Data
Source=" &

Server.MapPath(/nrcweb2/db/contact.mdb")></wmx:AccessDataS ourceControl>
But I always get a parser error. It seems that functions cannot be

evaluated
within the tag.

Please help me

Thank you

Mostafa



Nov 17 '05 #4
I am sorry but I tried this one and it still doesn't work.

<wmx:AccessData SourceControl id="AccessDataS ourceControl1" runat="server"
ConnectionStrin g="Provider=Mic rosoft.Jet.OLED B.4.0; Ole DB Services=-4; Data
Source= <%# Server.MapPath( "/nrcweb2/db/contact.mdb") %>"
SelectCommand=" SELECT * FROM [ContactInfo]"></wmx:AccessDataS ourceControl>

The parser assumes the end of the string once it encounters an " . I have
tried ' instead of " but still doesn't work, although it gives different
error:

<wmx:AccessData SourceControl id="AccessDataS ourceControl1" runat="server"
ConnectionStrin g="Provider=Mic rosoft.Jet.OLED B.4.0; Ole DB Services=-4; Data
Source= <%# Server.MapPath( '/nrcweb2/db/contact.mdb') %>"
SelectCommand=" SELECT * FROM [ContactInfo]"></wmx:AccessDataS ourceControl>

Can you please write the complete corrected tag?

Sorry for the trouble, I appreciate your help

Mostafa

"Patrik Löwendahl" <pa************ **@csharpsweden .com> wrote in message
news:u9******** ******@tk2msftn gp13.phx.gbl...
Sorry, remove the & and ad an ending "

--
Patrik Löwendahl
cshrp.net - " Elegant code by witty programmers "
cornerstone.se - " IT Training for professionals "

"Mostafa" <mo*****@nospam .com> wrote in message
news:_YZlb.1680 3$B_2.13775@oke pread02...
It is still not working:

Parser Error
Description: An error occurred during the parsing of a resource required to
service this request. Please review the following specific parse error
details and modify your source file appropriately.

Parser Error Message: The server tag is not well formed.

Source Error:

Line 22: </p>
Line 23: <p>
Line 24: <wmx:AccessData SourceControl
id="AccessDataS ourceControl1" runat="server" SelectCommand=" SELECT * FROM
[ContactInfo]" ConnectionStrin g="Provider=Mic rosoft.Jet.OLED B.4.0; Ole DB Services=-4; Data Source=" & <%# Server.MapPath(/nrcweb2/db/contact.mdb") %></wmx:AccessDataS ourceControl>

Line 25:
Line 26: <wmx:MxDataGr id id="MxDataGrid1 " runat="server"
AutoGenerateFie lds="False" DataKeyField="M essageID"

DataMember="Con tactInfo"
DataSourceContr olID="AccessDat aSourceControl1 " BorderColor="#C CCCCC"
AllowSorting="T rue" BackColor="Whit e" CellPadding="3" BorderWidth="1p x"
BorderStyle="No ne">

Source File: D:\nrcweb2\cont act2.aspx Line: 24
Mostafa
"Patrik Löwendahl" <pa************ **@csharpsweden .com> wrote in message
news:On******** ******@TK2MSFTN GP12.phx.gbl...
You need to include the vb.net code within server script tags like so:

<wmx:AccessData SourceControl id="AccessDataS ourceControl1" runat="server" SelectCommand=" SELECT * FROM [ContactInfo]"
ConnectionStrin g="Provider=Mic rosoft.Jet.OLED B.4.0; Ole DB
Services=-4; Data
Source=" &
<%# Server.MapPath(/nrcweb2/db/contact.mdb") %>
></wmx:AccessDataS ourceControl>

--
Patrik Löwendahl
cshrp.net - " Elegant code by witty programmers "
cornerstone.se - " IT Training for professionals "

"Mostafa" <mo*****@nospam .com> wrote in message
news:RmZlb.1670 4$B_2.9560@okep read02...
> Hello,
>
> I need to use a relative URL path instead of the system path inside

the > <wmx:> tag in the following code:
>
> <wmx:AccessData SourceControl id="AccessDataS ourceControl1"

runat="server"
> SelectCommand=" SELECT * FROM [ContactInfo]"
> ConnectionStrin g="Provider=Mic rosoft.Jet.OLED B.4.0; Ole DB Services=-4; Data
> Source=D:/nrcweb2/db/contact.mdb"></wmx:AccessDataS ourceControl>
>
>
> I have tried to do it this way,
>
> <wmx:AccessData SourceControl id="AccessDataS ourceControl1"

runat="server"
> SelectCommand=" SELECT * FROM [ContactInfo]"
> ConnectionStrin g="Provider=Mic rosoft.Jet.OLED B.4.0; Ole DB Services=-4; Data
> Source=" &
> Server.MapPath(/nrcweb2/db/contact.mdb")></wmx:AccessDataS ourceControl> >
> But I always get a parser error. It seems that functions cannot be
evaluated
> within the tag.
>
> Please help me
>
> Thank you
>
> Mostafa
>
>



Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
4116
by: jason | last post by:
Can anyone help me find a solution to quickly working out relative paths to a folder in the root of my server... Although it easy when you go - say - two levels down: .../includes it becomes increasingly difficult to ball park the folder when you go deeper and wider down:
15
2913
by: Nick K. | last post by:
I recently began maintenance work on a production web server that is located in the root directory of a web server. I moved this into a sub web on my local web server in order to do work on it. I found that there is an include file that references images: <img src = "/images/Header.gif" What worked correctly on the production server breaks on mine because of the absolute address "/images". I removed the absolute address and changed...
4
27732
by: Richard | last post by:
We are distributing a VS2003 solution to our customers that includes a .NET assembly (dll file) and a sample project for how to use the dll. The customer can then customize the sample or add a new project to the solution. The problem is that the customers cannot simply take the solution we distribute and build it. VS2003 is saving the reference to the dll as an fully qualified absolute path (not relative to the project), so after...
7
78649
by: Rizaan Jappie | last post by:
is it possible to get the relative path based on a absolute path in c#? *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
6
11792
by: openleren | last post by:
Hi all, how can I use a relative path in my web.config file for an Access db?: Instead of using <configuration> <appSettings> <add key="conAccess" value="microsoft.jet.oledb.4.0;data source=c:/Inetpub/MyApp/data/database.mdb" /> ...
4
7869
by: Win, Pats | last post by:
I have a snippet of HTML that I inject into a number of pages throughout my Web site at runtime. My problem is that I'm not getting the image to appear in all documents into which this snippet is injected. If I specify a document-relative path (e.g., src="../someFolder/AnotherFolder/TheGraphic.gif"), then it works fine, but only for documents that exist at the level in the directory structure. I thought I could use a root-relative...
8
2607
by: JJ | last post by:
I'm confused about paths. I have a functionn that uses the mappath method, which I think requires a virtual path (is that the same as a relative path?). But this doesn't always work as the path can take the form of the following: 1. /directory/images/xyz.gif (works fine) 2. http://localhost:1234/www.mytestwebsite.com/directory/images/xyz.gif (doesn't work) 3. http:///www.someremotesite.com/directory/images/abc.gif (doesn't work)
1
2356
by: Anees | last post by:
hi i was trying to implement mode rewrite option in a blog site. i used the lines for listing the posts by its topic category as #List by Category RewriteRule ^Topics/(+)$ index.php?cat=$1 #With page navigation option RewriteRule ^Topics/(+)/(*)$ index.php?cat=$1&start=$2
15
6473
by: Lars Eighner | last post by:
Aside from the deaths of a few extra electrons to spell out the whole root relative path, is there any down side? It seems to me that theoretically it shouldn't make any difference, and it would make it much easier to slap modualar blocks of markup into page frameworks, which may change and so forth. And the few extra bytes, which even for a fairly large site would not amount to as many bytes as are in a fairly small low-res image, should...
6
2499
by: Royan | last post by:
Ok the problem is quite hard to explain, but i'll try to keep it as simple as i can. Imagine I have the following structure of my files and folders: /root/global.inc |__/files/foo.php |__/utils |__/logs/logger.inc When I run foo.php I get the following error:
0
9605
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10651
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10392
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9208
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5555
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5693
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4341
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3868
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3020
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.