Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - asp.net inside asp?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

asp.net inside asp?

 Post Reply Post Reply Page  12>
Author
l_baltodano View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 09 June 2003
Location: Nicaragua
Status: Offline
Points: 39
Post Options Post Options   Thanks (0) Thanks(0)   Quote l_baltodano Quote  Post ReplyReply Direct Link To This Post Topic: asp.net inside asp?
    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.

Back to Top
Diep-Vriezer View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 August 2003
Location: Netherlands
Status: Offline
Points: 831
Post Options Post Options   Thanks (0) Thanks(0)   Quote Diep-Vriezer Quote  Post ReplyReply Direct Link To This Post 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 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..
Back to Top
l_baltodano View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 09 June 2003
Location: Nicaragua
Status: Offline
Points: 39
Post Options Post Options   Thanks (0) Thanks(0)   Quote l_baltodano Quote  Post ReplyReply Direct Link To This Post 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?

Back to Top
Diep-Vriezer View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 August 2003
Location: Netherlands
Status: Offline
Points: 831
Post Options Post Options   Thanks (0) Thanks(0)   Quote Diep-Vriezer Quote  Post ReplyReply Direct Link To This Post 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..
Back to Top
l_baltodano View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 09 June 2003
Location: Nicaragua
Status: Offline
Points: 39
Post Options Post Options   Thanks (0) Thanks(0)   Quote l_baltodano Quote  Post ReplyReply Direct Link To This Post 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?

Back to Top
Diep-Vriezer View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 August 2003
Location: Netherlands
Status: Offline
Points: 831
Post Options Post Options   Thanks (0) Thanks(0)   Quote Diep-Vriezer Quote  Post ReplyReply Direct Link To This Post 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..
Back to Top
l_baltodano View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 09 June 2003
Location: Nicaragua
Status: Offline
Points: 39
Post Options Post Options   Thanks (0) Thanks(0)   Quote l_baltodano Quote  Post ReplyReply Direct Link To This Post Posted: 20 September 2003 at 2:10pm
ok Diep-Vriezer thank you very much.. iīll try that option
Back to Top
Diep-Vriezer View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 August 2003
Location: Netherlands
Status: Offline
Points: 831
Post Options Post Options   Thanks (0) Thanks(0)   Quote Diep-Vriezer Quote  Post ReplyReply Direct Link To This Post Posted: 20 September 2003 at 2:31pm
You didn't knew that one?
Gone..
Back to Top
 Post Reply Post Reply Page  12>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.