Print Page | Close Window

asp.net inside asp?

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: ASP.NET Discussion
Forum Description: Discussion and chat on ASP.NET related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=5853
Printed Date: 29 March 2026 at 8:40am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: asp.net inside asp?
Posted By: l_baltodano
Subject: asp.net inside asp?
Date Posted: 19 September 2003 at 1:09pm

hi people i have 2 questions.. iīm a complete newbee in asp.net so.

1.- I have this add-on thatīs writted on asp.net (Ad rotator) and itīs really cool.. but my website is in asp.. is it possible to add asp.net code into asp without any problem?

2.- In the connection string i can see that the path used to the database is the fisical path.. how can i change it to a virtual path?.. is it possible?.

Well thank you so much for everything.. i hope u can help me!

Lautaro B.




Replies:
Posted By: Diep-Vriezer
Date Posted: 19 September 2003 at 4:09pm

Here you go:

1 - Yes you can use asp.net or aspx on asp pages, IF the server supports the ASP.NET thing, or .NET framework. Check this with your system administrator or something ** Im like windows! **

2 - Interupt the string, likte this:

 ConnStr = "PROVIDER=bla.bal;DATA Source=" & Server.Mappath("/virtual/database.mdb") & "; the restofthestring"

Use http://www.connectionstrings.com - www.connectionstrings.com for more connectionstrings. If this string doesn't work, leave the ; out. Im not really sure if this is needed in this string, but it is done by using the Server.Mappath("Dir/file.extention").



-------------
Gone..


Posted By: l_baltodano
Date Posted: 19 September 2003 at 6:06pm

hi there!.. take a look at this:

 

<appSettings>
<!--
    <add key="AdMentorConnString" value="Provider=sqloledb;Data Source=127.0.0.1;Initial catalog=admentornet;User Id=sa;Password=;" />
    -->
    <add key="AdMentorConnString" value="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\admentornet.mdb" />
    
  </appSettings>

when i change it to :

<appSettings>
<!--
    <add key="AdMentorConnString" value="Provider=sqloledb;Data Source=127.0.0.1;Initial catalog=admentornet;User Id=sa;Password=;" />
    -->
    <add key="AdMentorConnString" value="Provider=Microsoft.Jet.OleDb.4.0;Data Source=" & Server.MapPath("admentornet.mdb") & ";" />

  </appSettings>

it gives me this error:

Configuration Error

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: The '&' character, hexadecimal value 0x26, cannot begin a name. Line 81, position 89.

Source Error:

Line 79:   		<add key="AdMentorConnString" value="Provider=sqloledb;Data Source=127.0.0.1;Initial catalog=admentornet;User Id=sa;Password=;" />
Line 80:     -->
Line 81:   		<add key="AdMentorConnString" value="Provider=Microsoft.Jet.OleDb.4.0;Data Source=" & Server.MapPath("admentornet.mdb") & ";" />
Line 82:   		
Line 83:   </appSettings>

 

any ideas?



Posted By: Diep-Vriezer
Date Posted: 20 September 2003 at 1:49am

Houston, we've got a problem.

This is weird, since you're using a config file to declare the string. Nothing wrong with that, but WHY isn't it possible to instert Server.Mappath?

Ow, while I'm typing this, I realize that maybe a config file can't use the Server. or Response., Request. commands. Maybe that's it. But why don't you use the static path? If that one worked..



-------------
Gone..


Posted By: l_baltodano
Date Posted: 20 September 2003 at 1:48pm

because i have my doubts ab out if itīs possible to download my ".congif" file u know!.

Itīs a matter of security, and i know itīs the service provider responssability but.. is it possible?



Posted By: Diep-Vriezer
Date Posted: 20 September 2003 at 2:01pm

I gues not, since the config file isn't executed as a normal aspx page. It's the same as classes: you can't use request/response and here I guess the server variables are also unreachable.

Try putting it into a class file like this:

Public Class Storage

Public ConnStr As String

Public Function Initialize()

   ConnStr = "Provider=Microsoft.Jet.OleDb.4.0;Data Source=" & Server.MapPath("admentornet.mdb")

End Function

End Class

Now when you need the ConnStr value, just use this:

Dim ReqStorage As New Storage
ReqStorage.Initialize()
Dim ConnStr As String = ReqStorage.ConnStr

Of course a config file is better, but in an emergency you can use this. You'd probably already know it, but still, I use it, since the data is compiled, wich is more secure than a config file I guess.



-------------
Gone..


Posted By: l_baltodano
Date Posted: 20 September 2003 at 2:10pm
ok Diep-Vriezer thank you very much.. iīll try that option


Posted By: Diep-Vriezer
Date Posted: 20 September 2003 at 2:31pm
You didn't knew that one?

-------------
Gone..


Posted By: l_baltodano
Date Posted: 20 September 2003 at 5:02pm
actually iīm not an asp guru.. well..since i live in a country where they donīt teach asp itīs hard for me to get involved with it.. if itīs not because iīm interested and trying to learn some asp.. i wouldnīt be here!


Posted By: l_baltodano
Date Posted: 20 September 2003 at 5:04pm
but iīm preetty interested in learning asp.. the only problem is to find someone who actually set my interest in the right direction!


Posted By: Diep-Vriezer
Date Posted: 21 September 2003 at 3:10am

I've learned asp.net from several forums (including this one) and some eBook's.

I also have Microsoft Visual Studio.NET Enterprise Architect, wich provides alot of usefull background intelligence, and fast websites.

If you don't want asp.net but just plain asp, you don't need such an expensive editor (in fact, you never need one of them), but dreamweaver would also work fine. ASP is not compiled and therefore slower than ASP.NET. So I think today is THE time to strart using ASP.NET (no plain asp, because I guess ASP.NET will grow in the future and become even better than asp)



-------------
Gone..


Posted By: dpyers
Date Posted: 21 September 2003 at 9:01am

I agree that your eforts wll be better spent learning asp.net

http://www.asp.net - www.asp.net has an asp.net WYSIWYG devlopment tool called webmatrix. Pretty good, and free. They also have an excellent selection of tutorials, sample apps/starter kits, and forums.

I use MS VB.net to build asp.net applications. It is Visual studio, but only has the VB language set, and it's a lot cheaper than the full visual Studio. I got Borlands free C# Builder to do a few things in C# instead of VB for asp.net. The Borland product can either run as a stand-alone WYSIWYG devlopment tool or can integrate with visual studio.

If you're running an OS that doesn't include IIS (XP Home, Win 98) to test development, http://www.asp.net - www.asp.net has the Cassini web server, which is also free.



-------------

Lead me not into temptation... I know the short cut, follow me.


Posted By: Bluefrog
Date Posted: 28 September 2003 at 8:44am

Another great freebie is the MSDE which is pretty well integrated from within Web Matrix. And that's free too. (MSDE is a slightly cut down version of MS SQL Server.)

 



-------------
http://renegademinds.com/" rel="nofollow - Renegade Minds - Guitar Software http://renegademinds.com/Default.aspx?tabid=65" rel="nofollow - Slow Down Music


Posted By: Bluefrog
Date Posted: 28 September 2003 at 8:45am
BTW: I use Web Matrix to connect to SQL Server for quick queries on boxes where I don't have SQL Server. A great cheap solution~!

-------------
http://renegademinds.com/" rel="nofollow - Renegade Minds - Guitar Software http://renegademinds.com/Default.aspx?tabid=65" rel="nofollow - Slow Down Music


Posted By: Mart
Date Posted: 29 September 2003 at 11:01am
I dont like webmatrix because it changes your code!



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net