Classic ASP BasicsFor beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
1. Should I be able to see the DSN when I do a dir?
2. In the global.asa file you should have something like this:
<script language="vbscript" runat="server">
sub Application_OnStart
Application.Lock
Application("connstr") = "MYSITEDSN"
Application.Unlock
end sub
sub Application_OnEnd
end sub
sub Session_OnStart
end sub
sub Session_OnEnd
end sub
</script>
Above is the global.asa, where does it go and what else do I put in it? My database is in a directory called "database".
3.What does the following mean?
In your .ASP files that are connecting to the database, you should have something like this before the tag: Where "TableName" is the name of the table you are opening. And this after the closing tag:
<%
rs.close
conn.close
%>
4. In the e-mail that provided the above information, I was told that
I could remove the file level DSN from my website. I did not see anything that mentioned DSN. How do I remove it?
5. I will wait for responses before asking any more questions.
6. I have Professional Activer Server Pages 2.0 for a reference and I have looked for the answers. Point me in the right direction if what I need is in the book. I will keep reading it.
;;;1. Should I be able to see the DSN when I do a dir?
I do not believe so, you will see files and folders only
;;;2. In the global.asa file you should have something like this:
Not all sites need a global.asa file, you will need one if:
A..If you want to extend the session beyond its 20 minute default
B..Create a 'how many guests do I have surfing my site' variable using the alpplication object - amoung other reasons...
NOTE:There is to be no client-side script in the global.asa file. This file is only for the purpose of server-side scripts.
;;;Above is the global.asa, where does it go and what else do I put in it?
It MUST go in the root level of each web site 'that needs one' As for what else goes in it, have you asked google?
;;;3.What does the following mean?
In your .ASP files that are connecting to the database, you should have something like this before the tag: Where "TableName" is the name of the table you are opening. And this after the closing tag:
<%
rs.close
conn.close
%>
mmmm - "before the tag: Where TableName" - 'Where TableName' looks very much like part of an sql statement to me, cant help you on that one.
The following closes a record set named rs then closes the database connection, record sets and DB connections should be closed after use.
rs.close
conn.close
;;;I could remove the file level DSN from my website. I did not see anything that mentioned DSN. How do I remove it?
I wouldnt worry about this
TIP:
;;;I have Professional Activer Server Pages 2.0 for a reference
Splash out get the latest book for best results
Appreciate your help. I found some code for a guestbook
and got it to work on my server. Just need to move it
to my host.:D My daugter picked little happy faces for me.
Since the book I have is a loaner, I will invest in a more current
edition.;)