trying to send 8 bit chars under IIS6
Greets,
Part of the content of one of our web pages uses wingdings and Chr(239)
through Chr(242) (which are little arrow outlines, though that's not really
important.)
It worked just fine in Windows 2000 Server, but now under Server 2003 it
seems that characters above 127 get converted somehow, and our code no
longer produces the desired effect.
Does anyone know how to make it send our content without modification, or
how to encode it in a way that it makes it out to the browser with the
intended character value (as opposed to some thoroughly useless conversion
to a 7 bit value)?
tia,
Mark Tag: How to get asp execution time and database connection time ? Tag: 312921
Strip Time from Datetime
I have a field with datetime values like below LISTING 1. Can someone help
me write code strip the time part so only values like "7/15/2005" will be
left.
Note - We must be able to strip dates with double digit months and days, so
i can't just use the right function with a hard coded parameter.
LISTING 1
mydatetimevalue = "7/15/2005 8:00:00 AM" Tag: How to get asp execution time and database connection time ? Tag: 312915
how to use the select name to show in the internal workgroup/domai
Hello everyone,
I had a program on my web server, that is http://computer1/Test/test1.aspx,
actually computer1 is the web server name, because this is a internal program
inside the domain/workgroup, I would like to know, in order to be easy to
access this link, I would like to just type in http://internalweb1 so that is
link can actually display the page for http://computer1/Test/test1.aspx , is
that a good way to do this issue? Is that any setting in the code we can do
that? By the way, the code for test1.aspx is C#..
Thanks.
Yezanxiong Tag: How to get asp execution time and database connection time ? Tag: 312913
post errors oh my!
I am creating an asp page to collect username/password from the user
and validate it against the DB.
Problem is, it's like this:
- Page initially shows user and pwd inputs with a submit button
- Page submits to itself using POST method
- Now armed with user and password, using ADO I verify information
against database and if it's correct, the main page shows.
Two problems:
1) is the password information secure when I use 'post'? can someone
somehow steal this with sniffers or something?
2) If there is a problem in the page, like connection or otherwise,
the browser shows a 'The page cannot be displayed' and down the page it
shows 'POST Data: ' which includes username and password! this can't be
good can it?
What can I do to improve security here? Tag: How to get asp execution time and database connection time ? Tag: 312901
zip and tel function
Bellow are two functions that I use to validate my zipcode and telephone
number:
function isInt(input)
on error resume next
Dim Temp
Temp = Clng(input)
isInt = (err=0 and inStr(input,".") = 0)
on error goto 0
end function
function isPhone(input)
Set re = new RegExp
re.Pattern = "[\s\-\(\)\+]"
re.Global = true
isPhone = (isInt(re.replace(input,"")))
end function
function isZip(input)
Set re = new RegExp
re.Pattern = "[\s\-]"
re.Global = true
isZip = (isInt(re.replace(input,"")))
end function
Are these functions considered to be feasible for validation?.
Your help is kindly appreciated.
Regards
Eugene Anthony
*** Sent via Developersdex http://www.developersdex.com *** Tag: How to get asp execution time and database connection time ? Tag: 312898
COM object in a service usable from ASP but not ASP.Net
Weird goings on over here, I have a COM object DCServerAdmin, that I
can break in when I attach the debugger to the service that creates the
object and I call a method on that object from an ASP page.
Now, if the method on the DCServerAdmin COM object is called from an
ASP.Net (C# DLL) page, it never breaks in the service's process BUT the
ASP.Net code doesn't report any exceptions. I don't have immediate
access to the C# code so I can do any tests on it just yet, but it
looks totally normal. I know there are process differences between ASP
and ASP.Net (ASP shares its process with other ASP pages, ASP.Net code
runs in its own, et cetera...)
TIA,
WTH Tag: How to get asp execution time and database connection time ? Tag: 312897
type mismatch and session variables
I am having a problem with a page that creates a treeview from a database,
by reloading itself on each request for a new folder to be explored.
The problem revolves around using an array to store the data, that is
copied to a session variable, and reloaded from that with each new view.
That is, on first opening the page, the array is created and populated,
then copied over; subsequent reloads of the page load the session variable,
rather than create the array. This is where the problem lies - by DIMing
the array, the first load of the page is fine, but a type mismatch pops up
when the session is pulled in to the array name; not DIMing the array, the
first load fails due to not declaring the array.
Currently the ony way I have round the problem is to switch option explicit
off and not DIM any variable. If there was a way to have the session
variable and array co-exist to start with, that would be good.
TIA Tag: How to get asp execution time and database connection time ? Tag: 312889
How to download large (400MB +) files from an asp.net page???
Hi,
I am trying to find a working solution for download of large files (400-800
MB)...
But this seems almost impossible to find a working example.
I have tried Response.Transmitfile, this works for some peopleâ?¦but in my
case the server reset the connection after approx. 20 minutes and sometimes
after
7-8 minutesâ?¦the download speed is however very good 400MB takes about 10
minutes to download.
I have also tried the code below, this solution also resets the connection
after 4-5 MBâ?¦and the download goes very slow approx. 55 kb/sâ?¦
Please does anyone have any ideas or proposals?
Is it possible to download via FTP?
Is it possible to use resume of broken downloads somehow?
Are there any components on the market that can achieve this?
'Download the selected file
Response.Buffer = False
Server.ScriptTimeout = 100
Dim FullPath As String = Server.MapPath(currentPath + StrFileName)
Dim DownloadFileInfo As New FileInfo(FullPath)
Dim Name = DownloadFileInfo.Name
Dim Ext = DownloadFileInfo.Extension
Dim stream = New System.IO.FileStream(FullPath, System.IO.FileMode.Open,
System.IO.FileAccess.Read, System.IO.FileShare.Read)
Dim StrFileType As String = ""
If Not IsDBNull(Ext) Then
Ext = LCase(Ext)
End If
Select Case Ext
Case ".exe"
'Exe file
StrFileType = "application/octet-stream"
Case ".zip"
'Zip file
StrFileType = "application/x-zip-compressed"
Case ".pdf"
'Pdf file
StrFileType = "application/pdf"
Case ".doc"
'MS Word
StrFileType = "Application/msword"
Case ".dll"
'Dll file
StrFileType = "application/x-msdownload"
Case ".html", ".htm"
'Html file
StrFileType = "text/HTML"
Case ".txt"
'Txt file
StrFileType = "text/plain"
Case ".jpeg", ".jpg"
'Jpg picture
StrFileType = "image/JPEG"
Case Else
StrFileType = "application/octet-stream"
End Select
'Clear the headers
Response.ClearHeaders()
Response.ClearContent()
Response.Clear()
'Add the download headers
Response.ContentType = "application/octet-stream"
Response.AddHeader("Content-Disposition", "attachment; filename=" + Name)
If StrFileType <> "" Then
Response.ContentType = StrFileType
End If
Response.AddHeader("Content-Length", DownloadFileInfo.Length)
Dim buffer(10000) As Byte
Dim length As Long
'Total bytes to read:
Dim bytesToRead As Long = stream.Length
Dim UserHasDownload As Boolean = False
Try
'Read the bytes from the stream in small portions.
While (bytesToRead > 0)
'Make sure the client is still connected.
If (Response.IsClientConnected) Then
'Read the data into the buffer and write into the output stream.
length = Int(stream.Read(buffer, 0, 10000))
Response.OutputStream.Write(buffer, 0, length)
Response.Flush()
'We have already read some bytes.. need to read only the remaining.
bytesToRead = bytesToRead - length
UserHasDownload = True
Else
'Get out of the loop, if user is not connected anymore..
bytesToRead = -1
UserHasDownload = False
End If
End While
Catch
'An error occurred..
Finally
End Try
stream.Close() Tag: How to get asp execution time and database connection time ? Tag: 312877
ASP.NET 2 apps and Win XP 64
I have a dual boot machine, runs Win XP pro and Win XP Pro 64, XP boots from
C and XP 64 boots from D.
They both have VS 2005 Beta 2 installed.
I have a webapp developed in Win XP (32) which has gone well and runs fine
in XP.
I Now want to get this same app running under IIS on XP 64.
I have had some issues as it is unclear exactly how to do this, but I played
around with Publish option in VS 2005 IDE and got the app copied or whatever,
to the Default Web Site, the app is invisible in the Admin Tools.
I can open and build the project in VS 2005 in XP 64, this is OK.
But
I cannot debug it (it says debugging not enabled or something)
I cannot start it in IE, when I tried I got this
The current identity (NT AUTHORITY\NETWORK SERVICE) does not have write
access to 'D:\WINDOWS\Microsoft.NET\Framework64\v2.0.50215\Temporary ASP.NET
Files'.
Now I dont want to go changing the access rights to this dir, this seems the
wrong way to go.
Now I may have had a bogus URL when I got the above message, I cant tell
which is actually correct because noen of my attempts work.
Also unlike in XP 32, the IIS folder has a new node (with a small yellow
gear wheel) for various "application" modules or assemblies (cant recall the
exact term).
So any guidance is much appreciatred.
If it is easier, I can redo the whole thing, the ASP web app is in a fodler
on my Drive C (the solution folder created when running Win32).
So if it ieasier to start again, then please explain the steps, do I
manually create a virtual dir? do I run the "Publish" option in the IDE or do
si do something else?
What I want is to be able to work on the project source from either the Win
32 or the Win 64 boot, with each OS having its own IIS so I can access the
site whichever OS I have booted.
Many tahnks
Hugh Tag: How to get asp execution time and database connection time ? Tag: 312870
Check Each Character of a String?
Hello,
What is the best way to check each character within a string?
For doing something like encryption, where you check character 1 and replace
it with a different character.. then check character 2 and replace it with a
different character.... etc.... until completing the string?
thanks.... Tag: How to get asp execution time and database connection time ? Tag: 312865
Server Permission Settings
Hello,
I'm not sure if I'm in the right area. I have asp pages that call a
database and sometimes updates it. The pages are under the root the database
is in a db folder under the root. My server guy isn't too sure what the
permissions should be on the server to these folders (root & db). Can you
give me some general instructions for this? Or point me in the right
direction for the answer?
Thanks Tag: How to get asp execution time and database connection time ? Tag: 312856
intellisense stopped working on COM objects
I was using intellisense for several registered com objects on my box
when one day out of the blue they stop working.. i still get
intellisense on some com and microsoft standard objects but others just
quit working.
I have tried unregistering and reregistering the objects but no dice. Tag: How to get asp execution time and database connection time ? Tag: 312854
Selected
Hi,
Why do not working selected?
Thx
<% myarray = array("2000", "2001", "2002", "2003", "2004", "2005", "2006",
"2007")
year = DatePart("YYYY", Date)
Response.Write "<select name=""year"" class=""form"">"
For i = 0 To 7
Response.Write "<option value='" & myarray(i) & "'"
' this lines
if myarray(i) = year then
Response.Write " selected"
End if
' this lines
Response.Write ">"
Response.Write myarray(i) & "</option>" & vbcrlf
Next
Response.Write "</select>" & vbcrlf
%> Tag: How to get asp execution time and database connection time ? Tag: 312821
isNumeric()
I have received the following feedback for the two functions bellow:
"The ISNUMERIC test is WORTHLESS for checking for an INT value, because
ISNUMERIC will happily accept DOUBLE values, such as 89.11998811777 and
other values that are simply *NOT* INT values."
<%
function isZip(input)
isZip = false
if len(input) = 5 then
isZip = (isNumeric(input))
end if
if len(input) = 10 then
z1 = left(input,5)
z2 = right(input,4)
z3 = mid(input,6,1)
isZip = (isNumeric(z1) and isNumeric(z2) and z3="-")
end if
end function
function isPhone(input)
Dim tempPh
tempPh = replace(input," ","")
tempPh = replace(input,"-","")
tempPh = replace(input,"-","")
tempPh = replace(input,"(","")
tempPh = replace(input,")","")
isPhone = (isNumeric(tempPh))
end function
%>
How do I solve the problem?.
Your help is kindly appreciated.
Regards
Eugene Anthony
*** Sent via Developersdex http://www.developersdex.com *** Tag: How to get asp execution time and database connection time ? Tag: 312818
How to close a IE page without any alart?
I use window object with close method to close a web page, this web page is
designed by active server page and VBscript. the code is as follows:
window.close()
however, an alart messege comes from IE. It's details: The Web page you are
viewing is trying to close the windows. Do you want to close this windows?
I want to directly close the window without any alart messege. In VBA, we
can add a declare Application.displayalart =false.
How to do this in html or VBA?
Thanks.
--
Developer
QA Dashboard
Microsoft China Development Centre Tag: How to get asp execution time and database connection time ? Tag: 312814
Cannot create web project
I am trying to create a web project in Visual InterDev.
I get the message: "Cannot create a disk-based web application in
C:\InetPub\wwwroot\Project1\Project1_local. You cannot configure
C:\InetPub\wwwroot\Project1\Project1_local as a frontpage web because the
dirctory C:\InetPub\wwwroot\Project1 above it is already configured as a
frontgae web. You can open that web instead."
Does anyone have any idea what is going on here? Tag: How to get asp execution time and database connection time ? Tag: 312812
asp and ms sql
This is a table created in ms sql:
create table customer
(
CustomerID int IDENTITY,
FirstName varchar(25),
LastName varchar(25),
CompanyName varchar(25),
Phone int,
Email varchar(20),
Password varchar(20),
Address varchar(30),
Zip int,
StateID varchar(30),
City varchar(30),
CountryID varchar(30),
CustomerTypeID varchar(30),
Session varchar(30),
IP varchar(30),
LastUpdate Smalldatetime
)
This is the stored procedure created in ms sql:
Create Procedure usp_InsertCustomer
@FirstName varchar(25),
@LastName varchar(25),
@CompanyName varchar(25),
@Phone int,
@Email varchar(20),
@Password varchar(20),
@Address varchar(30),
@Zip int,
@StateID varchar(30),
@City varchar(30),
@CountryID varchar(30),
@CustomerTypeID int,
@IP varchar(20)
AS SET NOCOUNT ON
Declare @sessionID AS UNIQUEIDENTIFIER
Declare @session AS varchar(255)
set @sessionID = NEWID()
set @session = convert(varchar(255),@SessionID)
INSERT INTO Customer
FirstName,LastName,CompanyName,Phone,Email,Password,Address,Zip,StateID,
City,CountryID,CustomerTypeID,Session,IP,LastUpdate
VALUES(@FirstName,@LastName,@CompanyName,@Phone,@Email,@Password,@Addres
s,@Zip,@StateID,@City,@CountryID,@CustomerTypeID,@session,@IP,GETDATE())
In my RegistrationExec.asp I have the following code:
<!--#include file="database_Function.asp"-->
<!--#include file="string_Function.asp"-->
<!--#include file="validateField_Function.asp"-->
<%
firstname = formatforDb(getUserInput(Request.Form("textfield1")))
lastname = formatforDb(getUserInput(Request.Form("textfield2")))
companyname = formatforDb(getUserInput(Request.Form("textfield3")))
phone = formatforDb(getUserInput(Request.Form("textfield4")))
email = formatforDb(getUserInput(Request.Form("textfield5")))
password = formatforDb(getUserInput(Request.Form("textfield6")))
address = formatforDb(getUserInput(Request.Form("textfield7")))
zip = formatforDb(getUserInput(Request.Form("textfield8")))
state = formatforDb(getUserInput(Request.Form("select1")))
otherstate = formatforDb(getUserInput(Request.Form("textfield9")))
city = formatforDb(getUserInput(Request.Form("textfield10")))
country = formatforDb(getUserInput(Request.Form("select2")))
if isLength(firstname) = false then
response.redirect "error_msg?msg=Please fill in the first name."
end if
if isLength(lastname) = false then
response.redirect "error_msg?msg=Please fill in the last name."
end if
if isLength(companyname) = false then
response.redirect "error_msg?msg=Please fill in the company name."
end if
if isLength(phone) = false then
response.redirect "error_msg?msg=Please fill in the phone number."
end if
if isLength(email) = false then
response.redirect "error_msg?msg=Please fill in the email address."
end if
if isLength(password) = false then
response.redirect "error_msg?msg=Please fill in the password."
end if
if isLength(address) = false then
response.redirect "error_msg?msg=Please fill in the address."
end if
if isLength(zip) = false then
response.redirect "error_msg?msg=Please fill in the zip code."
end if
if (isLength(state) = true AND isLength(otherstate) = true) OR
(isLength(state) = false AND isLength(otherstate) = false) then
response.redirect "error_msg?msg=Please fill in or select a state."
end if
if isLength(city) = false then
response.redirect "error_msg?msg=Please fill in the city."
end if
if isLength(country) = false then
response.redirect "error_msg?msg=Please select a country."
end if
if isEmail(email) = false then
response.redirect "error_msg?msg=You have entered an invalid email
address."
end if
if isZip(zip) = false then
response.redirect "error_msg?msg=You have entered an invalid zip code."
end if
if isPhone(phone) = false then
response.redirect "error_msg?msg=You have entered an invalid phone
number."
end if
Dim Temp
if isEmpty(state) then
Temp = otherstate
else
Temp = state
end if
mySQL = "EXECUTE usp_InsertCustomer @FirstName='" & firstname &
"',@LastName='" & lastname & "',@CompanyName='" & companyname &
"',@Phone='" & phone & "',@Email='" & email & "',@Password ='" &
password & "',@Address='" & address & "',@Zip='" & zip & "',@StateID='"
& "kl" & "',@City='" & city & "',@CountryID='" & country &
"',@CustomerTypeID=" & CInt(1) & ",@IP='" &
Request.ServerVariables("REMOTE_HOST") & "'"
call updateDB(mySQL, rs)
rs.close()
CloseDB()
%>
I am getting this error:
Error Type:
Microsoft OLE DB Provider for SQL Server (0x80040E57)
String or binary data would be truncated.
/Mix/database_Function.asp, line 15
How do I solve this problem?.
Your help is kindly appreciated.
Regards
Eugene Anthony
*** Sent via Developersdex http://www.developersdex.com *** Tag: How to get asp execution time and database connection time ? Tag: 312802
Various path/path/files.asp all #include this 1 file
Ok, I give up.
I need to #include the same 1 file (IncludeThis.asp) into 3 different asp
files.
1> C:\MyDir\ThisFile.asp
2> D:\MyDir\AASubSub\ThatFile.asp
3> E:\MyDir\CCSub\DDSubSub\AnotherFile.asp
On another server... those same 3 files... need to include
their own local copy of IncludeThis.asp
4> D:\EEDir\ThisFile.asp
5> E:\FFDir\GGSubSub\ThatFile.asp
6> F:\HHDir\IISub\JJSubSub\AnotherFile.asp
Is there a way I can make an #include statement that I can
put in the files... that will still find the IncludeFile.asp... regardless
of the different drives, different paths, different levels of dir nesting?
(Base filenames 1,2,3... are the same as 4,5,6, respectively.)
The include-file will always be called IncludeThis.asp
(Where should I put it?) Tag: How to get asp execution time and database connection time ? Tag: 312801
DLL!
I created a simple DLL in VB 6.0 & successfully registered it with the
following command at the Command Prompt:
regsvr32 c:\Inetpub\wwwroot\FetchRecords.dll
I am accessing the DLL in an ASP page with the following code:
<%
Dim strProduct
strProduct=Request.QueryString("product")
Dim objProduct
Set objProduct=Server.CreateObject("FETCH.RECORDS")
objProduct.setString(strProduct)
Response.Write("Price of " & strProduct & " is $")
Response.Write(objProduct.retrieveRecords())
Set objProduct=Nothing
%>
But the above code, when executed, throws a "Invalid ProgID" error.
Where am I going wrong? Please note that registering the DLL using
regsvr32 throws a
DllRegisterServer in c:\Inetpub\wwwroot\FetchRecords.dll succeeded.
message implying that the DLL has registered successfully. In order to
ensure that the component has really been installed in my system, I
executed the following script:
<%
If(IsObject(Server.CreateObject("FETCH.RECORDS"))) Then
Response.Write("Component Installed!")
Else
Response.Write("Component Not Installed!")
End If
%>
but strangely, the above script also generates the "Invalid ProgID"
error. Why so though the DLL has registered successfully (as the DOS
message suggests)?
Lastly, can DLLs be created using VS.NET 7.0 in the same way as they
can be created using VB 6.0?
Thanks,
Arpan Tag: How to get asp execution time and database connection time ? Tag: 312800
Creating 'vanity' domain names on the fly
Hi - Any help or pointer on this would be greatly appreciated. I'm
working on something similar to blogger.com. Users sign up and they get
their own webpage, with a domain name of 'username.blogger.com'.
Since blogger.com is doing it on the fly (as you sign up), I'm sure
they are doing it programmatically. Anyone has any clue on how they do
that?
Cheers,
Steve. Tag: How to get asp execution time and database connection time ? Tag: 312797
returning date with two digit year
I have a field that is stored in SQL Server in date/time format. On one
page, I only need the date to display. I am able to do this by saying:
DateValue(strLastModified)
However, this returns to me the date in this format:
05/10/2004
Instead, I would like to see:
05/10/04, but I am not sure how to do this. Tag: How to get asp execution time and database connection time ? Tag: 312776
DateTime in Paramtized asp query?
How does one paramtized a date in asp for a stored procedure that is
expecting DateTime?
if oRS.eof then
'// SAFE TO INSERT STORY....
CREATE Procedure spr_AddStory
oCmd.Parameters.append oCmd.CreateParameter("StoryTitle", adVarChar,
adParamInput,100,pStoryTitle)
oCmd.Parameters.append oCmd.CreateParameter("StoryDate datetime,
'//??????????????)
Thanks
Jason Tag: How to get asp execution time and database connection time ? Tag: 312767
Fine-tune/improve Parametized query in asp?
I am trying to improve the robustness and elegance of my parametized sql
statements in ASP 3.0 as they get passed to the sql server SP.
Could anyone tell me if there are weaknessess in the way I have written the
following code? I have included both the asp code and the sql stored
proceducre to tie things togoether....I appreciate any advice on this. It
basically is a application to manage static news stories on our site by
tracking and organising the meta data in a table.
Many thanks for you comments.
ASP PARAMERT QUERY
----------------------------
If oRS.eof then
'// SAFE TO INSERT STORY....
CREATE Procedure spr_AddStory
oCmd.Parameters.append oCmd.CreateParameter("StoryTitle", adVarChar,
adParamInput,100,pStoryTitle)
oCmd.Parameters.append oCmd.CreateParameter("StoryURL", adVarChar,
adParamInput,150,pStoryURL)
oCmd.Parameters.append oCmd.CreateParameter("StoryBlurb", adVarChar,
adParamInput,1200, PStoryURL)
oCmd.Parameters.append oCmd.CreateParameter("StoryBrokerID int", adInteger,
adParamInput,4,pStoryBrokerID)
oCmd.Parameters.append oCmd.CreateParameter("StoryCompanyID int", adInteger,
adParamInput,4,pStoryCompanyID)
oCmd.Parameters.append oCmd.CreateParameter("StoryCategoryID int",
adInteger, adParamInput,4,pStoryCategoryID)
oCmd.Parameters.append oCmd.CreateParameter("StoryDeptID int", adInteger,
adParamInput,4,pStoryDeptID)
oCmd.Parameters.append oCmd.CreateParameter("StoryKeyword1", adVarChar,
adParamInput,50,pStoryKeyword1)
oCmd.Parameters.append oCmd.CreateParameter("StoryKeyword2", adVarChar,
adParamInput,50,pStoryKeyword2)
oCmd.Parameters.append oCmd.CreateParameter("StoryKeyword3", adVarChar,
adParamInput,50,pStoryKeyword3)
oCmd.Parameters.append oCmd.CreateParameter("RelatedURL1", adVarChar,
adParamInput,150,pRelatedURUL1)
oCmd.Parameters.append oCmd.CreateParameter("RelatedURL2", adVarChar,
adParamInput,150,pRelatedURUL1)
oCmd.Parameters.append oCmd.CreateParameter("RelatedURL3", adVarChar,
adParamInput,150,pRelatedURUL1)
oCmd.Parameters.append oCmd.CreateParameter("StoryDate datetime,
oCmd.Parameters.append oCmd.CreateParameter("StoryImageURL", adVarChar,
adParamInput,150,pStoryImageURL)
oCmd.Parameters.append oCmd.CreateParameter("StoryBLN int", adInteger,
adParamInput,4,pStoryBLN)
set oReturn = oCmd.CreateParameter("u_id", adInteger, adParamOutput)
oCmd.Parameters.append oReturn
oCmd.execute()
'//RESULT...
if oReturn.value=-1 then
Response.write "FAILURE: Insert statement could not be carried out"
response.end
else
Response.write "SUCCESS: Insert statement was successfull"
End if
SQL SERVER STORED PROCEDURE
-------------------------------------------
CREATE Procedure spr_AddStory
@StoryTitle varchar(100),
@StoryURL varchar(150),
@StoryBlurb varchar(1200),
@StoryBrokerID int,
@StoryCompanyID int,
@StoryCategoryID int,
@StoryDeptID int,
@StoryKeyword1 varchar(50),
@StoryKeyword2 varchar(50),
@StoryKeyword3 varchar(50),
@RelatedURL1 varchar(150),
@RelatedURL2 varchar(150),
@RelatedURL3 varchar(150),
@StoryDate datetime,
@StoryImageURL varchar(150),
@StoryBLN int
AS
INSERT INTO Story (StoryTitle, StoryURL, StoryBlurb, StoryBrokerID
,
StoryCompanyID, StoryCategoryID, StoryDeptID, StoryKeyword1, StoryKeyword2,
StoryKeyword3, RelatedURL1, RelatedURL2, RelatedURL3, StoryDate,
StoryImageURL, StoryBLN)
VALUES
(@StoryTitle,@StoryURL,@StoryBlurb,@StoryBrokerID,@StoryCompanyID,@StoryCategoryID,@StoryDeptID,@StoryKeyword1,@StoryKeyword2,@StoryKeyword3,
@RelatedURL1,@RelatedURL2,@RelatedURL3,@StoryDate,@StoryImageURL,@StoryBLN)
GO Tag: How to get asp execution time and database connection time ? Tag: 312764
Downloading files of known mime type
I am attempting to write an ASP page that will download a file rather then
open it, when it is of known type. I found this code here:
http://mosley.arach.net.au/dev/docs/save%20as.htm
The first example works fine, for files under 5 Mb, the second example
downloads the file but the data is corrupted. Using a JGP file as a
reference, it seems to corrupt the end of the file (since the bottom of the
JPEG is corrupted).
Here is the code I am using. Any idea how to fix this? or an alternative
method?
Response.ContentType = "application/x-unknown"
Response.AddHeader "content-disposition","attachment; filename=" &
Request.QueryString("File")
Set adoStream = CreateObject("ADODB.Stream")
chunk = 2048
adoStream.Open()
adoStream.Type = 1
adoStream.LoadFromFile(Server.MapPath(vFilePath))
iSz = adoStream.Size
Response.AddHeader "Content-Length", iSz
For i = 1 To iSz \ chunk
If Not Response.IsClientConnected Then Exit For
Response.BinaryWrite adoStream.Read(chunk)
Next
If iSz Mod chunk > 0 Then
If Response.IsClientConnected Then
Response.BinaryWrite objStream.Read(iSz Mod chunk)
End If
End If
adoStream.Close
Set adoStream = Nothing
Response.End Tag: How to get asp execution time and database connection time ? Tag: 312762
Detecting a file upload
Hi all.
I have a form that also allows an image to be uploaded.
<input type="file" name="Upload">
How can I detect if a file has been uploaded, example
if [upload has been made] then
Do thing A
else
Do thing B
end if
Thanks for any pointers Tag: How to get asp execution time and database connection time ? Tag: 312761
connecting to localhost
Hi,
I have got a scenario where an asp script needs to request via xmlhttp a
file sitting on the same server. The code all works find on my local
machine. However, on the hosting server, it does not. The problem is
that I am on a shared server and the server can't "see itself", i.e.
it's probably blocked by the host to receive request from itself. The
problems comes in as the server will hold multiple sites and use host
headers to channel request. I thought of using "localhost" and some kind
of header sending scenario to get the server to go to the correct
subfolder/virtual host. However, googling has not brought up much. Has
anyone got ideas/similar scenarios and could point me in some helpful
directions?
Thanks
Christoph Tag: How to get asp execution time and database connection time ? Tag: 312760
Object doesn't support this property or method: 'Response.Redirect
I wanted to add this method to my .asp page in order to dynamically choose a
page based upon some selection criteria. It's in my .asp book and in the
online reference. Yet when I use this object, the following error returns
in the browser:
Error Type:
Microsoft VBScript runtime (0x800A01B6)
Object doesn't support this property or method: 'Response.Redirect'
/testwebs/choose.asp, line 22
What is missing from my IIS libraries in order to use have this method
supported?
Thanks for any info
/peter d. Tag: How to get asp execution time and database connection time ? Tag: 312750
why use htmlencode
Hi
I have a website where people can enter comments into a textarea - some of
these may have a bit of html - like links - or <blockquote>
the comments are stored in a Access2000 mdb file - A friend told me that i
have to use htmlencode on the textarea string before storing it in the
database. but it seems to work fine without doing this - is there any reason
as to why i should put it thru htmlencode?
when the comments are displayed they are written straight into a <div>
<div><%=recset.fields("comments")%></div>
thanks in advance
Diablo Tag: How to get asp execution time and database connection time ? Tag: 312743
error with aspnet_isapi.dll
Win2k server that recent;y had a virus (fixed by client so I don't know
which one it was) is filling the event log with this error:
7/6/2005,4:39:07 PM,Perflib,Error,None,1008,N/A,SERVER,"The Open Procedure
for service ""ASP.NET_1.1.4322"" in DLL
""C:\WINNT\Microsoft.NET\Framework\v1.1.4322\aspnet_isapi.dll"" failed.
Performance data for this service will not be available. Status code
returned is data DWORD 0. "
They didn't have SP4 installed so I had them install that but they tell me
that the logging continues. Perfmon isn't running so what else could cause
this error? I am going to TS into their machine tonight after closing so I
am looking for ideas. I searched the KB and didn't find anything this
specific. Perhaps reinstalling the framework will fix it?
thanks for any help. Tag: How to get asp execution time and database connection time ? Tag: 312731
How do I detect which button was clicked on "save/open/cancel" dialog?
When users clicked a unkown mime type link such as Zip on my website, a
"Save/Open/Cancel" dialog box pops up. Is there a way to detect which button
users clicked by using ASP? actually I only what to record the "valid"
click -- when Open/Save was clicked.
Thanks ahead.
Quinn Tag: How to get asp execution time and database connection time ? Tag: 312730
error with aspnet_isapi.dll
Win2k server had a virus, I don't know which one as the client removed it
themselves, but the event log is filling with this error:
7/6/2005,4:39:07 PM,
Perflib
Error
None1008,N/A,SERVER,"The Open Procedure for service ""ASP.NET_1.1.4322"" in
DLL ""C:\WINNT\Microsoft.NET\Framework\v1.1.4322\aspnet_isapi.dll"" failed.
Performance data for this service will not be available. Status code
returned is data DWORD 0. " Tag: How to get asp execution time and database connection time ? Tag: 312729
Having Web Page Refresh and go to end of page
I am trying to use the following to get a web page to auto refresh every 3
secs and go to the end of the web page. Refresh works but it will not jump
to the name anchor. Any help?
<HTML>
<HEAD>
<META http-equiv="REFRESH" content="3;'what.htm#TheEnd'">
</HEAD>
<BODY bgcolor="#ffffff" text="#000000">
<CENTER>
<TABLE width="600">
<TR>
<TD vAlign=top align=left>
Tons o content
</TD>
</TR>
</TABLE>
</CENTER>
<A name="TheEnd">You Are At The End</A>
</BODY>
</HTML> Tag: How to get asp execution time and database connection time ? Tag: 312724
How do I get ASP (SOAPtoolkit3) to query NTLM authenticated .NETWe
Hi there,
I am needing to query a .NET webservice from a classic ASP page. It works
absolutely fine under anonymous authentication however I want to turn NTLM
authentication on in order for me to ascertain the requesting user's context.
Detailed below is my code currently but it throws a very vague error when I
turn on NTLM authentication.
What is is that I am doing wrong and what do I need to do to get this
working...?
function callAuditService()
Dim oSOAP
Dim Result
Result = False
Set oSOAP = Server.CreateObject("MSSOAP.SoapClient30")
oSOAP.ClientProperty("ServerHTTPRequest") = True
oSOAP.mssoapinit(Application("AuditWebServicePath"))
oSOAP.ConnectorProperty("AuthUser") = Request.ServerVariables("AUTH_USER")
oSOAP.ConnectorProperty("ConnectTimeout") = 300000
Result = oSOAP.AuditSearch(ParametersInHere)
Set oSOAP = Nothing
callAuditService = Result
end function
Any help would be very muchly appreciated.
Thanks,
DC
--
</davidChristiansen> Tag: How to get asp execution time and database connection time ? Tag: 312713
Defending against SQL injection....
I have a multi-page ASP web application that uses information sent to it
from the client in the Request.Forms collection, the Request.QueryString
collection and the Request.Cookie collection.
What I want to do is to sanitise ALL the information sent to EVERY page.
I thought I'd achieve this by having an INCLUDE file inserted at the top of
EVERY page.
This include file iterates through EVERY form, querystring and cookie item
and removes anything that looks like malicious SQL injections from the
values. Having completed this task, the many web pages then access the
sanitised Request object with impunity.
One minor drawback is that it doesn't seem to work...I can't update the
Request object with the sanitised value. [Error message: VBScript runtime
error: Object doesn't suppor this property or method]
Either it's something silly in my coding or it's the wrong
approach....please advise accordingly (code below).
Thanks
Griff
---------------------------------------------------------------------------------------------
Dim asSQLInjectionWords ' Array to hold the injection keywords
Dim oRequestItemName ' Item in the request object (form, querystring and
cookies)
Dim vValue ' Item value
' Populate the array
populateArray asSQLInjectionWords
' Sanitise the request form objects
for each oRequestItemName in Request.Form
' Load the value
vValue = Request.Form(oRequestItemName)
' sanitise the request item value
Request.Form(oRequestItemName) = sanitiseItemValue(asSQLInjectionWords,
vValue)
next 'oRequestItem
' Sanitise the request query string objects
for each oRequestItemName in Request.QueryString
' Load the value
vValue = Request.QueryString(oRequestItemName)
' sanitise the request item value
Request.QueryString(oRequestItemName) =
sanitiseItemValue(asSQLInjectionWords, vValue)
next 'oRequestItem
' Sanitise the request cookie objects
for each oRequestItemName in Request.Cookies
' Load the value
vValue = Request.Cookies(oRequestItemName)
' sanitise the request item value
Request.Cookies(oRequestItemName) = sanitiseItemValue(asSQLInjectionWords,
vValue)
next 'oRequestItem
' Erase the array
erase asSQLInjectionWords
' -------------------------------------------------------------
private function sanitiseItemValue(byRef injectionArray, byVal vValue)
Dim iArrayCounter
Dim aRequestItem
' Iterate through the sql injection array
for iArrayCounter = 0 to ubound(injectionArray)
' Split the request item's value around the SQL injection term
aRequestItem = split(vValue, injectionArray(iArrayCounter))
' Rebuild the request item with out the SQL injection term
vValue = join(aRequestItem, vbNullString)
next
' Return sanitised value
sanitiseItemValue = vValue
end function
' -------------------------------------------------------------
private sub populateArray(byRef injectionArray)
injectionArray = Array(_
"/", _
"\", _
"'", _
"""", _
";", _
"=", _
"--", _
"*", _
".", _
"create", _
"dbcc", _
"dbo", _
"delete", _
"drop", _
"exec", _
"index", _
"insert", _
"from", _
"having", _
"inner", _
"join", _
"master", _
"model", _
"msdb", _
"null", _
"table", _
"tables", _
"tempdb", _
"truncate", _
"union", _
"update", _
"where", _
"xp_cmdshell", _
"xp_startmail", _
"xp_sendmail", _
"xp_makewebtask")
end sub
' ------------------------------------------------------------- Tag: How to get asp execution time and database connection time ? Tag: 312710
How to get/set and send the HTTP Headers(user-defined)
[Qtn : How to get/set and send the HTTP Headers(user-defined) coming from
another domain/site]
Hi Experts,
In one SMS gateway project i need a great and urgent help from u all. There,
the Service Providers sending the data thru "HTTP Headers" (For ex.
sms-Id,sms-source [user defined]).
So i need to get and parse the name value pairs, and need to respond/send
the same way as coining the "HTTP Headers" (For ex.
sms-Id,sms-destination,sms-msg [user defined]).
Pls its urgent.
thanx in advance
Laks.R Tag: How to get asp execution time and database connection time ? Tag: 312707
URLDecode for UTF8
Hello,
I have a URLDecode function which works fine for all characters except for
UTF8 characters.
If I server.URLEncode the string "å??", the resultant string is "%E5%95%86".
How do I convert it back to the original string?
Thank you. Tag: How to get asp execution time and database connection time ? Tag: 312706
Use session variables or store in database?
I'm new to ASP. If I store information in these handy "session
variables" am I going to run into many limitations that I wouldn't have
it I added a database record for each session instead? For example, if
I use session variables, can I have an admin utility that lets me see a
list and/or count of all open sessions? Or would I be able to keep the
same user from starting multiple sessions if I wanted (by comparing the
log-in name which my web-site requires)? I know if I create a record
for each open session that I can do all kinds of fun stuff like reports
and queries, but not sure if I'll have all of those options with these
built in ASP session variables (which I imagine ASP stores in memory or
some non-standard format).
p.s.-I'm using ASP (not ASP.NET) with VBScript (I hate VB syntax but
that is what everyone seems to use). Tag: How to get asp execution time and database connection time ? Tag: 312703
List of Databases
I am writing an Active Server Page application that will get all of the
databases that a user can access. Is there a way I can do this with Active
Server Pages? I also will provide the users with the option to change
records, table structure, etc with this application.
I will also be developing an asp.net (C#) project that will do the same
thing.
If anyone can provide code snippets or anything that would be great.
Thanks,
Rick Langschultz
Web Developer/IT Manager Tag: How to get asp execution time and database connection time ? Tag: 312701
number formatting
Hi
Im having a problem getting a number to display correctly. The number is
the result of a calculation and I am then using formatnumber to remove any
decimals.
The number displays as '1,345' is there any way to get rid of the comma
Thanks
J Tag: How to get asp execution time and database connection time ? Tag: 312695
info@service-now.com
Dear Mr. Lindsey,
This is Guojun Zhu, an intern in Capital Hunter. We are a research company
in San Diego, California, focused on the equity financing on venture
capital. I would apprecieate if you can send me the information about the
management such as CEO, CFO, etc.
Thanks for your attention and have a great day!
--
Guojun Zhu
gzhu@capitalhunter.com
Capital Hunter, Inc.
751 Seventh Avenue, Suite O
San Diego, CA 92101
619-236-9998
http://www.capitalhunter.com Tag: How to get asp execution time and database connection time ? Tag: 312693
Excel gridlines
Like many people here, I've been trying to generate a spreadsheet on an ASP
page. In my case, it's Intranet, so I can't provide you with a link. But the
problem I have been fighting is a simple one: The spreadsheet that is built
by my code has no gridlines. I cannot find anything in the documentation of
either MSDN (for ASP) or Excel that tells me how to code my page in such a
way that it looks like Excel normally looks when you bring it up.
In my HTML code, I have tried
<table border="1"
as well as just taking the border attribute out. I have seen this work in
other people's ASP code, but don't have access to their code. Any help
appreciated. Tag: How to get asp execution time and database connection time ? Tag: 312687
SQL Conversion Assistance Needed
Came across this code.
SELECT Y,
Q1 = COUNT(CASE WHEN Q=1 THEN Sales END),
Q2 = COUNT(CASE WHEN Q=2 THEN Sales END),
Q3 = COUNT(CASE WHEN Q=3 THEN Sales END),
Q4 = COUNT(CASE WHEN Q=4 THEN Sales END)
FROM
dbo.SalesByQuarter
GROUP BY Y
ORDER BY Y
It does a pivot table type deal.
How would I convert this to a one line SQL statement? Is this possible. Tag: How to get asp execution time and database connection time ? Tag: 312680
Flushing servers buffer
In the following code when i = 500 the buffer on the server is flushed
to the client. However, because the content that is sent to the browser
contains an html table Internet Explorer does not display the table
until it receives the closing </table> tag. The question is, am I
correct in saying that the buffer on the server is CLEARED when i =
500? It will be empty for a split second until the loop resumes again.
Am I correct?
Dim i
i = 1
Response.Write("<table>")
For i = 1 to 1000
Response.Write("<tr><td>" & i & "</td></tr>")
i = i + 1
If i = 500 Then
Response.Flush()
End If
Loop
Response.Write("</table>")
Is this a good way to clear the buffer if I'm processing a very large
amount of data? Tag: How to get asp execution time and database connection time ? Tag: 312677
Shopping Cart Advised
Hi All,
If I want to using asp paging to display product. I added 2 pcs in
page 1, and I added 3pcs in page 2, and I added 5pcs in page 4 and
then click add to cart button. How can I keep them before click "add
to cart" button ?
Please advised. Tag: How to get asp execution time and database connection time ? Tag: 312672
Prevent "Back" Buttom in Browser
I am trying to set up a login-logout website. I have a cookie about the
login status. I put it as logout once the logout link is clicked. And
I put a little security check about the status of the cookie variable
everytime before loading the detailed member profiling.
The page layout is like:
Login page,-->check the login name/password database-->profile page(only
login cookie is true, redirect back to login if false)
Logout link, set login cookie as false and redirect to the login page.
However, after I check a profile and then click logout, I can still get
back to profile page by click "back" button in browser. I was told
those are in the browser cache and the check of the "login" cookie does
not actually work in this situation.
Is there anyway to force the browser to clear the cache after I click
the "logout". It should be possible since lots of websites do that. I
just do not how to. Any help is highly appreciated! Tag: How to get asp execution time and database connection time ? Tag: 312666
Problems connecting to MS SQL via Access2000 adp
For the past several projects, I have been using an Access 2000 .adp file to
create and manage the database on the remote SQL Server. It has worked very
well for me and is a very fast, simple way to take care of minor updates.
A new project is not going so well, though. No matter what I try, I can not
get a connection established. This project is on a server I do not control,
so I am having to work only with the information provided to me by the
admin.
Using an online admin tool provided by the server administrator, I am able
to log in and view the database and make edits via manually written SQL
statements. However, using the server name provided and the same login info,
I am unable to establish a connection through Access.
The admin also told me to use a file-based DSN connection in my ASP pages; I
have always used DSN-less in the past, and can not figure out why a DSN
would be required. Could there be any connection between this and not being
able to connect via Access?
Any suggestions or ideas would be appreciated.
Thank you.
Paul Tag: How to get asp execution time and database connection time ? Tag: 312646
Random Session Timeout in IIS6
I have an asp application running on both iis5 and iis6. (not .net) The
server ruhnning IIS5 has no problem running my application. IIS6 randomly
times out WEB users. The session timeout is set for 60 minutes. I will
get timed out in iis6 in less than 5 minutes. Are there any other
settings that can be changed to stop this from happening Tag: How to get asp execution time and database connection time ? Tag: 312643
401.2 on ASP pages
Argh! I know this is a simple problem, but I just can't find the answer. I
have IIS running and can get it to display htm pages, but not ASP. I get
401.2, invalid config on server. I've run authdiag, but can't glean the
answer from its results.
All help appreciated!
Steve Tag: How to get asp execution time and database connection time ? Tag: 312640
How to convert XML or HTML to pdf file ?
Hi all,
How to convert XML or HTML to pdf file ?
Where can I find free pdf generator ? Tag: How to get asp execution time and database connection time ? Tag: 312635
need help to set up Natterchat 1.12
Hi everybody!
May be somebody has experience in installing Natterchat 1.12 on
[url]www.7host.com?[/url] I will appreciate any help and assistance
--
alan_ot
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------ Tag: How to get asp execution time and database connection time ? Tag: 312630
Hi all,
Any some tools or sample codes drop down asp script execute time and
database connection time ?
Thanks.
"Kelvin" <kelvinweb@gmail.com> wrote in message
news:db7965c.0507122318.13ed63ff@posting.google.com...
> Hi all,
>
> Any some tools or sample codes drop down asp script execute time and
> database connection time ?
> Thanks.