Chapter Three Quiz Answers - Page 15
November 27, 2000
1. Dim sets aside space in memory and reserves the
word oRS as a variable name. Set
assigns to this variable a reference to an object that is
instantiated using the CreateObject method.
2. Server.CreateObject("ADODB.recordset")
Period between Server and CreateObject
Period between ObjectType and class
ObjectType and class are inside double quotes which is within parentheses.
3.
<%
Response.Write oRS6("SSN").Value
%>
4. We recorded you with SSN <%=oRS6("SSN").Value%>.
5. Recordsets opened in the simple way of this chapter are
forward-only. More flexible recordsets will be discussed in a
later chapter.
6. Source (for example "People")
Connection (for example "DSN=Sailors")
7.Set up the DSN
Familiarize yourself with the database structure
Know a valid UserID and its valid password
8.With a semicolon (adding a space makes it easier to read and does not create problems)
ORS.Open "SourceTable", "DSN=MyDSNName;
uid=MyUserID; pwd=MyPassword"
[The two lines above have been split for formatting purposes.]
sSSN = oRS6("SSN").value
or
sSSN = oRS6("SSN")
9.
10.
| 1 |
Apples |
Amelia |
| 2 |
Bananas |
Bob |
| 3 |
Cucumber |
Cathy |
<TABLE BORDER=1>
<TR>
<TD>1</TD>
<TD>Apples</TD>
<TD>Amelia</TD>
</TR>
<TR>
<TD>2</TD>
<TD>Bananas</TD>
<TD>Bob</TD>
</TR>
<TR>
<TD>3</TD>
<TD>Cucumber</TD>
<TD>Cathy</TD>
</TR>
</TABLE>
By eliminating some spaces and carriage returns from the above we
can build:
<TABLE BORDER=1>
<TR><TD>1</TD><TD>Apples</TD><TD>Amelia</TD></TR>
<TR><TD>2</TD><TD>Bananas</TD><TD>Bob</TD></TR>
<TR><TD>3</TD><TD>Cucumber</TD><TD>Cathy</TD></TR>
</TABLE>
11.
| 1 |
Apples |
Amelia |
| 2 |
|
Bob |
| 3 |
Cucumber |
Cathy |
In this case we have to be careful not to allow the collapse of the cell which formerly held banana by retaining the <TD></TD> for the old banana
cell and filling it with
<TABLE BORDER=1>
<TR><TD>1</TD><TD>Apples</TD><TD>Amelia</TD></TR>
<TR><TD>2</TD><TD> </TD><TD>Bob</TD></TR>
<TR><TD>3</TD><TD>Cucumber</TD><TD>Cathy</TD></TR>
</TABLE>
Chapter Three Quiz - Page 14
Beginning ASP Databases
|