Category Archive for "ASP"

How to connect different database in ASP

How to connect database in ASP (Active Server Page)? SQL Server 2005 This is a compiled connection strings reference list on how to connect to SQL Server 2005. SQL Native Client ODBC Driver Standard security Driver={SQL Native Client};Server=myServerAddress;Database=myDataBase; Uid=myUsername;Pwd=myPassword; Are you using SQL Server 2005 Express? Don’t miss the server name syntax Servername SQLEXPRESS where you substitute Servername with the name of the computer where the SQL Server 2005 Express installation resides. Trusted Connection Driver={SQL Native Client};Server=myServerAddress;Database=myDataBase; Trusted_Connection=yes; Equivalent key-value…

Read More

ASP – Dictionary

ASP – Dictionary The Dictionary object In order to learn how Dictionary object works we will create a small script which will translate number 1 to 10 from English to Spanish. translate.asp <% SET MyDictionary=CreateObject(“Scripting.Dictionary”) MyDictionary.Add “one”,”uno” MyDictionary.Add “two”,”dos” MyDictionary.Add “three”,”tres” MyDictionary.Add “four”,”cuatro” MyDictionary.Add “five”,”cinco” MyDictionary.Add “six”,”seis” MyDictionary.Add “seven”,”siete” MyDictionary.Add “eight”,”ocho” MyDictionary.Add “nine”,”nueve” MyDictionary.Add “ten”,”diez” EnglishNumber=”four” SpanishNumber=MyDictionary.Item (EnglishNumber) Response.Write(SpanishNumber) %> 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 How the…

Read More

ASP – Date,Time and Text

Displaying the Current Date and Time The date and time described in this section are those that are on the server. Date To display the current date by itself in a Web page, type: &lt;% =date %&gt; at the point where you want it to appear. When you view the page in your browser, you should see something like this:Thu, Jan 23, 1997 Note: Even though “=date” is a short script, it’s actually made up of two parts. The “date”…

Read More

ASP- Cookies

Cookies method is very similar to Session method: the basic difference is that with Cookies method the information is save in the clients computer and not in the server, so it is more suitable for sites with a lot of visitors. This method implies sending information to the client and requesting it whenever the information is needed. Additionally, we will learn how to delete the information save in the clients computer when it is not necessary anymore.When the visitor gets…

Read More

ASP-JavaScript

In this tutorial we will create a regular HTML page with a small javascript code, and we will use this javascript code to include in the page new information from a “.asp” file. First, let´s check this two pages: <br> javascript.html <html> <title>My page</title> <body><script language=”javascript” src=”javascript.asp“></script></body> </html> 1 2 3 4 5 6 7 8 javascript.asp document.write (“hello“) 1 In the first file (javascript.html) we have include a javascript code in red, and within the code the file name…

Read More

ASP – Array

Introduction Working with Arrays Filtering values from a array Creating a table from data in a string Simple keyword search Introduction Instead of having our information (variables or numbers) in variables like Mydata1, Mydata2, Mydata3 etc, by using arrays our information will be in an unique variable. Let´s check an example: array.asp <html> <title>My Array</title> <body> <% DIM MyData(2,2) MyData (0,0) = “1” MyData (0,1) = “2” MyData (0,2) = “3” MyData (1,0) = “4” MyData (1,1) = “5” MyData…

Read More

ASP – Interview Question

Question : How are scripts executed? Answer : ASP provides scripting engines that execute the corresponding scripting languages on the server side. Scripts should be encoded within the “< %…. %”. Question : Explain the building blocks of Client/Server? Answer : The client side building block runs the client side of the application. The server side building block runs the server side of the application. Question : Explain the POST & GET Method or Explain the difference between them. Answer…

Read More

ASP – Active Server Page

Active Server Page Active Server Page (ASP) are Web pages that contain server-side scripts in addition to the usual mixture of text and HTML (Hypertext Markup Language) tags. Server-side scripts are special commands you put in Web pages that are processed before the pages are sent from your Personal Web Server to the Web browser of someone who’s visiting your Web site. . When you type a URL in the Address box or click a link on a Web page, you’re…

Read More