Web
Server Manual
| Frames
Format
FTP Tutorial Overview | top
FTP, or File Transfer Protocol, is used to send your files to the web server so that it can "serve" them to the site visitors. For the purposes of maintaining a web site, you should use an FTP client such as WS_FTP or CuteFTP. Macintosh users can use Fetch. They are very easy to use, have a free trial periods, and are free or low cost for noncommercial use. Most graphical HTML editors (WYSIWYG) come with an FTP program built in.
IMPORTANT: If you are using MS Front Page, you can not use FTP to upload files or you will damage your Front Page extensions.Using WS_FTP
Manufacturer's tutorial
This tutorial will make reference to a "host name", "user name", and "password". Your host name will be "nt00.tvsecure.com", your username will be similar to "nt00000", and your password similar to "KwlE3iER". Note that the password is case-sensitive.
Account Notes | top
SQL Database Management Overview | top
MS SQL Server 7 is an industrial strength database capable of handling a very high number of transactions simultaneously. This database can be accessed from within your ASP script to display such data as product information, membership details, pictures, or any other data you may wish to store. This tutorial will briefly describe what is necessary to manage your SQL Server database.Managing your SQL Database
The "Enterprise Manager" is the program within the SQL client utilities that is used to manage your database. This is a free program included in the CD sets for Back Office, Visual Interdev, and any NT operating system (in the free option pack). If you do not have access to these, you can use the "Microsoft Query" program which is included with any of the MS Office programs.
Once you have installed the SQL client utilities, start "Client Network Utility". On the "General" tab, select "TCP/IP" for the Default network library and click "OK".
Then start the "Enterprise Manager". Right-click on "Microsoft SQL Servers" and select "New SQL Server Registration". When you get to the box labeled "Available Servers", enter the IP address of your SQL Server (eg. 64.95.201.65). For the Authentication Mode, select the "SQL Server login information" and enter the Login name and Password given to you when you signed up for the account. Continue through to the end of the wizard.
If you receive the error message "General network error", it is likely that you either entered in an incorrect IP address or you do not have "TCP/IP" selected in the "Client Network Utility". If you are behind a firewall, it is possible that the ports that SQL requires are being blocked. Check with your system administrator to see if port 1433 is being blocked.
If you receive the error message "Login Unsuccessful", your username and/or password are incorrect. Click on the "Properties" button, make sure "SQL Server Authentication" is selected, and reenter your login name and password. Remember that the password is case-sensitive.
If everything was successful, left-click on the newly registered database. You will likely get the message "The SQL Server \\64.95.201.65 is not know to be running. Are you sure you wish to connect?". Click "Yes" and left-click on the "databases" icon. Find your database and left-click on its icon. You will then see all your database components. You will work almost exclusively with the "Tables".
It is beyond the scope of this tutorial to explain how to program with SQL. Below are links to comprehensive online resources for programming with ASP and SQL.
Accessing your Data from ASP Overview | top
The data contained in your SQL database can be displayed on your web pages very easily using ASP. Below are two examples of how you can access your data.Accessing your data from ASP
Unless you have a specific reason for requiring a DSN (Data Source Name) we strongly encourage you to use DSN-less connections as they provide better performance. Connecting to your SQL Server without a DSN is easy. First define the connection string:
<%
sConnect = "Driver={SQL Server}; Server=TVCNT1; Database=yourdb; "
sConnect = sConnect & "UID=yourusername; PWD=yourpassword;"
%>
Then, to open a recordset and display on the page:
<%
sSQL = "SELECT YourField FROM YourTable WHERE a = b"
Set objRec = Server.CreateObject("ADODB.Recordset")
objRec.Open sSQL, sConnect
While NOT objRec.EOF
Response.Write(objRec("YourField") & "<BR>")
objRec.MoveNext
Wend
objRec.Close
Set objRec = Nothing
%>Always remember the "objRec.MoveNext" or you will create an endless loop that will consume large amounts of CPU time until it times-out. If you only wish to update a database without returning records, it is better to simply open a command object instead of a recordset.
<%
Set oConn = CreateObject("ADODB.Connection")
oConn.Open sConnect
Set oCommand = CreateObject("ADODB.Command")
oCommand.ActiveConnection = oConn
oCommand.CommandText = sSQL
oCommand.Execute
oConn.Close
Set oCommand = Nothing
Set oConn = Nothing
%>It benefits you and everyone else on the server to open the connections just before you need them and close them as soon as you are done with them. If you require more than one connection per page, it is preferable to keep the original connection open rather than opening and closing twice.
Access Database Management Overview | top
In order to use your Access database, you'll need to upload the Access file (.mdb) to your website cgi-bin folder, using your preferred FTP program.
The cgi-bin folder is located in wwwroot.Accessing your data from ASP
Once you have uploaded the Access file, include the following code in your ASP page to establish a database connection:
<%
Conn.Open "Driver={Microsoft Access Driver (*.mdb)};" "Dbq=somepath\mydb.mdb;" "Uid=Admin;" "Pwd=;"
%>Substitute somepath\mydb.mdb with the server path to your Access file.
Example: e:\accounts\nt00001\wwwroot\cgi- bin
Online Resources Overview | top
ASP has become a very popular system for developing interactive web sites because of its power and ease of use. Below are some good resources for learning ASP and as references for experienced programmers.
Note on use of includes: please do not use parent paths in includes.
For example, change from
"<!--#include file="../include/filename.ext" -->"<to:
" <!--#include virtual="include/filename.ext" -->"
Reference Material | top
Mailing Lists & Forums | top
ASP Newbie
Tight-knit and VERY helpful members take the time to explain even the simplest questions. You will learn a lot just by reading through other people's questions.
Instructional Sites | top
Recommended ASP Books | top
If you are a beginner, you will be doing yourself a very big favor by buying the first two books on this list. If you are experienced, the second book is a great reference. All information in those books can be found online (see Online Resources), but many people remember better by reading a dead-tree book rather than an online book.
ASP 2.0 Beginners
Very well laid out and abundant and clear code examples. Also explains how to connect to databases and write simple SQL statements. Makes for quick reading and a decent reference for later use.
ASP 2.0 Professional
Goes more in depth than the beginners book. Many clear examples and very comprehensive in terms of what ASP can do. Also goes into Index Server, Certificate Server and how to set them up.
ASP Techniques for Webmasters
Good as an application reference, but you will want the ASP 2 Pro or ASP 3 Prog. Ref. book for quick lookups. Has many good example applications that illustrate how to make ASP work for you. Much of the code can be used in your site with little modification.
ASP 3.0 Programmer's Reference
Very in-depth book on the new ASP 3.0 running on Windows2000 Server. This is more advanced reading that assumes you know the basics such as variable definitions, function calls and loops.
ASP Encryption Overview | top
We have installed a component called "DynuEncrypt" which allows you to more easily encrypt information such as membership details and credit card numbers.Encrypting your data from within ASP
Below is an example of how to use this simple, yet powerful, object.
<%
Set myencryptor = Server.CreateObject("DynuEncrypt.Functions")
encrypted = myencryptor.encrypt("Your data.", "YourPassword")
Response.Write(encrypted) 'writes the encrypted value
decrypted = myencryptor.decrypt(encrypted, "somepassword")
Response.Write(decrypted) 'writes the non-encrypted value
Set myencryptor = nothing
%>
ASPEmail Overview | top
We have installed a component called "ASPEmail" from Persits Software that makes it easy for you to send email from within your ASP scripts.Sending Email from ASP
For in-depth information please review the ASPEmail Manual.Below is a sample script.
<%
Set Mail = Server.CreateObject("Persits.MailSender")
Mail.AddAddress "recipientaddress@domain.com" <mailto:recipientaddress@domain.com> , "Recipient Name"
Mail.AddCC "copyrecipient@domain2.com" <mailto:copyrecipient@domain2.com>
Mail.FromName = "Online Signup Form"
Mail.From = "onlinesignup@yourdomain.com" <mailto:onlinesignup@yourdomain.com>
Mail.Subject = "Your subject here"
Mail.Body = "Your body text here"
Mail.Host = "em00.tvsecure.com"
on error resume next
Mail.Send
if err <> 0 then
response.write "An error occurred: " & Err.Description
end if
Set Mail = Nothing
%>Mail.Helo is optional. If you find some client's are not receiving email replies, you may wish to set "Mail.Helo" to mail.your_domain.com.
For example: Mail.Helo = "mail.domain.com"
ASPUpload Overview | top
We have installed a component called "aspSmartUpload" that makes it easy for you to create web pages that can upload files directly from the browser.
Uploading files through your browser
The aspSmartUpload component has many features. Please see aspSmart and click the aspSmartUpload tab to see detailed instruction on how to use this powerful component.
ASPTear Overview | top
ASPTear allows you to submit forms and read the resulting response from any HTTP server from within your ASP code. This is useful, for example, to seamlessly integrate Authorize.Net into your web site, or create robots that check other web sites and report back certain characteristics.User instructions for ASPTear
For up-to-date instructions on how to use this very powerful component, see the developer's web site.