Laptop Battery *********************************************
*********************************************
These 2 components are being offered in a bundle together be raffled off
free brought to you by IISCart and ASPFree.com. This contest will run the
month of January. No strings attached! Enter often!! These components
together are worth over $250 dollars! Live Demo's available, check out
IISCart's Website at
*********************************************
*********************************************
We've been Nominated for best English Speaking ASP Site of the year by
ASPGuild.org
ASPFree has been nominated for best English Speaking ASP Site of the year.
If you think so, please go vote for ASPFree.com! We are honored to be
recognized!
*********************************************
New Demo--SHAKE, RATTLE AND ROLL your screen. with JavaScript!
ASPFree brings you another unique demo, this one ranks as a "10" on the
scale of being way COOL and Fun!! Using a JavaScript function that someone
can set various degrees of how the screen will SHAKE, RATTLE AND ROLL!! Just
like in an earthquake! Thanks Steve Hughes for this one! Tested both in
Netscape and IE, works fine!
Here is the function that works. Copy and paste into a html page and go!
<SCRIPT LANGUAGE="JavaScript1.2">
<!-- Begin
function rattle(n) {
if (document.forms[0].elements[0].checked) {x=4; y=12;}
if (document.forms[0].elements[1].checked) {x=8; y=12;}
if (document.forms[0].elements[2].checked) {x=13; y=6;}
if (document.forms[0].elements[3].checked) {x=20; y=8;}
if (self.moveBy) {
for (i = x; i > 0; i--)
{
for (j = y; j > 0; j--)
{
self.moveBy(0,i);
self.moveBy(i,0);
self.moveBy(0,-i);
self.moveBy(-i,0);
}
}
}
}
// End -->
</script>
<font face=Arial>
<H3>Experience California Like never before</H3>
<br>
For those of you who don't live in California, you can now experience
what it's (might be)like. Thanks a ton from Steve Hughes for contributing
this!
<p>
<form>
<input type="radio" name="level" value="Mild"
checked="True">Pleasant<BR>
<input type="radio" name="level" value="Strong">Great<BR>
<input type="radio" name="level" value="Severe">Shocking<BR>
<input type="radio" name="level"
value="Devastating">Devastating<P>
<input type=button onClick="rattle(this.form)" value="Experience
California">
</font>
</form>
*********************************************
New Demo--Passing Multiple Parameters to a Stored Procedure and Returning a
Recordset.
This demo shows 2 things. Formatting one string that is passed to the
database with Parameters and returns a recordset to the ASP page w/o using
the Command object. We found this technique to be very clean and efficient
way of coding. Collecting some information from ASP and based on those
Parameters return records from a database using Stored Procedures.
Performance increased a lot and amount of code to process this went down.
This features a live demo and downloadable code and scripts to try!
Here is the code
Page 1 the input screen
<html>
<head>
<title>DoubleValue</title>
</head>
<body>
<form method="POST" action="DoubleValue2.asp" name="form1">
<p>Find out # of Doors on this Car</p>
<p><select name="ColorOfCar" size="1">
<option selected value="Blue">Blue</option>
<option value="Black">Black</option>
<option value="Yellow">Yellow</option>
</select></p>
<p><select name="TypeOfCar" size="1">
<option selected value="BMW">BMW</option>
<option value="Corvette">Corvette</option>
<option value="ChevyChevette">Chevy Chevette</option>
</select></p>
<p><input type="submit" value="Submit" name="B1"><input type="reset"
value="Reset"
name="B2"></p>
</form>
</body>
</html>
Page 2 The process page
<%
'Declare variables
dim conn
dim rs
dim strsql
dim strColorOfCar
dim strTypeOfCar
'Set the information submitted to a local variable
strColorOfCar = request("ColorOfCar")
strTypeOfCar = request("TypeOfCar")
'Connection and Recordset object
strconn = "Driver={SQL
Server};Description=sqldemo;SERVER=servername;UID=loginid;PWD=password;DATAB
ASE=blah"
set conn = server.createobject("adodb.connection")
conn.open strconn
'Set the string that will be passed to the database and execute the
'stored procedure. This will return a recordset. Notice the comma that
separates the values.
'This is needed to separate the data values so the Stored Procedure can
parse the data.
'We've used this method to pass between statements for dates. Note you'll
need to pass single quotes with it so SQL 7 will understand the date
strSql = "Exec sp_DoubleValue " & strColorOfCar & ", " & strTypeOfCar
set Rs = server.createobject("adodb.recordset")
Rs.open strSql, conn
rs.movefirst
%>
<html>
<head>
<title>Double Value passing parameters</title>
</head>
<body>
<TABLE BORDER="1" width="80%">
<TR>
<% For Each Field In RS.Fields %>
<TH>
<%
response.write Field.name
%>
</TH>
<% Next %>
</TR>
'This section writes out the DATA of the fields in the Recordset
<% Do While Not RS.EOF %>
<TR>
<% For Each Field In RS.Fields %>
<TD ALIGN=center>
<%
Response.Write Field.Value
%>
</TD>
<% Next
RS.MoveNext %>
</TR>
<% Loop %>
</TABLE>
</body>
<%
Rs.close
set Rs = nothing
conn.close
set conn = nothing
%>
</html>
The stored Procedure that is passed the information
CREATE PROC sp_DoubleValue
(
'These local variables hold the data that is passed into the data. When formatting the string to be passed it has to be in the order of the fields
'You want the data to hold
@strColorOfCar varchar(255),
@strNumberOfDoors varchar(255)
)
AS
SELECT tblParamWithRecordsets.ColorOfCar, tblParamWithRecordsets.TypeOfCar, tblParamWithRecordsets.NumberOfDoors FROM tblParamWithRecordsets WHERE tblParamWithRecordsets.ColorOfCar
and
ORDER BY tblParamWithRecordsets.ColorOfCar DESC
Return
GO
*********************************************
*********************************************
*********************************************
XBuilder improves the customer experience on database-driven web sites by
speeding up page downloads. With faster page downloads, visitors return more
often and shoppers spend more money. Fast content delivery - that's what
XBuilder does for you. If your ASP, Cold Fusion or other database-driven web
site needs speed, you need XBuilder.
*********************************************
*********************************************
*********************************************
And the Monthly Question Winners Are!!
Here are the list of the monthly question winners ASPFree.com and Wrox Press
offers. If you can't find the answer anywhere on the Internet let
ASPFree.com help you out. Submit your question and if chosen by the Wrox
author you win a book of your choice! Enjoy this excellent resource.
Congrats to Larry T, Imamuddin S, M.Murali M., Jingping Z, Andre V., Nikhil
M.
October--Questions
Question:
How can I manage Microsoft Access users through ASP. I do not want to use a
table for storing this information, as I want to use the Userid & Password
supplied in the connection string to obtain access to the database.
Answer:
When connecting to Access databases you can specify the system database to
use:
conData.Provider = "Microsoft.Jet.OLEDB.4.0"
conData.Properties("Jet OLEDB:System database") = "c:\system_db_name"
conData.Open "Data Source=c:\database.mdb; User ID=user_name;
Password=user_pwd"
The system_db_name should be the name of your system database security file.
You can then use the standard User Name and Password details to connect.
Question:
What are ActiveX and VB Component and how do they help in dynamism of ASP
website? If I develop such component do I have to go to registry every time
to register a component or I can do without that?
Answer:
The idea of components is to encapsulate small areas of common functionality
and to promote reuse. For example, if dealing with a database you might want
to have data access routines in several ASP pages. So save coding the data
access code several times, you could build it into a component where it
could be reused (and not just by ASP pages - they can be reused by Visual
Basic/VC applications). Another advantage is in the area of scalability. As
web sites increase (in both size and the number of users) it's important
that response times don't degrade. Building components and letting MTS (or
the Component Services in Windows 2000) handle them removes much of the
complexity of component management.At the moment components do have to be
registered, but this can be handled automatically by using MTS.
This is very much the ideal way to build Microsoft centric web sites. It's
part of their core DNA strategy and components are going to be very
important in the future. For more details read Beginning Components for ASP,
by Wrox Press.
Question:
Hello there, i have just started to explore the depths of ASP. I would like
to know whether the record count is actual a bug in ASP or is there any
other ways of getting the record number
Answer:
The RecordCount is only available for client side cursors, or for server
side Static (adOpenStatic) and Keyset (adOpenKeyset). This is because for
other cursor types the number of records might change - other people might
insert/delete records and this could affect your record count. So for these
cursor types (server side forward only and server side dynamic) the
RecordCount is set to -1.
November-questions and answers
Question:
How to read data from excel sheet using ASP?
Answer:
Before reading data from Excel you need to ensure that a named range
encloses the data in the spreadsheet. You need to highlight the cells, and
then type the name into the range box (see the Excel help for more details).
Once the range is set you can use the following connection string for ADO:
Provider=MSDASQL; Driver={Microsoft Excel Driver (*.xls)};
DBQ=c:\spreadsheet.xls
Substitute the full name and path of your spreadsheet instead of
spreadsheet.xls. You can then use the range name as the source of the
recordset to open:
rsData.Open "range_name", conData
Question:
I need to retrieve images stored in a SQL 7 database and display them on a
web page using IIS 4 and ASP. How do I go about doing that? I can retrieve
text data no problem, but not images.
Answer:
You can't get an image directly from a database into an IMG field, as you
have to use the SRC attribute. However, the SRC attribute can be an ASP
file:
<IMG SRC="GetImage.asp">
You could then have the following as the GetImage.asp file:
<%
Response.Buffer = True
Response.ContentType = "image/bmp"
Set conImage = Server.CreateObject("ADODB.Connection")
conImage.Open " your connection string here"
Set rsImage = Server.CreateObject("ADODB.Recordset")
rsImage.Open "recordset containing image"
Response.BinaryWrite rsImage("ImgeField")
Response.End
%>
This uses the BinaryWrite method of the Response object. We've already set
the ContentType to indicate that an image is to be returned. There's more
examples of this at the end of Chapter 6 of the ADO 2.1 Programmer's
Reference.
Question:
How do I plot a graph in asp without using any images .ie. with just colored
horizontal lines that should be allowed to be dynamically scaled to the
length and width supplied by me so as to keep minimum overheads ?
Answer:
This is actually quite simple. The easiest way is to use normal IMG tags,
but use the WIDTH and HEIGHT attributes to stretch the width to the
appropriate size. If you create a GIF file a single pixel wide and a single
pixel high, then you can use this as the SRC of the IMG, using code like
this:
<IMG SRC="spot.gif" WIDTH="20" HEIGHT="50">
This stretches the image to fit the specified size. Alex Homer covered this
quite well in Chapter 9 of his Professional ASP Techniques for Webmasters.
It's a book well worth getting.
*********************************************
Confused on which version of Windows 2000 is right for you?
Here is an article found on CNET that does a very good job of explaining the
difference features with the four versions of Windows 2000. Thought we'd
might share this one for reference.
86.txt.1497797-7-1498891
*********************************************
New Links added
GASP - French site devoted to ASP.
Zoomout Meurant WEB - Provide free addons to easily create asp pages with
macromedia dreamweaver. Free are ASPGrid, ASPdropdown, ASPMail that writes
all the asp script for you.
Just ASP Jobs - This site offers an online engine when looking for ASP
career development.
**********************************************
Parting Thoughts!!
"The test of true character anyone is when the chips are down! Be
optimistic and don't sweat the small things!"
**********************************************
Enjoy see you next week!
Steve Schofield
Your Webmaster
"Your 1st source for free ASP live demo's, forums, downloads, source code,
and more! and now XML articles!!"
**********************************************
Know of anyone who wants to be updated about ASPFree.com. Sign-up by
clicking here Enter our email address and click
subscribe. That's it!
**********************************************
prev / next
Computer memory is the quickest, cheapest, and easiest way to improve the performance of your system. Find RAM memory upgrades for desktops, laptops, servers, and printers all backed by a lifetime warranty and guaranteed compatible with your computer. Shipping is an everyday low price of $1.99! Computer Memory Outlet sells memory compatible with all leading computer manufacturers like Dell, Apple, Compaq, HP, Sony, IBM, Lenovo, and many more.”
[ Comment, Edit or Article Submission ]