Forward Posted Form Data
suppose I have the following:
-----------BEGIN page1.asp----------
<form method="post" action="page2.asp">
<select name="someData" size="1" class="smallbutton">
<option value="1">Whatever</option>
</select>
'and a submit button
</form>
----------END page1.asp--------------
-----------BEGIN page2.asp----------
aVariable = Request.Form("someData")
<form method="post" action="page3.asp">
<select name="someOtheJjunk" size="1" class="smallbutton">
<option value="1">Whatever</option>
</select>
'and a submit button
</form>
----------END page2.asp--------------
Is there any kind of way to forward "someData", whch was
posted into page 2, to page 3 without making it more form data in page2. I
pretty much want to just be able to do something simple in page 3 like this:
-----------BEGIN page3.asp----------
anotherVariable = Request.Form("someData")
----------END page3.asp--------------
Thanks in advance. Tag: display utf-8 Tag: 282532
checkbox
i have a update page the pulles date form a database. and two the these
fields have Y or N in them and if the RS("Value") = Y the i want the
checkbox to be checked how do i do this?? Tag: display utf-8 Tag: 282523
How to process HTML pages on server side with HTML DOM?
Hi.
I'd like to process HTML documents in an ASP script, i.e. to remove any unwanted
elements and extract desired element and attributes. I know how to do it on
client side within IE using its HTML DOM. But what I'd like is to do it
server-side. Is there a way, for instance, to reuse MSIE technology to retrieve
interfaces like IHTMLElement, IHTMLDOMAttribute, aso, or just built-in features
that would allow me to do the same?
Thanks or any hint/suggestion.
Vince C. Tag: display utf-8 Tag: 282515
Here is a function for finding age
Here is a function where you don't have to worry about the leap year.
You will have to still be aware of time differences between you and
the server, and correct your data before entering it into the
function. And of course time zones, yada yada ....
BUT I think that most people using this will just want to say if today
is there bday than they are their new age.
It first takes the currentYear - birthYear - 1
Then it decides whether it needs to add a year(i.e if they had their
bday). First by just making a number out of the month and day ... it
makes the day 2 digits by adding a '0' in front of a single digit day.
Then puts month and day into one number .. like this
feb 2 = 202
july 10 = 710
oct 8 = 1008
dec 20 = 1220
and yes feb 29 = 229
Then if today is 301 it doesn't care ... 228 and 229 are both less
than 301.
I also added a part to compare ONLY the times ... if the day
comparison = 0 ... i.e. today is there bday
now, if you don't send a time with your date ... no problem ... it
will count today as being their new age
Tell me what you think ... I can clean up the code a bit if anyone
wants me to
<%
Function yearsOld(birthDate)
Dim currentDate, monthDayComparison, addYear: currentDate =
Now()
Dim birthDay, currentDay: birthDay = Day(birthDate):
currentDay = Day(currentDate)
'// Lets take the Date() BS out of the picture!!!
'//Compare Days by making a number out of month & day
... feb 29 = 229 while oct 8 = 1008
If Len(birthDay) = 1 Then: birthDay = "0" & birthDay:
End If
If Len(currentDay) = 1 Then: currentDay = "0" &
currentDay: End If
monthDayComparison = Int(Int(Month(currentDate) &
currentDay)) - Int(Month(birthdate) & birthDay)
If monthDayComparison > 0 Then '//had birthday this
year
addYear = 1
ElseIf monthDayComparison < 0 Then '//haven't had
birthday this year
addYear = 0
ElseIf monthDayComparison = 0 Then '// birthday today
addYear = 1
Dim timeDifference: timeDifference =
DateDiff("s", Hour(currentDate) & ":" & Minute(currentDate) & ":" &
Second(currentDate), Hour(birthDate) & ":" & Minute(birthDate) & ":" &
Second(birthDate))
If timeDifference > 0 Then: addYear = 0: End
If
End If
yearsOld = Year(currentDate) - Year(birthDate) - 1 + addYear
End Function
%> Tag: display utf-8 Tag: 282510
Can't find syntax error in Access query - lost!
select event_date, event_name, event_text, event_is_public,
event_is_reserved, event_img_path, event_img_alt, event_member_id,
event_is_email_notify from event where show_entry = '1' and
((Year(event_date) = #2004# and event_is_reserved = '0') or
event_is_reserved = '1' )
produces this error:
Microsoft JET Database Engine error '80040e07'
Syntax error in date in query expression 'show_entry = '1' and
((Year(event_date) = #2004# and event_is_reserved = '0') or
event_is_reserved = '1' )'.
/soa/val/event/calendar.asp, line 258
I'm totally lost here and I don't have the original .sql statement to have
produced the "event" table schema, so that won't help either. Here is line
258+:
sql = "select event_date, event_name, event_text, event_is_public, " &_
" event_is_reserved, event_img_path, event_img_alt,
event_member_id, " &_
" event_is_email_notify " &_
"from event " &_
"where show_entry = '1' " &_
" and ((Year(event_date) = #" & DatePart("YYYY", Date) & "# and
event_is_reserved = '0') or " &_
" event_is_reserved = '1' " &_
" )"
Response.Write(sql)
set rs = conn.execute(sql)
Guys, I don't know what to do and I'm in a huge deadline to have this fixed
by Monday AM and I'm completely stuck. Furthermore, I have no way of
accessing the original Access .mb file since it's on www.brinkster.com and
they forbid you from directly accessing any .mb file w/o their web-based
tool (which cannot tell you what the schema is).
My goal is to filter out a list of events from the event table where either
the event_is_reserved field is '1' or if both the event_is_reserved field is
'0' and the event_date is of the current year (event_date's format is
'/mm/dd/yyyy').
Original site breakage at:
http://www3.brinkster.com/soa/val/event/calendar.asp
Help!
Thanx
Phil Tag: display utf-8 Tag: 282505
FSO Deleting Files Problem
Hi
i'm using the following code to delete a file but when i execute the script
it just freezes until timeout. any idea of the problem??
'///DELETE ORGINAL FILE
Dim objFSO
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFile "C:\Documents and Settings\Gav\My
Documents\Date\Website\www\user_images\" & filename
Set objFSO = Nothing Tag: display utf-8 Tag: 282489
file upload problem
Dear Sir,
I am trying to use do a upload function on my site. I got a upload class
from Internet. However, sometimes, it works, sometimes, it give me the
following error.
Microsoft VBScript runtime error '800a0005'
Invalid procedure call or argument
/viplogin/include/UploadClass.asp, line 136
Line 136 is following
For nIndex = 1 to LenB(FileData)
oFile.Write Chr(AscB(MidB(FileData,nIndex,1))) --- Line 136
Next
Can someone help me out??
<my upload class>
<%
'***************************************
' File: Upload.asp
' Author: Jacob "Beezle" Gilley
' Email: avis7@airmail.net
' Date: 12/07/2000
' Comments: The code for the Upload, CByteString,
' CWideString subroutines was originally
' written by Philippe Collignon...or so
' he claims. Also, I am not responsible
' for any ill effects this script may
' cause and provide this script "AS IS".
' Enjoy!
'****************************************
Class FileUploader
Public Files
Private mcolFormElem
Private Sub Class_Initialize()
Set Files = Server.CreateObject("Scripting.Dictionary")
Set mcolFormElem = Server.CreateObject("Scripting.Dictionary")
End Sub
Private Sub Class_Terminate()
If IsObject(Files) Then
Files.RemoveAll()
Set Files = Nothing
End If
If IsObject(mcolFormElem) Then
mcolFormElem.RemoveAll()
Set mcolFormElem = Nothing
End If
End Sub
Public Property Get Form(sIndex)
Form = ""
If mcolFormElem.Exists(LCase(sIndex)) Then Form =
mcolFormElem.Item(LCase(sIndex))
End Property
Public Default Sub Upload()
Dim biData, sInputName
Dim nPosBegin, nPosEnd, nPos, vDataBounds, nDataBoundPos
Dim nPosFile, nPosBound
biData = Request.BinaryRead(Request.TotalBytes)
nPosBegin = 1
nPosEnd = InstrB(nPosBegin, biData, CByteString(Chr(13)))
If (nPosEnd-nPosBegin) <= 0 Then Exit Sub
vDataBounds = MidB(biData, nPosBegin, nPosEnd-nPosBegin)
nDataBoundPos = InstrB(1, biData, vDataBounds)
Do Until nDataBoundPos = InstrB(biData, vDataBounds & CByteString("--"))
nPos = InstrB(nDataBoundPos, biData, CByteString("Content-Disposition"))
nPos = InstrB(nPos, biData, CByteString("name="))
nPosBegin = nPos + 6
nPosEnd = InstrB(nPosBegin, biData, CByteString(Chr(34)))
sInputName = CWideString(MidB(biData, nPosBegin, nPosEnd-nPosBegin))
nPosFile = InstrB(nDataBoundPos, biData, CByteString("filename="))
nPosBound = InstrB(nPosEnd, biData, vDataBounds)
If nPosFile <> 0 And nPosFile < nPosBound Then
Dim oUploadFile, sFileName
Set oUploadFile = New UploadedFile
nPosBegin = nPosFile + 10
nPosEnd = InstrB(nPosBegin, biData, CByteString(Chr(34)))
sFileName = CWideString(MidB(biData, nPosBegin, nPosEnd-nPosBegin))
oUploadFile.FileName = Right(sFileName,
Len(sFileName)-InStrRev(sFileName, "\"))
nPos = InstrB(nPosEnd, biData, CByteString("Content-Type:"))
nPosBegin = nPos + 14
nPosEnd = InstrB(nPosBegin, biData, CByteString(Chr(13)))
oUploadFile.ContentType = CWideString(MidB(biData, nPosBegin,
nPosEnd-nPosBegin))
nPosBegin = nPosEnd+4
nPosEnd = InstrB(nPosBegin, biData, vDataBounds) - 2
oUploadFile.FileData = MidB(biData, nPosBegin, nPosEnd-nPosBegin)
If oUploadFile.FileSize > 0 Then Files.Add LCase(sInputName),
oUploadFile
Else
nPos = InstrB(nPos, biData, CByteString(Chr(13)))
nPosBegin = nPos + 4
nPosEnd = InstrB(nPosBegin, biData, vDataBounds) - 2
If Not mcolFormElem.Exists(LCase(sInputName)) Then mcolFormElem.Add
LCase(sInputName), CWideString(MidB(biData, nPosBegin, nPosEnd-nPosBegin))
End If
nDataBoundPos = InstrB(nDataBoundPos + LenB(vDataBounds), biData,
vDataBounds)
Loop
End Sub
'String to byte string conversion
Private Function CByteString(sString)
Dim nIndex
For nIndex = 1 to Len(sString)
CByteString = CByteString & ChrB(AscB(Mid(sString,nIndex,1)))
Next
End Function
'Byte string to string conversion
Private Function CWideString(bsString)
Dim nIndex
CWideString =""
For nIndex = 1 to LenB(bsString)
CWideString = CWideString & Chr(AscB(MidB(bsString,nIndex,1)))
Next
End Function
End Class
Class UploadedFile
Public ContentType
Public FileName
Public FileData
Public Property Get FileSize()
FileSize = LenB(FileData)
End Property
Public Sub SaveToDisk(sPath)
Dim oFS, oFile
Dim nIndex
If sPath = "" Or FileName = "" Then Exit Sub
If Mid(sPath, Len(sPath)) <> "\" Then sPath = sPath & "\"
Set oFS = Server.CreateObject("Scripting.FileSystemObject")
If Not oFS.FolderExists(sPath) Then Exit Sub
Set oFile = oFS.CreateTextFile(sPath & FileName, True)
For nIndex = 1 to LenB(FileData)
oFile.Write Chr(AscB(MidB(FileData,nIndex,1)))
Next
oFile.Close
End Sub
Public Sub SaveToDatabase(ByRef oField)
If LenB(FileData) = 0 Then Exit Sub
If IsObject(oField) Then
oField.AppendChunk FileData
End If
End Sub
End Class
--
Met vriendelijke groet,
Guoqi Zheng
Tel: +31 (0) 23 5343545
http://www.meetholland.com Tag: display utf-8 Tag: 282473
Finding Age from Date of Birth
I have a database with date of births stored dd/mm/yyyy (english dating
system) and =date() returns a date in the same format in my server.
how do i find the persons age using these two pieces of date.
thanks
gavin Tag: display utf-8 Tag: 282465
passing a parameter to SQL MIN() function
From ASP I run a query using MIN(some_field/parameter)
Now I need to pass this parameter to the query from ASP code
How do I do that?
Syntax like
MIN([some_field] / [])
does not work Tag: display utf-8 Tag: 282464
correct syntax for multiple sql query
hello again people...
Access2000, IIS6, win XP pro
I have a form where users can enter search criteria for various products.
now, if this form has 2 fields, colour and size (it wil have more but I'm
assuming the the principle for two fields will be the same for ten fields)
what would be the correct syntax for performing a query where the user
didn't enter a criteria for both fields?
the search string would be
strSQL = "SELECT * FROM products where colour = " & "'" &
request.form("searchstrcolour") & "'" & "AND size =" & "'"
request.form("searchstrsize") & "'" & " ORDER by price"
so if the user selects blue and large, thats fine
but what if the user only selected say blue and didn't bother with the size?
is there a wild card that I could use?
many thanks Tag: display utf-8 Tag: 282463
ms access on multi-user environment
good day...
im working right now on a project given to me on a short time. i had a
slight problem though, but it seems that most of it comes on my
database. since theres not enought budget on having a good database
like sql server, i just stayed on the access. my problem is, i can run
my applications on multi-user enviroment using sql server but not on
the access. running my applications simultaneously on a multi-user
enviroment using msaccess causes my applications to crash down. is
there any way i could turn on the access into a superman??? is there
any site in the web that i could see regarding this problem? please
help me. thanks anyway. Tag: display utf-8 Tag: 282462
How to translate value in URL
Hi All,
I have a nagging problem.
I try to put a value of the autonumber field of a record into a string
so it can be read in a new page.
In the first form I use in HTML the following:
JavaScript:window.open('Weapon_related.asp?<%=myAutoNum%>...... etc
When I open the page I get an error and in the properties I read this:
http://localhost/Weapon2000/Weapon_related.asp?<%=myAutoNum%>
Where it should say:
http://localhost/Weapon2000/Weapon_related.asp?26
In ASP code I have written:
MyAutoNum = Recordset.Fields("txtWID") ---> where txtWID is the autonum field.
for example 26.
How do I get the code to return the actual number (26) instead of <%=myAutoNum%>
This would help a great deal
Marco
The Netherlands Tag: display utf-8 Tag: 282460
ASP Page problem
Hello all.
I installed IIS last week and the server works ok.
But when try to open the localstart.asp or iisstart.asp=20
page the server returns a 'Server Application Error' page.
In the 'Visor de Sucesos'<Event Viewer> the message is=20
this:
<<< >>>>
Tipo de suceso: Advertencia
Origen del suceso: W3SVC
Categor=EDa del suceso: Ninguno
Id. suceso: 36
Fecha: 04/01/2004
Hora: 12:51:19 a.m.
Usuario: No disponible
Equipo: N0J3L7
Descripci=F3n:
El servidor no pudo cargar la=20
aplicaci=F3n '/LM/W3SVC/1/Root'. Error 'Clase no registrada
'.=20
Para recibir informaci=F3n adicional referente a este=20
mensaje, visite el sitio Web de soporte t=E9cnico de=20
Microsoft que se encuentra en:=20
http://www.microsoft.com/contentredirect.asp.
Para obtener m=E1s informaci=F3n, vea el Centro de ayuda y=20
soporte t=E9cnico en=20
http://go.microsoft.com/fwlink/events.asp.
<<< >>>>
Can help me??
Thanx a lot,
Juan Pedro Tag: display utf-8 Tag: 282458
Avoiding Page numbers & Page URL
When we print an HTML page from the browser,the Page
Number (at Top right) and page URL (At bottom) is printed.
How can we avoide these information so that our page print
out look similar to a simple printed page same as word
document?
JESS Tag: display utf-8 Tag: 282456
Calculating field in ASP
I have an Access database used to track donor pledges. In it, there is a
table that contains three fields for each donor: Gift_Amount, Gift_Per_Year,
and Matching_Gift_Ratio.
The following formula would calculate the total pledge amount for each
donor:
(Gift_Amount * Gift_Per_Year) * (Matching_Gift_Ratio + 1).
A total Pledge for all donors would just sum up the calculated values.
My goal is to create an ASP that would show this total amount pledged. Here
is the ASP that I have created so far:
***********************************************
<html>
<head>
<title>Pledge Totals</title>
</head>
<body bgcolor="white" text="black">
<%
'Dimension variables
Dim adoCon 'Holds the Database Connection Object
Dim rsGiving 'Holds the recordset for the records in the database
Dim strSQL 'Holds the SQL query for the database
Dim totalamt 'Holds the Total Pledge amount, a calculated field
Dim dollars 'Holds the formated currency amount
'Create an ADO connection odject
Set adoCon = Server.CreateObject("ADODB.Connection")
'Set an active connection to the Connection object using a DSN-less
connection
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" &
Server.MapPath("Careathon_SP2004.mdb")
'Set an active connection to the Connection object using DSN connection
'adoCon.Open "Careathon_SP2004"
'Create an ADO recordset object
Set rsGiving = Server.CreateObject("ADODB.Recordset")
'Initialise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT Giving.Gift_Amount, Giving.Gifts_Per_Year,
Giving.Matching_Gift_Ratio FROM Giving WHERE Gift_Amount>0 AND
Gifts_Per_Year>0"
'Open the recordset with the SQL query
rsGiving.Open strSQL, adoCon
'Loop through the recordset
Do While not rsGiving.EOF
'Calculate total donor pledge and add to cumulative total - THIS IS WHERE
THE CODE STOPS AND THE ERROR OCCURS
totalamt = totalamt + ((rsGiving("Gift_Amount") *
rsGiving("Gifts_Per_Year")) * (rsGiving("Matching_Gift_Ratio") + 1))
'Move to the next record in the recordset
rsGiving.MoveNext
Loop
'Formats the total amount to currency
'set dollars = FormatCurrency(totalamt, 2, -1, 0, 1)
'Write the HTML to display the total pledge amount
Response.Write ("<br> $ ")
'Response.Write (dollars)
Response.Write (totalamt)
Response.Write ("<br>")
'Reset server objects
rsGiving.Close
Set rsGiving = Nothing
Set adoCon = Nothing
Set totalamt = Nothing
Set dollars = Nothing
%>
</body>
</html>
**********************************************
However, when I run this page, I get the following error:
Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch
It occurs on the line with the calculations.
What do I need to change in order for this page to work correctly? Tag: display utf-8 Tag: 282446
Mail via ASP
Ik ben nog niet zo op de hoogte op het gebied van ASP, maar laatst heb ik
geprobeerd een script te schrijven om een e-mail vanaf een asp-pagina te
verzenden. Dit is me echten niet gelukt. Het enige dat er op m'n pagina
verscheen was:
CDO.Message.1 error '80040220'
The "SendUsing" configuration value is invalid.
/test.asp, line 13
en er werd dus geen e-mail gestuurd... Ik snap niet wat ik verkeerd heb
gedaan, misschien kan iemand mij helpen...
De codes die ik gebruikt heb zijn:
<%
Dim MyMail
Set MyMail = Server.CreateObject("CDO.Message")
MyMail.From = "info@theSyreens.nl"
MyMail.To = "bram.s@planet.nl"
MyMail.Cc = ""
MyMail.Bcc = ""
MyMail.Subject = "Testmail"
MyMail.TextBody = "<H1><i>the Syreens</i></h1>Bla Bla Bla"
MyMail.AddAttachment ""
MyMail.Fields("urn:schemas:httpmail:importance").Value = 1
MyMail.Fields.Update()
MyMail.Send()
Set MyMail = Nothing
%> Tag: display utf-8 Tag: 282444
Jmail Professional
Hi guys,
I'm developing a web site with email capabilities: I have tried the
free version of Jmail, now I need Jmail Professional but still don't
want to buy it before having the chance to try it.
Can someone email it to me please?? I do want to buy it and I will,
but after trying it, that's all.
Thanks a lot,
Paolo Tag: display utf-8 Tag: 282437
detecting page name
Quick simple question...
how do u detect what the current pagename is (i.e. page.asp). also if the
command is stored in the include will it return the include file name or the
page that the command is included in name?
cheers
gavin Tag: display utf-8 Tag: 282432
how to read value from a textbox in a new form
Hi All,
I tried to read the value of a textbox in another form.
I have a page which contains one record. The textbox "txtWID" contains
the autonumber of the record. I want to read this value in a new page
so
I can set a WHERE for my query:
Dim eben
session("txtWID")=request("txtWID")
eben = request("txtWID")
SQL = "SELECT Weapon.WID AS Weapon_WID, Weapon1.name AS Weapon1_name
" & _
"FROM (WeaponsPerWeapons INNER JOIN Weapon ON
WeaponsPerWeapons.WID = Weapon.WID) INNER JOIN Weapon Weapon1 ON
WeaponsPerWeapons.Weapon = Weapon1.WID"
CountSQL = "SELECT COUNT(*) " & _
"FROM (WeaponsPerWeapons INNER JOIN Weapon ON
WeaponsPerWeapons.WID = Weapon.WID) INNER JOIN Weapon Weapon1 ON
WeaponsPerWeapons.Weapon = Weapon1.WID"
Where = "Weapon.WID = " & eben
Order = "Weapon1.name"
session("txtWID") = ""
This is however not working because I use an imagelink to go to the
new page.
There is no way to put the value of the txtWID into the URL of the
link image.
I tried something like href="weapon_related.asp?<%=.....%>" but that
doesn't work. If I write "href=weapon_related.asp?26" then I can
translate this for the
WHERE clausule but I want to get the value of the autonumber field
since it's
never the same.
This would then work eben = Replace(Request.QueryString,"%20"," ")
Where = "Weapon1.WID = " & eben
What is my mistake
Regards
MArco Tag: display utf-8 Tag: 282430
Dynamic pages and search engines
Not a coding question as such but highly related to asp/dynamic pages issues
: has anyone any suggestions on the following
ASP sites are generally (always) of a dynamic nature, pages can be built on
the contents of querystrings, so search engines can only be directed to your
first index.asp page since the search engine is unable to deduce what
querystring parameters should/could be used.
I have a company listing site and would like each companys listing info to
be found by the search engines, so that each can be picked up on their own
features.
I have seen schemes which attempt to make the site more static by using the
error 404 page and dummy urls, which can then be parsed by the 404 page to
rebuild the correct dymanic url to redirect user into the correct page.
But this can only work (as far as I can see) if your site also contains a
lot of seed pages which make reference to those urls for the search engines
to crawl down , in which case I might just as well have 'seed' pages
containg the normal dynamic url's ( google seems to handle those ok now) and
not bother with the 404 lark.
However on a company listing site, you have or hope to have a large number
of entries, currently I have some 200k listed, now if I genereate 'seed'
pages at 100 companies / page thats going to be a heck of a lot of 'seed'
pages - no problem to generate them for me, but are they likley to be
regarded as an attempt to spam the engine and so be disregarded and so in
the end be a waste of time
I would be interested in others ideas and thoughts on the subject Tag: display utf-8 Tag: 282429
What button do I need to open a new form
Hi All,
I need a button on my form that opens a new window.
I put in a submit button but it always returns to my first page.
And then my first page is empty.
What button do I need to go to another page (weapon_related)?
This is what I use at the moment:
'NewRecord1 Operation Method @3-0C905987
Sub Operation()
If NOT ( Visible AND FormSubmitted ) Then Exit Sub
If FormSubmitted Then
PressedButton = "Button1"
If Not IsEmpty(CCGetParam("Button1", Empty)) Then
PressedButton = "Button1"
End If
End If
session("txtWID")=request("txtWID")
Redirect = "Weapon_related.asp?" & CCGetQueryString("QueryString",
Array("ccsForm", "Button1"))
If Validate() Then
If PressedButton = "Button1" Then
If NOT Button1.OnClick() Then
Redirect = "Weapon_related.asp?" &
CCGetQueryString("QueryString", Array("ccsForm", "Button1"))
End If
End If
Else
session("txtWID")=request("txtWID")
Redirect = "Weapon_related.asp?" &
CCGetQueryString("QueryString", Array("ccsForm", "Button1"))
End If
End Sub
'End NewRecord1 Operation Method
Tnx in advance
Marco Tag: display utf-8 Tag: 282425
Printing in ASP
What are the best approaches to create printer friendly
pages in ASP web sites.?
Please provide us help or links to useful artciles on this
topic.
Also can we avoid creating separate printer friendly pages
and send the current page output to printer as the PRINT
button is clicked?
I have seen this functionality when we print our MCP
transcript in MS certificastion site?
JESS Tag: display utf-8 Tag: 282424
Spell Checking in ASP
Hi,
We need to spell check Text Areas in our ASP pages. We
don't want to use MS Word.
We are looking for an cost-effective, easy to configure
and use, well-known COM-based Spell Checker component.
Please advice us information about this kind of
products/components and the links also...
Thanks
JESS Tag: display utf-8 Tag: 282423
Converting to binary
I am using XMLhttp and responsebody to receive info from a webpage
I dont use responsetext since i need the international chars åäö
The information I recieve is binary is there any fast way to convert the
binary data to text ?
I used this function but its slow compared to response.binarywrite
and i need the information in a string so I can alter it with my script.
So is there any way to convert Binary to Text just as fast as
response.binarywrite ?
Function BinaryToString(Binary)
Dim I, S
For I = 1 To LenB(Binary)
S = S & Chr(AscB(MidB(Binary, I, 1)))
Next
BinaryToString = S
End Function Tag: display utf-8 Tag: 282409
programming advice requested
Sorry for the non-descriptive subject line.
If you go to http://www.middletree.net/shape.asp, you'll see that I have a
form to fill out.(Ignore the prefilled names and other data; it's just for
testing) When this is filled out, there will be a row in the master table,
called Personal, and there are also static tables for those 4 checkbox areas
you see, called Area, Gift, Ability, and People. Because users can check
more than one box, I resolved the many-to-many by created a union table
(join? composite? not sure what to call that type of table);
Anyway, there are 4 combo tables, PersonalPeople, PersonalGift,
PersonalAbility, and PersonalArea. As the names imply, each only has 2
fields: the PK of the Personal table, and the PK of one of the other 4
tables.
Now, the question: If you go to http://www.middletree.net/list.asp, you'll
see that it displays a list of all users who have filled out the form.
At the bottom, I have started adding a form that lets you refine the search
and give you a similar list, but one which meets the criteria selected. In
other words, if you select Leadership under the Gifts dropdown, and click
the button (which is not there yet), it should show you all people who
chcked the Leadership checkbox, regardless of what else they selected. But
if you select Leadership from that dropdown, and College from the People
Groups dropdown, then it would give you only those who selected Leadership
and College.
Problem is, I am not sure how to code the SELECT statement to do this.
I guess it has to be a join, but not sure how to do it. I have to leave
open the possibility that someone might leave one or more dropdowns
unselected. I have done joins before, but am drawing a blank on this one.
FWIW, this is using Access 2000. Tag: display utf-8 Tag: 282401
HTML overwritten by Response.OutputStream.Write
I'm working on a site that creates mailing labels. When a label is
generated, two things happen in the background with the image.
First, it is saved as a smaller low-quality .gif on the server and
then presented as a preview using an img tag (also later used for a
history feature on the site).
Second, when the user clicks on the image, a new window appears with
only the mailing label as a high-quality .png graphic. I don't save
the .png image to conserve hardrive space, so I use
response.outputstream.write to output the image array. I do this
because it is important to have crisp barcodes on the labels.
The problem is that by doing this, the html in the aspx file isn't
sent to the client, just the image. I would like to use
window.print() on the client side. I tried using
Page.RegisterStartUpScript; it runs, but isn't output to the user no
matter if it is ran before or after the OutputStream.
Anyone else seen a similar problem?
Is there a way to display an image that is in server memory to an
image tag? Tag: display utf-8 Tag: 282381
expiring pages
Hi,
I have a form which sibmits data to another page. Trouble is when the user
refreshes the page it resubmits all the data again.
Is there anyway to expire the page immediatly so this cant happen??
gav Tag: display utf-8 Tag: 282371
asp/html editor
This is a multi-part message in MIME format.
------=_NextPart_000_0036_01C3D185.A7B3A650
Content-Type: text/plain;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
tna | email messageAnyone know of an ASP app that will open up either a =
HTML page / ASP page, and read in the code and use it as a HTML editor?
I know of a number of people who want to use "Frontpage on the internet" =
plus it would come in handy for the CMS i'm building =3D)
Thanks,
Tim.
------=_NextPart_000_0036_01C3D185.A7B3A650
Content-Type: text/html;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>tna | email message</TITLE><BASE=20
href=3D"file://C:\Program Files\Common Files\Microsoft =
Shared\Stationery\">
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dwindows-1252"=20
windows-1252?><BASE=20
href=3D"C:\Program Files\Common Files\Microsoft Shared\Stationery\TNA =
Stationery.htm">
<STYLE>BODY {
FONT-SIZE: 10pt; COLOR: #000000; FONT-FAMILY: Tahoma
}
</STYLE>
<META content=3D"MSHTML 6.00.2800.1170" name=3DGENERATOR></HEAD>
<BODY bgColor=3D#ffffff>
<DIV>Anyone know of an ASP app that will open up either a HTML page / =
ASP page,=20
and read in the code and use it as a HTML editor?</DIV>
<DIV> </DIV>
<DIV>I know of a number of people who want to use "Frontpage on the =
internet"=20
plus it would come in handy for the CMS i'm building =3D)</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>Thanks,</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>Tim.</DIV></BODY></HTML>
------=_NextPart_000_0036_01C3D185.A7B3A650-- Tag: display utf-8 Tag: 282369
Sugestions on asp editor
Anyone offer sugestions on a good asp editor im looking at replacing FP with
an allrounded comercial asp editor.
Regards
Don Tag: display utf-8 Tag: 282368
CDONTS email
Hello
I am trying have a feed back page and created an ASP page
to send an email. But I get the following error:
Error Type: Server object, ASP 0177 (0x800401F3)
Invalid class string
The line in the page is as follows:
Set Mailer = Server.CreateObject("CDONTS.Mailer")
Any suggetions to fix this, is appreciated.
Thanks Tag: display utf-8 Tag: 282366
Why is there a delay when i browse to my first aspx page?
I have a IIS server somewhere hosting an aspx website. Whenever i tried
to access the website after some times, my browser will like wait about
10-20 seconds before showing the contents. But after that, subsequent
pages is load up almost instantly. The page is not heavily loaded and
every pic should be cached.
And sometimes, after 1 or 2 days didn't access the site, when i tried to
access again, it will never load up the page. My IIS server is never
shutdown running 24/7. I have to go to my IIS server and move around
with the mouse then go back to my workstation and try again in order for
it to work. (My IIS server (also my Internet gateway) will not go into
Sleep mode because i still can surf from my workstation.)
Can someone explain to me the problem?
Thanks. Tag: display utf-8 Tag: 282365
How is this done
I was browsing the newsgroup and viewed a website that
interest me. Look at this example:
http://www.fullrevolution.com/calendar40/calendar.asp?
caltype=day&date=1/29/2004#Eight
It is a calendar based internet application. I was
wondering how it displays blocks of time out similar to
Outlook. If you view that page, you will notice that it
shows a day view and has conference room blocked out from
8-5 and they showed it in a graphical form. I can
understand writing out a message saying conference room
for each allocated time slot, but how do they continue
the rectangle block for the allocated time. If anyone
understand what I am trying to say and has any resources,
I would be delighted to hear conversations about this.
Thanks for all your help. Tag: display utf-8 Tag: 282364
copy from body into title
Hi,
I need some asp which I can use to put between some words within the
body of a page which takes these words and places them inbetween the
title tags.
The idea is when an editor changes these tagged words (with
Contribute2), it will also change in the title tags of a page.
Any ideas?? Tag: display utf-8 Tag: 282360
Can't Load ActiveX component
(hope its the right forum)
I'm trying to configure IIS (create new web site) in code.
My code works fine within a standard windows application,
however, when I copy the code to an asp.net page, I get
the above error message. It occures in the
function 'GetObject("IIS://localhost/W3SVC")'.
Hope someone can help me on this,
Thanks in advance,
Y. Pechter Tag: display utf-8 Tag: 282354
display 5 records across, unlimited rows
Greetings,
I have a page displaying records in a table across but there are too
many records to display and they run off the page, SO I thought I could
show five columns with an unlimited number of rows. I'm stuck though.
I've never done that before. I don't know where to start. Any thoughts
would be very helpful.
I don't need paging as I can display all records on one page, keeping it
simple.
Here's my recordset:
<%set rsAll=objConn.execute("select * from qyProd where catalogid>0
order by designer_name")%>
Thank you in advance.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it! Tag: display utf-8 Tag: 282353
Automating a task
I have an ASP application which includes an asp page which
processes a user submitted file. I would like to
automate the process so the server scans the directory
every 5 minutes and processes any files in the directory.
I would like to 'reuse' the existing logic in the asp
page. How can I create a server process to do this?
The closest I can figure out is to hook the logic into a
application/session start logic in global.asa where it
would run everytime a new session was started, but I would
like it to run like a cron job every 5 minutes.
Background:
I now have a vb application which is submitting the files
and have no way to kick off the server processing logic.
I am using asp 3.0 and am trying to avoid creating a
webservice. I want to use the existing asp page since it
is using 3rd party proprietary com objects.
TIA Tag: display utf-8 Tag: 282349
Session Onstart
In my global.asa file I note the IP address of whomever visits my site and
log it to a SQL table.
The default page of the site is a frameset with three frames.
It appears that global.asa or at least session_onstart is called three times
as I end up with thee entries in the table.
I thought that session_onstart was only called one for a session. am I
missing something?
Thanks,
-dmd- Tag: display utf-8 Tag: 282346
Creating interactive user-controlled ordering mechanisms on admin web interfaces?
(originally posted to one of macromedia's groups; no help, so hopefully
someone here can help me out. I'm using VBScript ASP.)
When designing administrative interfaces to websites, we often need to
provide users with a mechanism to change the order of items that are listed
on the page.
I have not come up with a graceful and elegant way to offer an interactive
ordering capability on administration forms, as you see in many desktop
apps. You can design various hacks -- say, allowing the user to designate
items "high priority" to trump mechanized ordering solutions, or allow the
user to assign an order integer or letter to each items. However, all of
these methods have a hacky, sucky quality to them.
What I would like is a means of allowing users an easy-to-use and
interactive way to adjust the order of listed records. Ideally I would like
some way that the user could select an item and/or make a single item go up
and down in the list on the admin page, and have that list order reflected
on the final page. Perhaps you print an imagemap "up" and "down" arrow
adjacent each listing, and pressing the "up" or down" button moves it up or
down. Or perhaps you have some client-side javascript widget that allows
selection and then movement via a single set of up/down controls.
There's three components to this: how you handle the ordering on the
database side, how you handle the UI issues on the web application, and how
you update the database information appropriately based on the user's input.
The hardest part of this problem is figuring out what needs to happen on the
database side: you have a collection of "ordering" values, with one each
presumably associated with each database record, and presumably you need ALL
the items updated for the collection of items you're administering.
Otherwise, you end up with messed-up situations where there are two
identically ordered items and the application doesn't know the right thing
to do.
Or maybe you somehow store the list order of items for a "publication" in a
single field on tblPubs, split the itemIDs out into an array, and update as
necessary. Somehow this approach feels like it may invite the wrath of the
database purity zealots, and it may not work well for open-ended
publications (e.g. an online newspaper that is continually updated.)
There may be a widget in ASP that's a cousin to concept like "queues" or
"stacks" that could help us.
Answering a small piece of my own question: this article has some tidbits
that may help:
http://www.4guysfromrolla.com/webtech/102799-1.shtml
Some smart person out there has solved this, and maybe you even have a link
to an article or tutorial. Can anyone suggest a solution and/or a starting
point?
Thanks,
KF Tag: display utf-8 Tag: 282336
Creating interactive user-controlled ordering mechanisms on admin web interfaces?
(originally posted to one of macromedia's groups; no help, so hopefully
someone here can help me out. I'm using VBScript ASP.)
When designing administrative interfaces to websites, we often need to
provide users with a mechanism to change the order of items that are listed
on the page.For example, the _New York Times_ website
(http://www.nytimes.com) lists a bunch of top news articles, and normally
these are ordered by purely mechanical criteria (e.g. datetime published.)
However, we sometimes want to allow our users a way to influence the list
order themselves, say, to allow a particularly newsworthy item to persist at
the top of the list.
I have not come up with a graceful and elegant way to offer an interactive
ordering capability on administration forms, as you see in many desktop
apps. You can design various hacks -- say, allowing the user to designate
items "high priority" to trump mechanized ordering solutions, or allow the
user to assign an order integer or letter to each items. However, all of
these methods have a hacky, sucky quality to them.
What I would like is a means of allowing users an easy-to-use and
interactive way to adjust the order of listed records. Ideally I would like
some way that the user could select an item and/or make a single item go up
and down in the list on the admin page, and have that list order reflected
on the final page. Perhaps you print an imagemap "up" and "down" arrow
adjacent each listing, and pressing the "up" or down" button moves it up or
down. Or perhaps you have some client-side javascript widget that allows
selection and then movement via a single set of up/down controls.
There's three components to this: how you handle the ordering on the
database side, how you handle the UI issues on the web application, and how
you update the database information appropriately based on the user's input.
The hardest part of this problem is figuring out what needs to happen on the
database side: you have a collection of "ordering" values, with one each
presumably associated with each database record, and presumably you need ALL
the items updated for the collection of items you're administering.
Otherwise, you end up with messed-up situations where there are two
identically ordered items and the application doesn't know the right thing
to do.
Or maybe you somehow store the list order of items for a "publication" in a
single field on tblPubs, split the itemIDs out into an array, and update as
necessary. Somehow this approach feels like it may invite the wrath of the
database purity zealots, and it may not work well for open-ended
publications (e.g. an online newspaper that is continually updated.)
There may be a widget in ASP that's a cousin to concept like "queues" or
"stacks" that could help us.
Answering a small piece of my own question: this article has some tidbits
that may help:
http://www.4guysfromrolla.com/webtech/102799-1.shtml
Some smart person out there has solved this, and maybe you even have a link
to an article or tutorial. Can anyone suggest a solution and/or a starting
point?
Thanks,
KF Tag: display utf-8 Tag: 282334
Custom tag function?
I'm stuck in a problem
Hi I want to create a funtion in asp.
Like this [userid=Smith] Then the function convert the "custom tag" to.
<a href=www.mypage.com/user/Smith>Smith</a>
How to do?
I'm real stucked.
// Hagge Tag: display utf-8 Tag: 282327
ASP to Excel
I'm not sure which group is most appropriate for this
question; I'll also post this in office solutions
development. I am running into problems with something
that seems to be a popular requirement - porting data from
an asp page to an Excel workbook to allow users to
manipulate data. I have a few different methods working,
but also with some issues. I want to know if these are
technical limitations, or if there is another direction to
take such as web query...
I have successfully used the "Response.ContentType
= "application/vnd.ms-excel" in ASP to stream everything
in the page as an Excel document. However, when I use
this, simple SUM() formulas do not work in the resulting
Excel worksheet. The worksheet does not recognize results
from my dataset as true number types.
In response to a previous post, I tried using another
method - constructing, and manipulating a worksheet object
using ActiveX. This allows the user to play with the
resulting worksheet, however, they would be required to
change their default IE settings. This is a corporate
intranet app, and requiring our entire user base to tweak
their browser settings is going to be unreasonable.
I am trying to stay away from writing out distinct Excel
files on the server for performance, and security
concerns. As I understand it, web query will generate a
physical file to download. Can web query instead stream
content to a browser? Any other suggestions?
THANKS,
Ben Tag: display utf-8 Tag: 282324
Setting up IIs to work with asp
I am trying to get ASP to work with IIS and i keep getting
page cannot be displayed when i try to open asp pages? Do
i have some settings wrong somewhere? Tag: display utf-8 Tag: 282313
passing session variables frm ASP to JSP
Does anyone have experience with passing variables from an ASP page to
a JSP page.
The way it currently works in passing the SSN in the URL. This cannot
be good.
I thought that storing a unique session ID in a cookie and referencing
the SSN from the Session ID would be the correct way to do this. But
since we have two separate servers, IIS and Websphere, how do we
coordinate the session ID?
Perhaps I could write the session ID to a database table in the ASP
page, then requery it with the JSP page.
Any help would be greatly appreciated.
Thanks in advance.
Jason Tag: display utf-8 Tag: 282306
Best location to install temporary files
I am writing a web based application that uses an ActiveX control on a
web page to install files on the user's computer. These files will
then be opened using programs on the user's computer such as WordPad.
Some of the files will be also executed and delete the files which are
not longer required.
The files are not meant to be permanently left on the users computer,
so there are by definition ?temporary' files but will need to survive
a re-boot.
Can someone advise me on the best folder to copy these files to? I
want to avoid or reduce security issues. Because this is a web-based
application, I have no control over what security is in place.
Examples of folders I have in mind are:
\WINDOWS\
\WINDOWS\Downloaded Program Files (can this folder contain exe files?)
\WINDOWS\Temp
Creating a new folder somewhere on the user's hard disk
Regards
Allan Cammish Tag: display utf-8 Tag: 282303
Visitor Stats
Hi,
I'm writing a VERY BASIC stats databse for the default page of my web site.
I'm detecting various stats and saving them:
<%
visitdate = date()
visittime = time()
visitbrowser = Request.ServerVariables("HTTP_USER_AGENT")
visitreferer = Request.ServerVariables("HTTP_REFERER")
' code here for screen size
' code here to save to database
%>
I wish to also get screen resolution/size. I realise this is client side so
I can use:
<script language="JavaScript" type="text/javascript">
<!--
var screenW = screen.width
var screenH = screen.height
document.write(screenW + "x" + screenH)
//-->
</script>
But I can't save that into my database!!
Has anyone solved this problem before?
Thanks
Jon Tag: display utf-8 Tag: 282298
http://www.aspfaq.com/show.asp?id=2424
Lo all,
Just reading through and saw this in the FAQ...
***********************
<some error>
/file.asp, line 1294
This seems to be *way* too many lines of ASP code to (a) manage and (b)
expect to run efficiently. I've worked on some pretty big ASP applications
and I don't recall ever having an ASP script more than 250 lines long.
***********************
I must confess that I dont think I've ever written anything thats as short
as that - unless it was a real basic attempt at testing something - most of
my pages have both html and asp in - therefore increasing the number of
lines (typically forms that post back to themselves etc) - some of these
forms might have lots of validation going on - therefore several IF-THENS -
and perhaps within these there might be forms that post back with an error
message to the same page etc...
For myself it is *very* common place to have pages in excess of 1000 lines,
one application I've written recently has a main page which then based on
user selection might include 1 of 4 or 5 .asp's into it- thus again
generating a mammoth total page...
I just wondered what the norm was...I understand the above quote from the
FAQ - but I'm not convinced it would always be prudent to "Consider
optimizing the code and perhaps spreading the work over multiple pages" -
unless these were 'included' instead of being redirect to etc....
Please dont see this as a criticism or anything - I just stumbled across it,
and like most ASP FAQ's found it an interesting read and wondered what other
developers did...
Cheers all, oh and happy new year :o)
Rob Tag: display utf-8 Tag: 282296
asp calendar component
Hi...
I am writing an ASP site for a small residential center, and need to be able
to make bookings. Can anyone recommend an ASP component that will provide a
good calendar interface so that a user can see which dates are available and
select free dates to make a booking.
Alternatively, is there another way of doing it?
Thanks Hugh Tag: display utf-8 Tag: 282292
General methog for passing error information...
I am looking for a way to pass error information back from a COM+ object
that is "better" than incliding a byref argument in every single function...
The session object would be ideal, except for the fact that, well, it is the
session object and my lovewly idea would be broken if the user's browser
doesn't support cookies... But the idea would work like so:
'Stateless COM+ object:
public function DoSomethingReallyImportant(byval arg1 as long, byval arg2 as
long) as long
on error goto Panic
DoSomethingReallyImportant = arg1 / arg2
GetObjectContect.SetComplete
exit function
Panic:
GetObjectContext.SetAbort
if err.number = 11 'Divide by zero
Session("MyObject.ErrorMessage") = "Dufus! You can't divide by
zero... yet. The next generation Intel will be able to!"
else
GenerateBSOD()
end if
end function
The nice thing about this is that the error is available to the caller
if/when needed. I can't store it in a local variable in the component, as
the state info is lost at the setcomplete/setabort.
The only thing coming to mind is to include an "optional strError as
string" in EVERY SINGLE FUNCTION, which would be aggravating. I do not want
to use return values for dual purposes, either -- the only time I do that is
when returning a variant that should contain a value, but I use Null to
indicate an error. This let's me know there was an error, but not anything
else...
Any suggestions??
Kurt Tag: display utf-8 Tag: 282285
how to display UTF-8 mail content by using CDONTS component??
"ELF" <ELF@EVIL.COM> wrote in message
news:ehbSlM20DHA.1364@TK2MSFTNGP10.phx.gbl...
> how to display UTF-8 mail content by using CDONTS component??
>
> I have try to add the following code
>
>