FileSystemObject CreateTextFile falling over
I am trying to execute the following function which performs four tests to
make sure the current environment is capable of uploading files. Test 1
completes ok, but test 2 results in the page hanging indefinitely. An error
number is not returned (it just hangs on the line: Set testFile =
fso.CreateTextFile(fileName, true) ). However when I execute test 2 using
VBScript from within an Excel macro it creates the text file without any
problem.
I have given IUSR & IWAM Administrator rights but this has not helped.
Does anyone please have any ideas?
Many Thanks
Iain
function TestEnvironment()
Dim fso, fileName, testFile, streamTest
TestEnvironment = ""
'Test 1
Set fso = Server.CreateObject("Scripting.FileSystemObject")
if not fso.FolderExists(uploadsDirVar) then
TestEnvironment = "<B>Folder " & uploadsDirVar & " does not
exist.</B><br>The value of your uploadsDirVar is incorrect. Open
AdminFileUpload.asp in an editor and change the value of uploadsDirVar to
the pathname of a directory with write permissions."
exit function
end if
'Test 2
fileName = uploadsDirVar & "\test.txt"
on error resume next
Set testFile = fso.CreateTextFile(fileName, true)
If Err.Number<>0 then
TestEnvironment = "<B>Folder " & uploadsDirVar & " does not have
write permissions.</B><br>The value of your uploadsDirVar is incorrect. Open
AdminFileUpload.asp in an editor and change the value of uploadsDirVar to
the pathname of a directory with write permissions."
exit function
end if
Err.Clear
testFile.Close
'Test 3
fso.DeleteFile(fileName)
If Err.Number<>0 then
TestEnvironment = "<B>Folder " & uploadsDirVar & " does not have
delete permissions</B>, although it does have write permissions.<br>Change
the permissions for IUSR_<I>computername</I> on this folder."
exit function
end if
Err.Clear
'Test 4
Set streamTest = Server.CreateObject("ADODB.Stream")
If Err.Number<>0 then
TestEnvironment = "<B>The ADODB object <I>Stream</I> is not
available in your server.</B><br>Check the Requirements page for information
about upgrading your ADODB libraries."
exit function
end if
Set streamTest = Nothing
end function Tag: shell.application Tag: 325210
Strip Query String from url
Below is a script I use to strip everything from a url except the actual
page. So for example, "http://www.cnn.com/mypage.asp?article=5&id=20"
becomes "mypage.asp".
I'm looking for a script that will strip any querystring from a url if it
exists, so my result would be "http://www.cnn.com/mypage.asp".
Can someone help me modify my script below to achieve this result? I'm
horrible with string functions.
CODE to Get URL **************
Right(Request.ServerVariables("SCRIPT_NAME"),Len(Request.ServerVariables("SCRIPT_NAME"))-InStrRev(Request.ServerVariables("SCRIPT_NAME"),"/")) Tag: shell.application Tag: 325206
cookies
can't figure why my page won't redirect.
When I call 10_6.asp it should call 10_5.asp
heres the code...
Thank You
Kevin
10_6.asp
<%@ Language=VBscript %>
<% Option Explicit %>
<%
Response.Cookies("UserInformation")("LastVisit")= Now
Response.Cookies("UserInformation")("Name") = "Scott"
Response.Cookies("UserInformation")("UserAgentString") =_
Request.ServerVariables("HTTP_USER_AGENT")
response.redirect "10_5.asp"
%>
10_5.asp
<%@ Language=VBscript %>
<% Option Explicit %>
<%
Dim strCookieName, strKeyName
'NOTE: why don't I have an assignment statement for strCookieName?
For Each strCookieName in Request.Cookies
If Request.Cookies(strCookieName).HasKeys then
for each strKeyName in Request.Cookies(strCookieName)
Response.Write strCookieName & "(" &
strKeyName & ") = " &_
Request.Cookies(strCookieName)(strKeyName) & "<br>"
next
else
Response.write strCookieName & " = " &_
Request.Cookies(strCookieName)
end if
response.write "<br>"
next
%> Tag: shell.application Tag: 325198
Paging MySQL Database records......again
This is a multi-part message in MIME format.
------=_NextPart_000_0062_01C6CE35.FF84A730
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
i post a while back on how to page thru database records. i dont really =
understand the ASPFAQ one. Its not well commented. This is how i learn =
anything, is if its commented on what does what.
Can someone please help me. i have a datbase of about 90 records so far, =
that i would like to page thru.
Thank you.
James Jones
------=_NextPart_000_0062_01C6CE35.FF84A730
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2963" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>i post a while back on how to page thru =
database=20
records. i dont really understand the ASPFAQ one. Its not well =
commented. This=20
is how i learn anything, is if its commented on what does =
what.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Can someone please help me. i =
have a datbase=20
of about 90 records so far, that i would like to page thru.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Thank you.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>James Jones</FONT></DIV>
<DIV> </DIV></BODY></HTML>
------=_NextPart_000_0062_01C6CE35.FF84A730-- Tag: shell.application Tag: 325184
urgent
i need help ....how can i send a e-mail to the person who has fillied my
apply.html form ... i have a email (textbox field) ..i mean automatic email
reply ...
thanks friends those who give me that code or guide me .... Tag: shell.application Tag: 325183
out of bounds on array
working through this tutorial and I just can't seem to find why I am over
running my array. If you have time can you drop this into your debugger?
I don't have one for asp pages. Using a text editor and my print statements
don't seem to be revealing the error.
Microsoft VBScript runtime error '800a0009'
Subscript out of range: '[number: 43]'
/Bp_1.asp, line 80
<%@ Language=VBscript %>
<% Option Explicit %>
<html>
<body>
<%
'_____________________________________________
' Display a calendar based upon the current date
'-------------------------------------------------
Function getMonthName(iMonth)
Select Case iMonth
case 1:
GetMonthName = "January"
case 2:
GetMonthName = "February"
case 3:
GetMonthName = "March"
case 4:
GetMonthName = "April"
case 5:
GetMonthName = "May"
case 6:
GetMonthName = "June"
case 7:
GetMonthName = "July"
case 8:
GetMonthName = "August"
case 9:
GetMonthName = "September"
case 10:
GetMonthName = "October"
case 11:
getMonthName = "November"
case 12:
getMonthName = "December"
case else
getMonthName = "in valid month"
end select
end function
Dim dbCurrentDate
dbCurrentDate = Date()
Dim aCalendarDays(42)
Dim iFirstWeekday
iFirstWeekDay =
DatePart("w",DateSerial(Year(dbCurrentDate),Month(dbCurrentDate),1))
Dim iDaysInMonth
iDaysInMonth =
DatePart("d",DateSerial(Year(dbCurrentDate),Month(dbCurrentDate)+1, 1-1))
dim iLoop
For iLoop = 1 to iDaysInMonth
aCalendarDays(iLoop + iFirstWeekday - 1) = iLoop
next
Dim iColumns, iRows
iColumns = 7
iRows = 6 - Int((42 - (iFirstWeekDay + iDaysInMonth)) / 7)
%>
<table align=center border=1 cellspacing=1 width=75% height=75%
<th colspan=7>
<%
Response.Write GetMonthName(Month(dbCurrentDate))
Response.Write ", " & Year(dbCurrentDate)
%>
</th>
<%
Dim iRowsLoop, iColumnsLoop
For iRowsLoop = 1 to iColumns
'create a new row
response.write "<tr>"
for iColumnsLoop = 1 to iColumns
'create a column
if aCalendarDays((iRowsLoop-1)*7 + iColumnsLoop) > 0 then
'dispaly the date
Response.Write "<td valign=top align=right width=""14%"">"_
& aCalendarDays((iRowsLoop-1)*7 + iColumnsLoop)_
& "</td>"
else
'gray out cell
response.write "<td bgcolor=gray> </td>"
end if
next
'close the row
response.write "</tr>"
next
%>
</table>
<br><br>
hello again
</body>
</html> Tag: shell.application Tag: 325181
Session Lost when opening Word Doc
Hello All,
I have an app on an intranet which uses the response.contenttype in
ASP to create a word doc. The issue I am having is that when this doc
is generated and opened, the session is lost. We have tried everything
up to this point, setting timeout in IIS, refresh scripts, etc, until
we realized it has something to to do with the Word document.
I have spent a LOT of time trying to figure this out, or find an
answer online. I have come across a few other posts, but no one
repsonded to them. I am desperate for help! Tag: shell.application Tag: 325173
Email Challenge...
OK, here is what I am attempting.
I have an .asp page on our company intranet in which the user can key some
referral information. Upon submit, the data is transferred to an SQL
database and the user receives a confirmation of this submission. One of the
fields that the employee selects is the sales rep to receive the referral.
I would like to be able to send the rep an email with the information
entered by the employee so they can contact the client. I am using Frontpage
2002 and I am aware that this process is not available within Frontpage but I
believe it can be coded manually but I can't seem to find a good resource to
assist me in this process. Our web-server is running Windows Server 2003.
I believe this can be accomplished and I hope to get some direction. Any
help would be appreciated.
Thanks. Tag: shell.application Tag: 325167
Request.Form(var) empty with IE, works fine with Firefox. Help please.
Hi,
I've been trawling the web for answer to my problem with no luck
although I'm hardly alone it seems!
Below is the generated source for an ASP page that posts a value called
'album' to another ASP page. The other page retrieves the value with
Request.Form('album'); On Firefox this works fine every time. On IE6, I
always get nothing. I'm pretty sure it's the posting side that is at
fault, so that's what I've shown here. Oh, I tried Request.QueryString
too and again, fine on Firefox, nothing on IE6.
Any help would be much appreciated.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<meta http-equiv="Content-Language" content="en-us">
<title>Gallery</title>
<!--mstheme-->
<link rel="stylesheet" type="text/css"
href="_themes/poetic2/poet1011.css">
<meta name="Microsoft Theme" content="poetic2 1011, default">
</head>
<body>
<form name='albumselect' action="gallery_intro.asp" method="post"
target="intro">
<CENTER><h2>ALBUMS</h2></CENTER><hr><br>
<CENTER><input name='album' type=image src='photogallery/Test
One/Title.jpg' value='photogallery/Test One'
onClick='submit();'></CENTER>
<CENTER>Test One Photos</CENTER><br><hr><br>
<CENTER><input name='album' type=image src='photogallery/Test
Two/Title.jpg' value='photogallery/Test Two'
onClick='submit();'></CENTER>
<CENTER>Test Two Photos</CENTER><br><hr><br>
<CENTER><input name='album' type=image src='photogallery/Test
Three/Title.jpg' value='photogallery/Test Three'
onClick='submit();'></CENTER>
<CENTER>Test Three Photos</CENTER><br><hr><br>
</form>
</body>
</html>
Regards,
Dave Tag: shell.application Tag: 325161
Problems Using onchange with option lists
I am trying to take actions using onchange with an option list without
success.
I am not able to fully populate the list without a bad bad behavior
(the list is not getting populated)
What I am looking for, is being able to call a sub procedure each time
a new item in the list is selected (of course after it has been
populated)
Below some of the code:
<%Sub Refresh
co_pais_envio_chk=co_pais_envio
window.location.href="checkout_direccion.asp"
End Sub%>
<%rs_pais.MoveFirst%>
<select name="cbo_pais_env" class="form1" id="cbo_pais_env"
onchange=<%call refresh%>">
<option value="0" size="25">Seleccione</option>
<%Do While Not rs_pais.EOF%>
<%if cint(rs_pais("id_pais")) > 1000 then%>
<option size="25" <%If CInt(co_pais_envio) =
CInt(rs_pais("id_pais")) Then %> selected <%End If%>
value="<%=rs_pais("id_pais") & "-" & rs_pais("co_zona_dhl_ve") & "-" &
rs_pais("co_zona_mrw_ve")%>"><%=UCase(rs_pais("no_pais"))%></option>
<%end if
rs_pais.MoveNext
Loop
rs_pais.movefirst
Do While Not rs_pais.EOF%>
<%if cint(rs_pais("id_pais")) < 1000 then%>
<option <%If CInt(co_pais_envio) = CInt(rs_pais("id_pais")) Then
%> selected <%End If%> value="<%=rs_pais("id_pais") & "-" &
rs_pais("co_zona_fedex") & "-" &
rs_pais("co_zona_dhl_exp")%>"><%=UCase(rs_pais("no_pais"))%></option>
<%end if
rs_pais.MoveNext
Loop
rs_pais.Close
Set rs_pais = Nothing
%> Tag: shell.application Tag: 325159
Problems Using onchange with option lists
I am trying to take actions using onchange with an option list without
success.
I am not able to fully populate the list without a bad bad behavior
(the list is not getting populated)
What I am looking for, is being able to call a sub procedure each time
a new item in the list is selected (of course after it has been
populated)
Below some of the code:
<%Sub Refresh
co_pais_envio_chk=co_pais_envio
window.location.href="checkout_direccion.asp"
End Sub%>
<%rs_pais.MoveFirst%>
<select name="cbo_pais_env" class="form1" id="cbo_pais_env"
onchange=<%call refresh%>">
<option value="0" size="25">Seleccione</option>
<%Do While Not rs_pais.EOF%>
<%if cint(rs_pais("id_pais")) > 1000 then%>
<option size="25" <%If CInt(co_pais_envio) =
CInt(rs_pais("id_pais")) Then %> selected <%End If%>
value="<%=rs_pais("id_pais") & "-" & rs_pais("co_zona_dhl_ve") & "-" &
rs_pais("co_zona_mrw_ve")%>"><%=UCase(rs_pais("no_pais"))%></option>
<%end if
rs_pais.MoveNext
Loop
rs_pais.movefirst
Do While Not rs_pais.EOF%>
<%if cint(rs_pais("id_pais")) < 1000 then%>
<option <%If CInt(co_pais_envio) = CInt(rs_pais("id_pais")) Then
%> selected <%End If%> value="<%=rs_pais("id_pais") & "-" &
rs_pais("co_zona_fedex") & "-" &
rs_pais("co_zona_dhl_exp")%>"><%=UCase(rs_pais("no_pais"))%></option>
<%end if
rs_pais.MoveNext
Loop
rs_pais.Close
Set rs_pais = Nothing
%> Tag: shell.application Tag: 325158
Read Email (please help)
Dear Friends,
I see there are lots of messages on this topic, but I have not been
able to find a simple answer to the question:
Can I read mail (from an inbox) on an exchnage server with ASP?
If so, how?
I hear all this about CDO, CDOSYS, etc, but they all seem to be able to
only send mail. I just need to read mail from exchange server. Can
this be done?
-SJ Tag: shell.application Tag: 325151
CDOSYS email - create hyperlink in body?
Hello,
How can you create a hyperlink in the HTML body of CDOsys email? Line 7
is a link for yahoo.com, but the asp page does not work.
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject ="Test Page - File upload"
objMessage.Sender = "" & Request.Form("email1") & ""
objMessage.To ="jason@yahoo.com"
objMessage.HTMLBody = "Email: " & Request.Form("email1") & vbCrLf & _
"Confirmation #: " & Request.Form("ConfirmID") & vbCrLf & _
"<a href="http://yahoo.com.com/">yahoo</a>" & vbCrLf & _
"FileName: " & Request.Form("file1") & vbCrLf & _
"Name: " & Request.Form("Name") & vbCrLf
Thanks,
Jason Tag: shell.application Tag: 325145
Issues with ' and %27
I am having difficulty fixing a problem with one of my apps. I know that
using an apostrophe will error the SQL statement out, since it thinks that
the apostrophe is the end of the statement. My issue is that I have replace
code in my app that is *supposed* to replace the apostrophe with double
quotes. This has been working fine, no complaints until a user tried to
insert the word, does'nt (I know, it is spelled incorrectly, but ASP
shouldn't care). The form data shows the line to be,
StaffHowToSpendTimeWork=Name+does%27nt+like...
Now my replace code looks like this,
dim StaffHowtToSpendTimeWork
StaffHowToSpendTimeWork = Request.Form("StaffHowToSpendTimeWork")
StaffHowtToSpendTimeWork = replace(StaffHowToSpendTimeWork,"'","''")
Is there a difference between ' and %27? How can I fix this?
Thanks,
Drew Tag: shell.application Tag: 325137
looking for zip code to state autocomplete
I'm looking for a script that will auto complete the state field when
someone enters their zipcode.
I'm currently using http://javascript.internet.com/forms/zip-to-state.html
but its kind of out dated and often returns null. Does anyone know of a more
up-to-date version or one that is updated regularly? It doesn't have to be
free. Tag: shell.application Tag: 325135
ASP/OO4O Problem: Unexpect result from package
I'm working on my first Oracle DB, so bear with me...
I have a couple of validation routines which are both returning the same
result regardless of the inputs. One checks if a Serial No already exists,
the other checks if a Part No is valid.
Currently there are no Serial Nos in the system, so this check shouldnt
fail. And I get a response to indicate that the Part No is valid regardless
of whether it is or not.
I strongly suspect that I'm made the same mistake in each case, but since
I'm not getting any errors, I can't see where.
In both cases, the PL/SQL procedures return a value of 1, whereas if I run
the PL/SQL in SQL Developer with suitable values inserted I get the expected
results
>>>>>>>>>>>>>>>>>>>>>>>>
ASP Snippets:
>>>>>>>>>>>>>>>>>>>>>>>>
Function SerialExists (sSerialNo, sPartNo)
Dim iResult, bResult
With oDB
.Parameters.Add "sSerialNo", sSerialNo, ORAPARM_INPUT
.Parameters ("sSerialNo").ServerType = ORATYPE_VARCHAR2
.Parameters.Add "sPartNo", sPartNo, ORAPARM_INPUT
.Parameters ("sPartNo").ServerType = ORATYPE_VARCHAR2
.Parameters.Add "iResult", 0, ORAPARM_OUTPUT
.Parameters ("iResult").ServerType = ORATYPE_NUMBER
iResult = oDB.ExecuteSQL("Begin VALIDATION_PKG.SerialExists(:sSerialNo,
:sPartNo, :iResult); end;")
If iResult > 0 then bResult = true Else bResult = false
response.Write bResult & "<BR>"
SerialExists = bResult
.Parameters.Remove "sSerialNo"
.Parameters.Remove "sPartNo"
.Parameters.Remove "iResult"
End With
End Function
'check that SerialNo/PartNo not used
If SerialExists(sSerialNo, sPartNo) then iError = iError + 2
'check for valid partnos
If Not IsValidPartNo(sPartNo) then iError = iError + 4
>>>>>>>>>>>>>>>>>>>>>>
Package Specification:
>>>>>>>>>>>>>>>>>>>>>> Tag: shell.application Tag: 325130
Problems with sending an encoded url
Hello Gurus
thankyou for your help in advance :)......heres my problem
var vAppPath=3D(my file)
xmlHttp =3D new ActiveXObject("Microsoft.XMLHTTP");
xmlHttp.open("POST",vAppPath,false);
xmlHttp.setRequestHeader("Content-Type",
"application/x-www-form-urlencoded");
xmlHttp.send("text=3D" +
escape(document.getElementById("tledit").value));
were document.getElementById("tledit").value =3D asscc=E9cc=E8cc=C9cc
d'abonncc=E0cc cc=C0cc ccbocc=EEccte
now in my file.....i do try to read the text
text =3D request("text")
the text =3D asscccccccc d'abonncccc cccc ccboccccte
the french characters are stripped out. I think its the escape
functions thats doing this.
is there a way to over come this? Tag: shell.application Tag: 325123
cookie testing
I need to revisit cookie testing. On the home page and every product page I
write a cookie. I do this because some users enter by direct links to
product pages.
<%
Response.Cookies("cookietest") = ("49")
Response.Cookies("cookietest").Expires = Date + 2
%>
On the cart page I test for the cookie...
<%
If Request.Cookies("cookietest") <> "49" Then
Response.Redirect("err.asp?e=1")
End If
%>
I have a user that insists he has cookies enabled, yet he keeps getting
redirected to my error page which suggests he does not have cookies enabled.
What could cause this? Is the above too simple for all circumstances?
Is there more extensive code that I could setup on a hidden page where I can
send users to get read out on how they actually have their browsers setup?
i.e. Run a test on their browser and the results are emailed to me.
thanks! Tag: shell.application Tag: 325115
ASP Compiling?
I've got a website that is very fast. I just added a subroutine in the file global.asp
(global.asp is run each time any page is called). The subroutine determines the user's
country by comparing their IP address against a 6Meg Access database that converts IP to
country. It then sets a Session variable with the user's country.
After that, each time the subroutine is called it checks to see if that Session variable
is set. If it is, it exits the subroutine - without calling the Access database.
Regardless, I've noticed that my website is slightly slower than before.
Even though the Access database is only called once per session, does ASP compile
global.asp each time it is run, and is it slowing down because it is
compiling/establishing/whatever a connection to the Access database that it is not using
anyway?
(Hey, I know MS SQL is faster than Access! I'm trying to understand more about ASP,
that's all)
Thanks!
Vic Tag: shell.application Tag: 325114
I want to be able to send an email from a website into the inbox as an appointment to be accepted
I need/want to be able to send an email from a website
running IIS and CDONTS for mail (or ASPMAIL) that comes
into the inbox as an appointment to be accepted.
The company is not running Exchange internally or on the
website (which is hosted).
Here is the basic app:
A visitor schedules an appointment to speak to a rep from
the company. Their appointment data is kept in a SQL DB.
I have their name, email, appointment date/time, and some
simple notes.
Later, someone from the company goes online and assigns
the appointment to an internal staff person. Currently
they get an email with the appointment information and can
go online to view the SQL data. I would like the
appointment to show up in their outlook mailbox.
Any ideas. I posting this on the VBScript and
general .asp newsgroups as well.
Thanks,
Matt Tag: shell.application Tag: 325112
ASp Spreadsheet
Hi, i am having a problemn thinking on a solution to make a web application.
This is the scenario: I have to make an application that should catch some
user data on the screen and pass it to a database. Here is the problemn: the
data that the user will pass is huge. I am talking about some columns and 27
rows. 3 rows as caption rows and the other 24 to get the data. How can i do
that? I thought about making columns with textboxes (with ids like R1C1,
R2C2, R1C4...) in a dynamic table inside a form and submit it. But the boss
wants an excel spreadsheet look into it. I am relutant about using OWC
because first, i don't know if the users will have the office installed and
secondly because if they do have office installed, how can i know what
version of office is everybody using?
Does anybody have a sugestion about how can i do that?
How can i make a spreadsheet interactive look like?
How can i pass the data from the browser to the server?
thanks,
leokporto Tag: shell.application Tag: 325111
database search
I want to do a searching on database some tables' content, is asp have so
function or tool to do this?
thx Tag: shell.application Tag: 325107
Using Access Database on Different Location for .NET 2.0
Hi!
I am use to the include file on classic asp for maintaining MS Access
database location. On using Visual Web Developer Express, I can only use the
MS Access database if it is located on the same folder with the web app. Is
there a way that I can locate MS Access as my database but the location is
not located on the web application? Hope you might help.
Me Tag: shell.application Tag: 325105
search form property DocTitle
Hi,
I got the sample from MS website on the search form.
There is a property, DocTitle. It doesnt bring any data back to be
displayed.
Could someone help me and tell me what this is suppose to bring from
pdf/word files?
I thought it was the title in the word document for the document properties?
I have something there in the document but it
still doesnt display it. It seems to be always blank.
thanks,
Will Tag: shell.application Tag: 325094
External Server pull files from Internal Server
I have an application that needs to pull files from an internal server. This
is the setup. The web server is external facing, meaning exposed to the
internet. I then have a file server that sits inside our domain. I created a
COM object that can impersonate a user to retrieve files from that server.
However, I cannot get the application to pull files from the internal server.
I first tried a domain account that could reach both servers. This did not
work. I then had the network team create the same account on both machines.
This is not working either. I can impersonate the user (I am able to get the
user/users authenticated), but the script keeps coming back with and access
denied.
The application creates a wscript.shell object to zip files from the
internal server and place the actual zip on the external server. Here is an
example of the code:
<%
Set wShell = Server.CreateObject("WSCRIPT.SHELL")
strZip = "c:\progra~1\winzip\wzzip.exe -ee -ybc E:\\5200044298_1_mqh6Kw.zip
\\InternalServer\SharedDrive\1125010"
Set objLogon = Server.CreateObject("LoginAdmin.ImpersonateUser")
objLogon.Logon "localuseraccount", "password", "",2,0
Response.write objLogon.getToken & "<br>"
Response.Write objLogon.getResult & "<br>"
set proc = wShell.exec(strZip)
Response.Write "Return String = " & proc.StdOut.ReadAll & "<br>"
set wShell = nothing
objLogon.LogOff
Set objLogon = nothing
%>
The com object basically takes a username,password,domain(if blank defaults
to local box),Logon Type, and Logon Provider. I have tried several
combinations of long on type and provider, but nothing seems to work. I am
thinking that I am really only authentication to the local machine and not to
the internal server. Our network people say they have everything between
servers is setup correctly, but I am not sure. I can, using the
FileSystemObject, copy the files from the internal server to the Web Server,
but it is when I try to use the script shell that this does not work. Any
ideas are appreciated.
Daniel C. Di Vita Tag: shell.application Tag: 325092
delete session data for other users logged on
I have a website that requires users to login. We track them by using
sessions. We record the time and date that they login, their session
id, the last page they visited, etc in a database. As as admin, I
would like to be able to login and force a logout of other users logged
in. Is this possible? I have looked online but there doesn't seem to
be any information that addresses this. Tag: shell.application Tag: 325080
Error trying to send email
This is a multi-part message in MIME format.
------=_NextPart_000_00ED_01C6CB04.FB90B3F0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
error '80040211'=20
/register.asp, line 71=20
I receive this error when i attempt to send an email.
My code is as follows:
Dim ObjSendMail
Set ObjSendMail =3D CreateObject("CDO.Message")=20
ObjSendMail.Configuration.Fields.Item =
("http://schemas.microsoft.com/cdo/configuration/sendusing") =3D 2 'Send =
the message using the network (SMTP over the network).
ObjSendMail.Configuration.Fields.Item =
("http://schemas.microsoft.com/cdo/configuration/smtpserver") =3D =
"xxxxxxxx"
ObjSendMail.Configuration.Fields.Item =
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") =3D 25 =
ObjSendMail.Configuration.Fields.Item =
("http://schemas.microsoft.com/cdo/configuration/smtpusessl") =3D False =
'Use SSL for the connection (True or False)
ObjSendMail.Configuration.Fields.Item =
("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") =
=3D 60
' If your server requires outgoing authentication uncomment the lines =
bleow and use a valid email address and password.
ObjSendMail.Configuration.Fields.Item =
("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") =3D =
1 'basic (clear-text) authentication
ObjSendMail.Configuration.Fields.Item =
("http://schemas.microsoft.com/cdo/configuration/sendusername") =
=3D"xxxxxx@xxxxx.xxx"
ObjSendMail.Configuration.Fields.Item =
("http://schemas.microsoft.com/cdo/configuration/sendpassword") =
=3D"xxxxxxx"
ObjSendMail.Configuration.Fields.Update
ObjSendMail.To =3D register_email
ObjSendMail.Subject =3D "Confirm Your Account"
ObjSendMail.From =3D "From Us!"
message =3D "Thank you for signing up! Please click the link below to =
confirm your account. If the link does not work, then copy and paste the =
link into your browser's address bar.<br><br>"
message =3D message & "<a =
href=3D"http://www.mywebsite.com/register.asp?func=3Dconfirm&email=3D" & =
register_email & "confirmatoin_number=3D" & confirmation_number & =
""">Confirm Your Account</a><br><br>"
message =3D message & =
"http://www.mywebsite.com/register.asp?func=3Dconfirm&email=3D" & =
register_email & "confirmatoin_number=3D" & confirmation_number
ObjSendMail.HTMLBody =3D message
ObjSendMail.Send
Set ObjSendMail =3D Nothing=20
just to verify, the username and password ARE correct. i even changed =
the password on my mail server, and copied and pasted it here. (i have =
them "xxx"ed out for my own security)
the mail server is correct. i use all this same information in outlook =
express.
PLEASE HELP ME!!! This same script works for a friend of mine. i made =
him a script which does the same thing pretty much, but it sends for =
him.........
Thanks,
James Jones
------=_NextPart_000_00ED_01C6CB04.FB90B3F0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2963" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>error '80040211'</FONT>=20
<P><FONT face=3DArial size=3D2>/register.asp</FONT><FONT face=3DArial =
size=3D2>, line=20
71</FONT> </P>
<P><FONT face=3DArial size=3D2></FONT> </P>
<P><FONT face=3DArial size=3D2>I receive this error when i attempt to =
send an=20
email.</FONT></P>
<P><FONT face=3DArial size=3D2></FONT> </P>
<P><FONT face=3DArial size=3D2>My code is as follows:</FONT></P>
<P><FONT face=3DArial size=3D2></FONT> </P>
<P><FONT face=3DArial size=3D2></FONT> </P>
<P><FONT face=3DArial size=3D2></FONT> </P>
<P><FONT face=3DArial size=3D2>Dim ObjSendMail<BR>Set ObjSendMail =3D=20
CreateObject("CDO.Message") <BR>ObjSendMail.Configuration.Fields.Item =
("<A=20
href=3D"http://schemas.microsoft.com/cdo/configuration/sendusing">http://=
schemas.microsoft.com/cdo/configuration/sendusing</A>")=20
=3D 2 'Send the message using the network (SMTP over the=20
network).<BR>ObjSendMail.Configuration.Fields.Item ("<A=20
href=3D"http://schemas.microsoft.com/cdo/configuration/smtpserver">http:/=
/schemas.microsoft.com/cdo/configuration/smtpserver</A>")=20
=3D "xxxxxxxx"<BR>ObjSendMail.Configuration.Fields.Item ("<A=20
href=3D"http://schemas.microsoft.com/cdo/configuration/smtpserverport">ht=
tp://schemas.microsoft.com/cdo/configuration/smtpserverport</A>")=20
=3D 25 <BR>ObjSendMail.Configuration.Fields.Item ("<A=20
href=3D"http://schemas.microsoft.com/cdo/configuration/smtpusessl">http:/=
/schemas.microsoft.com/cdo/configuration/smtpusessl</A>")=20
=3D False 'Use SSL for the connection (True or=20
False)<BR>ObjSendMail.Configuration.Fields.Item ("<A=20
href=3D"http://schemas.microsoft.com/cdo/configuration/smtpconnectiontime=
out">http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout=
</A>")=20
=3D 60<BR>' If your server requires outgoing authentication uncomment =
the lines=20
bleow and use a valid email address and=20
password.<BR>ObjSendMail.Configuration.Fields.Item ("<A=20
href=3D"http://schemas.microsoft.com/cdo/configuration/smtpauthenticate">=
http://schemas.microsoft.com/cdo/configuration/smtpauthenticate</A>")=20
=3D 1 'basic (clear-text) =
authentication<BR>ObjSendMail.Configuration.Fields.Item=20
("<A=20
href=3D"http://schemas.microsoft.com/cdo/configuration/sendusername">http=
://schemas.microsoft.com/cdo/configuration/sendusername</A>")=20
=3D"<A=20
href=3D"mailto:xxxxxx@xxxxx/">xxxxxx@xxxxx</A>.xxx"<BR>ObjSendMail.Config=
uration.Fields.Item=20
("<A=20
href=3D"http://schemas.microsoft.com/cdo/configuration/sendpassword">http=
://schemas.microsoft.com/cdo/configuration/sendpassword</A>")=20
=3D"xxxxxxx"<BR>ObjSendMail.Configuration.Fields.Update<BR>ObjSendMail.To=
=3D=20
register_email<BR>ObjSendMail.Subject =3D "Confirm Your=20
Account"<BR>ObjSendMail.From =3D "From Us!"<BR>message =3D "Thank you =
for signing=20
up! Please click the link below to confirm your account. If the link =
does not=20
work, then copy and paste the link into your browser's address=20
bar.<br><br>"<BR>message =3D message & "<a href=3D"<A =
href=3D"http://www.mywebsite.com/register.asp?func=3Dconfirm&email">h=
ttp://www.mywebsite.com/register.asp?func=3Dconfirm&email=3D</A>"=20
& register_email & "confirmatoin_number=3D" & =
confirmation_number=20
& """>Confirm Your =
Account</a><br><br>"<BR>message =3D=20
message & "<A=20
href=3D"http://www.mywebsite.com/register.asp?func=3Dconfirm&email">h=
ttp://www.mywebsite.com/register.asp?func=3Dconfirm&email=3D</A>"=20
& register_email & "confirmatoin_number=3D" &=20
confirmation_number</FONT><FONT face=3DArial =
size=3D2><BR>ObjSendMail.HTMLBody =3D=20
message<BR>ObjSendMail.Send<BR>Set ObjSendMail =3D Nothing </FONT></P>
<P><FONT face=3DArial size=3D2></FONT> </P>
<P><FONT face=3DArial size=3D2>just to verify, the username and password =
ARE=20
correct. i even changed the password on my mail server, and copied and =
pasted it=20
here. (i have them "xxx"ed out for my own security)</FONT></P>
<P><FONT face=3DArial size=3D2>the mail server is correct. i use all =
this same=20
information in outlook express.</FONT></P>
<P><FONT face=3DArial size=3D2>PLEASE HELP ME!!! This same script works =
for a friend=20
of mine. i made him a script which does the same thing pretty much, but =
it sends=20
for him.........</FONT></P>
<P><FONT face=3DArial size=3D2></FONT> </P>
<P><FONT face=3DArial size=3D2>Thanks,</FONT></P>
<P><FONT face=3DArial size=3D2>James =
Jones</FONT></P></DIV></BODY></HTML>
------=_NextPart_000_00ED_01C6CB04.FB90B3F0-- Tag: shell.application Tag: 325077
Tracking changes
I have asked this here before, but am still trying to decide what's best,
and would appreciate the input of seasoned Asp developers.
It's an ASP-built Intranet app, so I can't show you the site, but I'll show
you screen shots if you think that will help. The app is to keep track of
issues called in to a Support help desk. These issues are called tickets.
Each ticket has one and only one row in this given table (let's call it
Ticket). Any additional info on a ticket will be entered into another table
(called History), so it's possible to have many rows in that table for each
one in the table I am focusing on.
The app in question uses SQL Server 2000 as its datasource.
The table contains info entered when a ticket was created, but I have
included a mechanism for users to go back and change info that was
originally entered. This leads me to my dillemma. The boss wants me to find
a way to keep up with changes to that original info. It seems logical to
keep this info in another table. Let's call this new table Audit.
I have explored using a trigger which would create a row in the Audit table
whenever an Update was used on the Ticket table. The problem with that is,
you have one row per changed field, and that could add up. Actually, it's
not a problem, just something to consider.
The alternative is to have ASP code which would, when any edits are made,
manually compare each new value in the form to each existing value, and
record those items which have changed. This seems like it would put a lot of
work on the web server. There are generally maybe 10 people using this app
at any given time, so that may or may not be important.
For the record, the Ticket table has about 40 fields. The PK is a single
field, and it's an Identity with type int. Most of the other fields are int,
as they contain FKs that point to values contained in statics tables. There
are a few tables of type varchar, and 3 fields which contain large amounts
of data, as they are description fields. Users type in up to 3000 characters
here, but it's typically a few hundred characters.
Besides keeping track of this stuff, I am going to have to consider that I
will have to display this stuff, as well.
I'd appreciate the input of those here who might have encountered such a
thing. Tag: shell.application Tag: 325071
Access denied while sending mail from ASP
I searched through this forum to find a answer to my problem but
couldn't find it in any of the forums, so I'll describe the problem and
the solution here.
I am using ASP on SBS 2003 with IIS 6.0 and Exchange 6.5.7226.0. I have
a page where the user can submit a form to send email. I followed
Microsoft's sample code to use either CDOSYS or CDOEX, but I kept
getting error 80070005, which is an access denied message. Here's my
simple sample code:
<%
function sendEmail(to, from, subject, body) {
var iMsg = Server.CreateObject("CDO.Message")
iMsg.To = to
iMsg.From = from
iMsg.Subject = subject
iMsg.TextBody = body
iMsg.Send()
}
%>
Here's what I did to fix the problem: From the IIS Manager, right-click
Default Web Site, choose Properties, then the Home Directory tab.
Change the Application pool from DefaultAppPool to
ExchangeApplicationPool.
No more error 80070005.
Hope this helps. Tag: shell.application Tag: 325070
throttling download in ASP
Hi,
I am downloading files using ASP using the the binarywrite as below.
objStream.LoadFromFile(strAbsFile)
'-- send the stream in the response
Response.BinaryWrite(objStream.Read)
I was wondering is there any way I can control or throttle the
download?. I want to make sure that the users are not taking up too
much bandwidth while downloading the file.
Thanks for your help and time
:) Tag: shell.application Tag: 325069
Dynamic drop down list
I hope this is the right group. I am very new to ASP so this is
probably a stupid question. I have some vbscript that query's AD and
populates a recordset. I know the recorset contains the information I
want by doing a Response.write. I am having problems dynamically
creating a drop down list from the data in the recordset. The drop down
is created but it is empty. Any help would be greatly appreciated. A
sample of the code:
<%
'On Error Resume Next
Set objRootDSE = GetObject("LDAP://RootDSE")
strDNSDomain = objRootDSE.Get("defaultNamingContext")
strOU = "OU=Generic Accounts,"
' Use ADO to search Active Directory.
Set objCommand = CreateObject("ADODB.Command")
Set objConnection = CreateObject("ADODB.Connection")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
objCommand.ActiveConnection = objConnection
strBase = "<LDAP://" & strOU &" " & strDNSDomain &">"
strFilter = "(&(objectCategory=person)(objectClass=user))"
strQuery = strBase & ";" & strFilter & ";cn;subtree"
objCommand.CommandText = strQuery
objCommand.Properties("Page Size") = 100
objCommand.Properties("Timeout") = 30
objCommand.Properties("Cache Results") = False
Set objRecordSet = objCommand.Execute
objRecordSet.MoveFirst
Do Until objRecordSet.EOF
sName = objRecordSet.Fields("cn").Value
'Response.Write(sName)
genericAccount = "<option value= & '"sName"' & >"
objRecordSet.MoveNext
Loop
%>
<html><head><title>Dynamic Drop-Down Menu Example</title></head>
<body>
<form method="POST" action="test3.asp">
<p><select size="1" name="GenericAccounts">
<%=genericAccount%>
</select></p>
</form>
</body>
</html> Tag: shell.application Tag: 325063
Binary Stream opens in same frame instead of new window
We have some doc mgt "lite" on our site. I basically have a window with
a button that opens the relevant document (Excel, PDF, etc.). The
button calls some javascript which basically performs a window open:
window.open('document.asp?item=' + intDoc,'_self', '');
I use '_self' so that the document.asp itself does not open a new
browser. the document.asp file basically retrieves the path and
displays the document via the ADODB Stream object:
select case vType
Case "DOC", "RTF"
Response.ContentType = "application/x-msword"
Case "PDF"
Response.ContentType = "application/pdf"
Case "XLS", "CSV"
Response.ContentType = "application/x-msexcel"
end select
set objStream = server.CreateObject("ADODB.Stream")
objStream.Open
objStream.Type = adTypeBinary
objStream.LoadFromFile strFile
Response.BinaryWrite objStream.Read
For me and most every user, when we click the button on the original
page, we first get the "File Download" pop-up and then - assuming you
click Open - the document opens in a new window: Adobe for PDFs, Excel
for excel docs, etc. For one user, documents are not opening in a new
window, but rather in the original frame where the document button is
located.
Does anyone know if this is a browser setting? something I can control
in my code? This particular user is using IE 6 and Excel 2003 and Adobe
Reader 6.0.
Thanks! Tag: shell.application Tag: 325060
UnauthorisedAccessException for thread
hi,
I am writing a new asp.net program. Here in, the user has to click on a
button on a web page, and a new excel sheet should open up.
I could do it successfully using Office 2k3 PIA's for the click event
handler for the button.
Then I decided to create a new thread and complete the process of creating
an excel sheet in the new thread itself.
But I am getting the following error.
An unhandled exception of type 'System.UnauthorizedAccessException' occurred
in Unknown Module.
Additional information: Access is denied
But, the code executes successfully when i remove the thread and directly
code it in the click event handler for the asp button.
What might be the problem?? How can I give access permission to the thread??
Should set some permission in the Internet Information Services Manager.
OS: Win2k3 server
IIS 6.0 version
thanks in advance. Tag: shell.application Tag: 325053
Urgent deliverable
I have two arrays as follows
array1=("45101010","45101010","45103020","45103020","45103020","45201020","45201020",
"45201020","45201020","45202010")
array2=("0.44","0.1","0.13","2.61","0.15","0.42","0.12","0.63","0.12","0.23")
The final output should be as follows
45---------------------------------------(4.95(3.43+1.52))
4510-----------------------------------(3.43(0.54+2.89))
451010-----------------------------(0.54(0.44+0.1))
45101010---------------------(0.44,0.1)
451030-----------------------------(2.89(0.13+2.61+0.15))
45103020---------------------(0.13,2.61,0.15)
4520-----------------------------------(1.52(1.29+0.23))
452010-----------------------------(1.29(0.42+0.12+0.63+0.12))
45201020---------------------(0.42,0.12,0.63,0.12)
452020-----------------------------(0.23)
45202010---------------------(0.23)
Immediate help is appreciated
Thanks & Regards
kalyan Tag: shell.application Tag: 325052
How to get meta data info
Hello everyone,
i was wondering if someone could explain me how to get some meta info
on a number of files, such as author and owner.
it is for a .asp web page wich indexes a list of files and shows info
about those files (name, type, date last modified, etc) so that who
accesses the page can sort those files by the detail they wish, and i
can't discover how to get the author and owner info about those files.
thanks in advance,
emberhxc Tag: shell.application Tag: 325051
memory leak in script??
Hey eb
can this be the reason for huge memory expansion ?
Doesn't this script free memory of the object it had created?
sub createCOMobject()
set obj1 = createObject("object1")
dim flag = 1
useObject flag,obj1
end sub
----------------------------------
sub useObject (flag, byRef obj1)
...
set obj1 = Nothing
end sub
Thanks for your attention
Rea Tag: shell.application Tag: 325049
Classic ASP & SQL2k - freelance projects available immediately!!!
Immediate positions available for qualified developers! These spots will
go fast. We are not head hunters but the actual company.
All work can be done remotely.
Sincerely,
Ed Burns
======================
Experienced programmers needed for web projects
Do you have an existing job and are looking for side work?
Are you a freelancer who needs some more work?
We have many different parts of a web-based software suite that need to
be developed. We will pay you for each part completed. This can lead
into a full-time position.
5 years experience with the following (all required):
- Classic ASP
- ASP.NET with VB.NET (C# will not be used in these projects)
- SQL Server 2000, including T-SQL
- JavaScript
- XML
- Must be able to jump in to an existing project
- Must have examples to show
- Must have ability to work both independently and as part of a team
- Can work at home or at our office in Maitland
Interviews will be conducted August 28 ? September 1 for work starting
the following week. Please send your resume and portfolio to
info@intermedia4web.com.
======================
SQL Server 2000 Database Specialist
Do you have an existing job and are looking for side work?
Are you a freelancer who needs some more work?
5 years experience with the following (all required):
- Must be MCDBA certified
- Database optimization (such as indexing, fill factors, etc.)
- T-SQL, Stored Procedures, Functions
- DTS
- Replication
- Backup and recovery
- Log files
- Security
- OLAP and OLTP
- Must be able to jump in to an existing project
- Can work at home or at our office in Maitland
Interviews will be conducted August 28 ? September 1 for work starting
the following week. Please send your resume and portfolio to
info@intermedia4web.com.
*** Sent via Developersdex http://www.developersdex.com *** Tag: shell.application Tag: 325048
asp.net direct mailing
can i directly mail to hotmail or yahoo acount with any asp.net code.
i have an example like above but i need smtp adress for hotmail,
i tried it for smtp.mail.yahoo.com but it didnt work and "authentication
required" error accured
here is the code:
<%@ Page Language="VB" ContentType="text/html" debug="true"
ResponseEncoding="iso-8859-1" %>
<%@Import Namespace="System.Web.Mail" %>
<script language="VBScript" runat="server">
' compile and send the email message
sub SendEmail(sender as Object, e As EventArgs)
' This script is the property of D2 Computing, please do not redistribute it
' Check www.d2computing.co.uk for more scripts
' *************************************************
' IMPORTANT - CHANGE THE TWO VARIABLES BELOW TO YOUR OWN EMAIL ADDRESS AND
SMTP SERVER ADDRESS
' *************************************************
' CHANGE THE BELOW TO THE ADDRESS YOU WISH THE EMAIL TO BE SENT TO
dim sendmessageto as string = "a@hotmail.com"
' CHANGE THE BELOW TO YOUR SMTP SERVER ADDRESS, NORMALLY YOUR ISP'S SMTP
SERVER
dim smtpservername as string = "smtp.mail.hotmail.com"
dim HTMLmessage as string
HTMLmessage = "<html>"
HTMLmessage = HTMLmessage & "<head>"
HTMLmessage = HTMLmessage & "<meta http-equiv=""Content-Type"""
HTMLmessage = HTMLmessage & "content=""text/html; charset=iso-8859-1"">"
HTMLmessage = HTMLmessage & "<title>Mail from website contact</title>"
HTMLmessage = HTMLmessage & "</head>"
HTMLmessage = HTMLmessage & "<body bgcolor=""edefea"">"
HTMLmessage = HTMLmessage & "<font color=#000000 size=2 face=Verdana>"
HTMLmessage = HTMLmessage & "<b>Message sent from website contact
form:</b>"
HTMLmessage = HTMLmessage & "<p></p>"
HTMLmessage = HTMLmessage & "<b>Message from:</b> " & TxtUserName.Text
HTMLmessage = HTMLmessage & "<p></p>"
HTMLmessage = HTMLmessage & "<b>Users email:</b> " & TxtUserEmail.Text
HTMLmessage = HTMLmessage & "<p></p>"
HTMLmessage = HTMLmessage & "<b>Message text:</b> " & TxtComment.Text
HTMLmessage = HTMLmessage & "<p></p>"
HTMLmessage = HTMLmessage & "<b>Date/Time:</b> " & now()
HTMLmessage = HTMLmessage & "<p></p>"
HTMLmessage = HTMLmessage & "<b>Users IP address:</b> " &
Request.ServerVariables("REMOTE_ADDR")
HTMLmessage = HTMLmessage & "<p></p>"
HTMLmessage = HTMLmessage & "<b>****** END OF MESSAGE ******</b>"
HTMLmessage = HTMLmessage & "</font></body>"
HTMLmessage = HTMLmessage & "</html>"
Dim TheMessage as new Mailmessage
With TheMessage
.To = sendmessageto
.From = TxtUserEmail.Text
.Body = HTMLmessage
.Subject = "Message from D2 Computing web contact form"
.BodyFormat = MailFormat.Html
End With
SmtpMail.SmtpServer = smtpservername
Smtpmail.Send(TheMessage)
TxtComment.Enabled = "False"
TxtUserName.Enabled = "False"
TxtUserEmail.Enabled = "False"
TxtComment.Text = "***** Message Sent OK ***** Please follow the link below
to return to the main page"
TxtUserName.Text = "***** Message Sent OK *****"
TxtUserEmail.Text = "***** Message Sent OK *****"
BtnSendMail.Enabled = "False"
BtnSendMail.Text = "Message Sent !"
LblMailSent.visible = "True"
TheMessage = Nothing
end sub
</script>
<html>
<head>
<title>Contact us</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="dotnetcontact.css" rel="stylesheet" type="text/css">
</head>
<body>
<form name="fmcontact" runat="server">
<p align="center"><img src="images/anonco.gif" width="371" height="74"></p>
<table width="550" border="0" align="center" cellpadding="2" cellspacing="2">
<tr>
<td width="186">Your Name:</td>
<td width="350"><asp:textbox AutoPostBack="false" ID="TxtUserName"
runat="server" TextMode="SingleLine" Width="250"/>
<asp:RequiredFieldValidator ID="ValUsername" runat="server"
ErrorMessage="Please supply your name."
ControlToValidate="TxtUserName" Text="*
Required"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>Your Email Address:</td>
<td><asp:textbox AutoPostBack="false" ID="TxtUserEmail"
runat="server" TextMode="SingleLine" Width="250"/>
<asp:RequiredFieldValidator ID="ValUserEmail" runat="server"
ErrorMessage="Please supply your email address."
ControlToValidate="TxtUserEmail" Text="*
Required"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="ValValidEmail" runat="server"
ValidationExpression="^[\w\-\.']+@[a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]+)*?\.[a-zA-Z]{2,4}$"
ErrorMessage="The email address must be a valid internet email address."
ControlToValidate="TxtUserEmail" Text="*
Valid?"></asp:RegularExpressionValidator>
</td>
</tr>
<tr>
<td>Question/Comment:</td>
<td><asp:textbox AutoPostBack="false" ID="TxtComment" Rows="9"
runat="server" TextMode="MultiLine" Width="250" />
<asp:RequiredFieldValidator ID="ValUserComment" runat="server"
ErrorMessage="Please supply a question/comment."
ControlToValidate="TxtComment" Text="*
Required"></asp:RequiredFieldValidator></td>
</tr>
<tr>
<td> </td>
<td><asp:ValidationSummary
ID="valSum"
DisplayMode="BulletList"
runat="server"
HeaderText="Please check the following:"
Font-Name="verdana"
Font-Size="8"/>
</td>
</tr>
<tr>
<td colspan="2"><div align="center">
<asp:button ID="BtnSendMail" runat="server" Text="Send
Message" OnClick="SendEmail" />
</div></td>
</tr>
<tr>
<td colspan="2"><p align="center"><asp:label ID="LblMailSent"
runat="server" class="maillabel" Visible="False" Text="Your message was sent
sucessfully, click <a href=index.asp>here</a> to
return to the main page" /></p></td>
</tr>
</table>
<div align="center"></div>
</form>
</body>
</html> Tag: shell.application Tag: 325046
how to get the absolute path from within an asp page?
Hello,
Fairly new to ASP, but if I'm programming in the file
<web root>\myapp\mypage.asp
How would I print out "\myapp\" without hard-coding the value of
"\myapp\"?
Thanks, - Dave Tag: shell.application Tag: 325044
Losing Sessions when Redirecting to a subdirectory
Hello,
I am having some session problems wih an in-house (classic) asp application.
My developers have not been able to figure it out. I am more of a systems
admin type and much of this is over my head. But I will try to explain the
best I can and tell you what I know so far.
First a little summary of environment. I am running iis6 in a web farm with
hardware NLB and 5 servers. Each server is identical. Each server uses a
hosts file so when there is a reference to an internal url it refers back to
itself instead of going to LB. Session timeouts are set for 20min, Parent
Paths are enabled. No special ntfs stuff going on. Using anon iis user
The application is in a subdirectory of the default web site, the "sending"
asp page is in the root of this subdirectory and has a redirect to the
"receiving" asp page in a subdirectory of the apps starting directory. The
application and session variables work on 4 of the 5 servers
Now here are some things I have done and observed
Checked all settings, iis, permissions, app pools, turned off recycling,
etc. I copied all relevant files (the app is not that simple, lots of
includes, sql queries, etc) from server to server and still no luck. .
I could not find rhyme or reason for what is going on so I created a simple
app where one asp page passes a couple session variables to another residing
in same directories as problem apps. Again, we have failure on the problem
server and success on other servers. (But I do have success when both pages
are in same directory)
The only info I have found that looks like this is "application scope."
However all discussions I have read refer to global.asa. I am not using
global.asa.
Where else can I look? What else can I do?
Thanks,
Dean Tag: shell.application Tag: 325043
getting the results from executing an exe
Is there any sample about getting the results from executing an exe using
asp?
Thanks for answering. Tag: shell.application Tag: 325038
Save a web page
I would like to save a web page to a file. When I do that, sometimes
the saved web page does not look like the original web page.
For example, when I save www.msn.com, it looks very different the
original page.
How can I save the web page to look like the original (as if I do
"File" - "Save As" and under "Save as Type" select "Web Page, complete
(*.htm,*.html)" ? Thank you.
This is how I save the web page:
Set fs = CreateObject("Scripting.FileSystemObject")
Set filePtr = fs.CreateTextFile("c:\abc.htm", True)
filePtr.WriteLine (WebBrowser1.Document.body.innerHTML) Tag: shell.application Tag: 325028
Save a web page - hyperlinks question
I would like to save a web page to a file and have the hyperlinks work
when I bring the file back up. If the web page has a hyperlink like the
following
<a href="OurWeb/News/abcFile.htm">, after saving the file and showing
it on the screen, and you try to click on the link, it will try to go
to C:\OurWeb\News\abcFile.htm instead of
www.MyWebSite.com/OurWeb/News/abcFile.htm.
If I am on the website www.MyWebSite.com, and do "File" - "Save As" and
under "Save as Type" select "Web Page, complete (*.htm,*.html)", it
will save the hyperlink as www.MyWebSite.com/OurWeb/News/abcFile.htm.
How can I programmatically do "File" - "Save As" and under "Save as
Type" select "Web Page, complete (*.htm,*.html)" ? Thank you.
This is how I save the web page:
WebBrowser1.ExecWB OLECMDID_SAVEAS, OLECMDEXECOPT_DONTPROMPTUSER,
"c:\abc.htm", null
OR
Set fs = CreateObject("Scripting.FileSystemObject")
Set filePtr = fs.CreateTextFile("c:\abc.htm", True)
filePtr.WriteLine (WebBrowser1.Document.body.innerHTML) Tag: shell.application Tag: 325026
Problems passing session variable - HLP WILL BE APPRECIATTED
Hello Agn,
1=2E-
Being at the a.asp I refresh the page and session variables using a
JavaScript function:
{
simbolo =3D window.document.frmdir.simbolo.value;
window.location.href=3D"checkout_gastos.asp?refresh=3D1&bono=3D"+bono+"&s=
imbolo=3D"+simbolo;
}
2=2E- Then I pass the values without problem to b.asp via frmdir.submit()
3=2E-
At b.asp when I refresh the page, based upon a variable change then the
simbolo=B4s variable shows at the navegation bar a value of:
&simbolo=3D=80%20%20%20%20%20%20%20%20%20
at the second refresh the simbolo=B4s variable shows at the navegation
bar a value of:
&simbolo=3D?%20%20%20%20%20%20%20%20%20
So the refresh routine substitutes Euro value for ? value and add a lot
of %20 characters that I think that could be removed with simbolo =3D
unescape(simbolo.substring(0,2));
but the problem of the Euro character still=B4s.
************************** PROCEDURE MECHANISM
b=2Easp***************************
First time page it=B4s loaded the simbolo value is taken from the info
sended by a.asp using:
<%simbolo =3D request.form("simbolo")%>
At refresh time (via onclick) the simbolo value is taken via
<%simbolo=3D(request("simbolo"))%> then the new value is stored using
<%session("simbolo")=3D simbolo%>
At the Refresh function I declare:
var simbolo=3D""
simbolo =3D window.document.frmdir.simbolo.value;
And then the page is reloaded:
window.location.href=3D"checkout_pago.asp?refresh=3D1&simbolo=3D"+simbolo+"=
&de_moneda=3D"+de_moneda;
alert ("value"+simbolo);
That alert still shows the correct value of simbol but when the program
reloads it=B4s value changes (step 3)
PD: At the form simbolo is declared as hidden
<form name=3D"frmdir" method=3D"POST" action=3D"checkout_pedido.asp">
<input type=3D"hidden" name=3D"simbolo" value=3D"<%=3Dsimbolo%>">
Help will be appreciatted. Tag: shell.application Tag: 325024
IE How to disable Navigation Bar
Hi,
I would like to disable the navigation bar in IE to force my web users
to use the application=B4s navigation buttons.
Ideas welcome,
Thanks... Tag: shell.application Tag: 325022
HELP - connectivity with asp and SQL Server
I have a problem with internal websites written in ASP that connect to
SQL Server.
Occassionally while trying to access these sites, the following error
is generated:
Microsoft OLE DB Provider for SQL Server error '80004005'
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or
access denied.
/Mvp/admin_login.asp, line 0
I've looked on MS site and the solutions seem to be for problems that
are consistant. Sometimes the sites can be accessed other times they
cannot. Does anyone have any ideas what could be causing the server to
time out? Tag: shell.application Tag: 325021
ASP variable in HTML frame target?
This is simpler than I am making it... all I want to do is build a url
for an html frame source from a string constant and a variable.
I want to
Response.Write "<Frame source=""bla.bla.asp?query=& aspVariable"" ...
etc>"
I can get it to open the bla.bla.com in the frame but the number and
sequence of quotes seem to be messing up the tail end of it
it is annoying becasue it is simple and I am close to it just seem to
be kicking it away when I almost get it to work...
ty Tag: shell.application Tag: 325017
Hello everyone,
i have a little question:
Does shell.application aplly/work with virtual directories or paths?