file rename Problem in asp upload
can anyone tell me how i can change the filename which is going to
uploaded
here is a code for uploading a file
<!-- #include file="clsUpload.asp" -->
Set objUpload = New clsUpload
If objUpload.Files.Count > 0 Then
objUpload.Files.Item(0).Save Server.MapPath("cupload\")
ResumeFileName=objUpload.Files.Item(0).FileName
End If
now here i wants to give my filename instead of the filename which is
selected by user like 54.txt instead of resume.doc bcz users can post
those file with same name i need to rename the files so plz tell me is
there any way i can upload the filename with the diffrent filename.
i am including the file <!-- #include file="clsUpload.asp" --> for
clsUpload component and here are the contents of the file...
<SCRIPT LANGUAGE=vbscript RUNAT=Server>
Class clsUpload
'========================================================='
' This class will parse the binary contents of the '
' request, and populate the Form and Files collections. '
'========================================================='
Private m_objFiles
Private m_objForm
Public Property Get Form()
Set Form = m_objForm
End Property
Public Property Get Files()
Set Files = m_objFiles
End Property
Private Sub Class_Initialize()
Set m_objFiles = New clsCollection
Set m_objForm = New clsCollection
ParseRequest
End Sub
Private Sub ParseRequest()
Dim lngTotalBytes, lngPosBeg, lngPosEnd, lngPosBoundary, lngPosTmp,
lngPosFileName
Dim strBRequest, strBBoundary, strBContent
Dim strName, strFileName, strContentType, strValue, strTemp
Dim objFile
'Grab the entire contents of the Request as a Byte string
lngTotalBytes = Request.TotalBytes
strBRequest = Request.BinaryRead(lngTotalBytes)
'Find the first Boundary
lngPosBeg = 1
lngPosEnd = InStrB(lngPosBeg, strBRequest, UStr2Bstr(Chr(13)))
If lngPosEnd > 0 Then
strBBoundary = MidB(strBRequest, lngPosBeg, lngPosEnd - lngPosBeg)
lngPosBoundary = InStrB(1, strBRequest, strBBoundary)
End If
If strBBoundary = "" Then
'The form must have been submitted *without*
ENCTYPE="multipart/form-data"
'But since we already called Request.BinaryRead, we can no longer
access
'the Request.Form collection, so we need to parse the request and
populate
'our own form collection.
lngPosBeg = 1
lngPosEnd = InStrB(lngPosBeg, strBRequest, UStr2BStr("&"))
Do While lngPosBeg < LenB(strBRequest)
'Parse the element and add it to the collection
strTemp = BStr2UStr(MidB(strBRequest, lngPosBeg, lngPosEnd -
lngPosBeg))
lngPosTmp = InStr(1, strTemp, "=")
strName = URLDecode(Left(strTemp, lngPosTmp - 1))
strValue = URLDecode(Right(strTemp, Len(strTemp) - lngPosTmp))
m_objForm.Add strName, strValue
'Find the next element
lngPosBeg = lngPosEnd + 1
lngPosEnd = InStrB(lngPosBeg, strBRequest, UStr2BStr("&"))
If lngPosEnd = 0 Then lngPosEnd = LenB(strBRequest) + 1
Loop
Else
'The form was submitted with ENCTYPE="multipart/form-data"
'Loop through all the boundaries, and parse them into either the
'Form or Files collections.
Do Until (lngPosBoundary = InStrB(strBRequest, strBBoundary &
UStr2Bstr("--")))
'Get the element name
lngPosTmp = InStrB(lngPosBoundary, strBRequest,
UStr2BStr("Content-Disposition"))
lngPosTmp = InStrB(lngPosTmp, strBRequest, UStr2BStr("name="))
lngPosBeg = lngPosTmp + 6
lngPosEnd = InStrB(lngPosBeg, strBRequest, UStr2BStr(Chr(34)))
strName = BStr2UStr(MidB(strBRequest, lngPosBeg, lngPosEnd -
lngPosBeg))
'Look for an element named 'filename'
lngPosFileName = InStrB(lngPosBoundary, strBRequest,
UStr2BStr("filename="))
'If found, we have a file, otherwise it is a normal form element
If lngPosFileName <> 0 And lngPosFileName < InStrB(lngPosEnd,
strBRequest, strBBoundary) Then 'It is a file
'Get the FileName
lngPosBeg = lngPosFileName + 10
lngPosEnd = InStrB(lngPosBeg, strBRequest, UStr2BStr(chr(34)))
strFileName = BStr2UStr(MidB(strBRequest, lngPosBeg, lngPosEnd -
lngPosBeg))
'Get the ContentType
lngPosTmp = InStrB(lngPosEnd, strBRequest,
UStr2BStr("Content-Type:"))
lngPosBeg = lngPosTmp + 14
lngPosEnd = InstrB(lngPosBeg, strBRequest, UStr2BStr(chr(13)))
strContentType = BStr2UStr(MidB(strBRequest, lngPosBeg, lngPosEnd
- lngPosBeg))
'Get the Content
lngPosBeg = lngPosEnd + 4
lngPosEnd = InStrB(lngPosBeg, strBRequest, strBBoundary) - 2
strBContent = MidB(strBRequest, lngPosBeg, lngPosEnd - lngPosBeg)
If strFileName <> "" And strBContent <> "" Then
'Create the File object, and add it to the Files collection
Set objFile = New clsFile
objFile.Name = strName
objFile.FileName = Right(strFileName, Len(strFileName) -
InStrRev(strFileName, "\"))
objFile.ContentType = strContentType
objFile.Blob = strBContent
m_objFiles.Add strName, objFile
End If
Else 'It is a form element
'Get the value of the form element
lngPosTmp = InStrB(lngPosTmp, strBRequest, UStr2BStr(chr(13)))
lngPosBeg = lngPosTmp + 4
lngPosEnd = InStrB(lngPosBeg, strBRequest, strBBoundary) - 2
strValue = BStr2UStr(MidB(strBRequest, lngPosBeg, lngPosEnd -
lngPosBeg))
'Add the element to the collection
m_objForm.Add strName, strValue
End If
'Move to Next Element
lngPosBoundary = InStrB(lngPosBoundary + LenB(strBBoundary),
strBRequest, strBBoundary)
Loop
End If
End Sub
Private Function BStr2UStr(BStr)
'Byte string to Unicode string conversion
Dim lngLoop
BStr2UStr = ""
For lngLoop = 1 to LenB(BStr)
BStr2UStr = BStr2UStr & Chr(AscB(MidB(BStr,lngLoop,1)))
Next
End Function
Private Function UStr2Bstr(UStr)
'Unicode string to Byte string conversion
Dim lngLoop
Dim strChar
UStr2Bstr = ""
For lngLoop = 1 to Len(UStr)
strChar = Mid(UStr, lngLoop, 1)
UStr2Bstr = UStr2Bstr & ChrB(AscB(strChar))
Next
End Function
Private Function URLDecode(Expression)
'Why doesn't ASP provide this functionality for us?
Dim strSource, strTemp, strResult
Dim lngPos
strSource = Replace(Expression, "+", " ")
For lngPos = 1 To Len(strSource)
strTemp = Mid(strSource, lngPos, 1)
If strTemp = "%" Then
If lngPos + 2 < Len(strSource) Then
strResult = strResult & Chr(CInt("&H" & Mid(strSource, lngPos + 1,
2)))
lngPos = lngPos + 2
End If
Else
strResult = strResult & strTemp
End If
Next
URLDecode = strResult
End Function
End Class
Class clsCollection
'========================================================='
' This class is a pseudo-collection. It is not a real '
' collection, because there is no way that I am aware '
' of to implement an enumerator to support the '
' For..Each syntax using VBScript classes. '
'========================================================='
Private m_objDicItems
Private Sub Class_Initialize()
Set m_objDicItems = Server.CreateObject("Scripting.Dictionary")
m_objDicItems.CompareMode = vbTextCompare
End Sub
Public Property Get Count()
Count = m_objDicItems.Count
End Property
Public Default Function Item(Index)
Dim arrItems
If IsNumeric(Index) Then
arrItems = m_objDicItems.Items
If IsObject(arrItems(Index)) Then
Set Item = arrItems(Index)
Else
Item = arrItems(Index)
End If
Else
If m_objDicItems.Exists(Index) Then
If IsObject(m_objDicItems.Item(Index)) Then
Set Item = m_objDicItems.Item(Index)
Else
Item = m_objDicItems.Item(Index)
End If
End If
End If
End Function
Public Function Key(Index)
Dim arrKeys
If IsNumeric(Index) Then
arrKeys = m_objDicItems.Keys
Key = arrKeys(Index)
End If
End Function
Public Sub Add(Name, Value)
If m_objDicItems.Exists(Name) Then
m_objDicItems.Item(Name) = Value
Else
m_objDicItems.Add Name, Value
End If
End Sub
End Class
Class clsFile
'========================================================='
' This class is used as a container for a file sent via '
' an http multipart/form-data post. '
'========================================================='
Private m_strName
Private m_strContentType
Private m_strFileName
Private m_Blob
Public Property Get Name() : Name = m_strName : End Property
Public Property Let Name(vIn) : m_strName = vIn : End Property
Public Property Get ContentType() : ContentType = m_strContentType :
End Property
Public Property Let ContentType(vIn) : m_strContentType = vIn : End
Property
Public Property Get FileName() : FileName = m_strFileName : End
Property
Public Property Let FileName(vIn) : m_strFileName = vIn : End Property
Public Property Get Blob() : Blob = m_Blob : End Property
Public Property Let Blob(vIn) : m_Blob = vIn : End Property
Public Sub Save(Path)
Dim objFSO, objFSOFile
Dim lngLoop
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objFSOFile = objFSO.CreateTextFile(objFSO.BuildPath(Path,
m_strFileName))
For lngLoop = 1 to LenB(m_Blob)
objFSOFile.Write Chr(AscB(MidB(m_Blob, lngLoop, 1)))
Next
objFSOFile.Close
End Sub
End Class
</SCRIPT> Tag: How to Use SQL OLAP in Web application Tag: 326676
Chinese Del key on web forms - problem
Hello
I'm currently having trouble with porting our classic ASP web app for
Chinese users - in any web form, the Del key on a chinese keyboard
clears all of the fields in the form, which is not ideal...
I'm at a complete loss so any help would be most appreciated :-)
Cheers
Phil Tag: How to Use SQL OLAP in Web application Tag: 326675
tracking sessions
Hi,
I have a section of my intranet that i track with a session. That is to make
sure that users have to login before they are able to use / view certain web
pages.
In my wwwroot directory i have two locations where these files are placed.
The main files are in admin the other is in news.
With these two folds they work fine. This is what i have on the web pages
<%
'If the session variable is False or does not exsist then redirect the user
to the unauthorised user page
If Session("blnIsUserGood") = False or IsNull(Session("blnIsUserGood")) =
True then
'Redirect to unathorised user page
Response.Redirect"unauthorised_user_page.htm"
End If
%>
However, i have another section of the intranet that is located in a
different logical drive. I have created a virtual site mapping to this
folder. I can access those webpages fine. HOwever when i add the code
<%
'If the session variable is False or does not exsist then redirect the user
to the unauthorised user page
If Session("blnIsUserGood") = False or IsNull(Session("blnIsUserGood")) =
True then
'Redirect to unathorised user page
Response.Redirect"unauthorised_user_page.htm"
End If
%>
and try to access it after logging in, the web page is unable to detect the
session.
Why is that?
Thanks Tag: How to Use SQL OLAP in Web application Tag: 326673
multiple forms in one asp page?
Hi everyone,
my colleagues are thinking about have three insurance plans on one asp page:
I simplify the plan as follow:
text box:number of people
plan1 plan2 plan3
dropdown menu1: dropdown menu2: dropdown menu3:
for people choose for people choose for people choose
different coverage different coverage different coverage
limit limit limit
... ... ...
text box11: price1 text box22: price2 text box33: price3
buy button1 buy button2 buy button3
What they want is: 1)if dropdown menu1 is changed then the price1 will be
automatically updated,
if data in menu2/menu3 is changed, then price2/price3 will be
automatically updated...
if number of people to be insured is changed, all three prices will be
update automatically
The only thing I can think of is using javascript, which I don't like use
that much as I just found
out a while ago that in Mac_PC OS 9 with IE installed on it, javascript
doesn't work at all(firebox with mac_pc OS9 is OK).
is there any better way to implement this client side dynamic function?
Is there any easy way to identify which buy button is clicked in the
following asp page, so I know which data set
I need to pass to the next asp page?
should I put the three plans in one form or multiple forms, I never
programed multiple forms in one asp
page. Any expert opinions or suggestions?
--
Betty Tag: How to Use SQL OLAP in Web application Tag: 326672
How to Write into a Cross-Subdomain Cookie
Hello and sorry for my english, I'm italian...
I manage a site with a normal address like: www.mysite.com
I'm using a cookie to store nicks of my users, with a code like this:
----
Response.Cookies("mycookie").Expires = #January 1, 2030#
Response.Cookies("mycookie").Path = ""
Response.Cookies("mycookie").Secure = FALSE
Response.Cookies("mycookie")("nick") = nick
----
and I'm deleting it, if a user wants so, with:
----
Response.Cookies("mycookie").Expires = #January 1, 2003#
Response.Cookies("mycookie").Path = ""
Response.Cookies("mycookie").Secure = FALSE
Response.Cookies("mycookie")("nick") = ""
Response.Cookies("mycookie") = ""
----
(I know, there's too much stuff in the delete procedure!)
Now I'm going to open some new sections of my site, with subdomain
adresses, like search.mysite.com, shop.mysite.com... and I need that
cookie authentication for the main (www) address is working also in
these subdomains.
I red on the Internet that with the DOMAIN property, I can set my
cookie to make it work for every subdomain, with something like:
----
Response.cookies("mycookie").domain = ".mysite.com"
----
... and it works!
My problem is when I try to DELETE it: after I set a cookie with
.domain property, it seems to become "read only": any my attempt to
delete (or modify) it seems to be ignored.
Results are the same when I try to write it from the subdomain that
created it (www), or when I try from the "chief" address (mysite.com,
without any subdomain).
Where's my mistake?
Thanks everybody in advance. Tag: How to Use SQL OLAP in Web application Tag: 326669
Classic ASP: Is there a way to add to the results of a posted form
Greetings:
We have a survey site where the responses are returned as new static ASP
pages. What we'd like to do is to have a section below the "Comments" that
the original respondent that is a "rebuttal" to the comment that we can fill
out and have it remain static--these pages are visible to our internal
public, but we don't want anyone to post in this "rebuttal" section except
for us. This is what it would look like:
Comments: Your service was poor.
Rebuttal: We strive to do our best on every event, and it is our
understanding that the equipment you were to supply arrived late. We hope
that you will consider working with us in the future despite this unfortunate
situation.
Is there a way to add such a section to a page?
Thanks,
--
Brian J. Matuschak
brian@electronic-atlas.com Tag: How to Use SQL OLAP in Web application Tag: 326668
IIS, ASP, wshell.run, command prompt, console width, height
Hi,
Is there anyone knows which user profile is using by IIS while running
an DOS application within asp with wshell.run command.
To describe my problem clear;
I'm using a DOS command and within ASP. My code is something like
this;
set wshell = server.createobject("wscript.shell")
commandline = "tclsh84.exe test1.tcl"
intReturn=wshell.run(commandline,0,true)
Everything is OK.. Script is running and the rest of the code is
written output to the screen...
The problem is, script generates 200-300 characters width outputs..
But since IIS runs it in a 80X24 window the output is converted to 80
character width lines...
If I manually use tclsh84.exe test1.tcl command within a DOS prompt, I
can easily adjust the window properties to set window size something
like 300X100 so I can see the output is not modified.. And if i save
this properties, future using of this command is not modified too...
Windows write this properties into registry
HKEY_Current_User\Console\HKEY_CURRENT_USER\Console\C:_tcl_bin_tclsh84.exe
Since this has been written to HKEY_Current_User, this change isn't
available for other users and the user which IIS is using...
I've tried
- Copying my profile to Default User and All Users profile.
- Logging to IIS/Windows server with IUSR_server, IWAM_server users and
make this window size changing,
but it doesnt work..
I hope i can describe my problem...
Anyone can show me what I'm doing wrong or missing??
Thanks in advance...
Ajdar..
--
maykil ceksin
------------------------------------------------------------------------
Posted via http://www.webservertalk.com
------------------------------------------------------------------------
View this thread: http://www.webservertalk.com/message1707351.html Tag: How to Use SQL OLAP in Web application Tag: 326667
IIS and WebDav problems
I am trying to setup IIS 6 to allow web developers to connect up to the
web root of a website via WebDav and work on site files including .asp
and .aspx files.
I have setup a website for this purpose in IIS. The home directory is
mapped to a local folder on the machine. Under the 'home directory' tab
all the permission boxes are checked ('script source access, read,
write, etc...). Execute permissions are set to 'scripts and
executables'. I've also removed .asp from the 'application extensions'
list accessed from the 'configuration' tab. Basic authentication is
turned on under 'directory security/authenticati on and access
control'. I do not have URLScan installed, so any filtering is by IIS
only.
This is all working as expected; I can mount the WebDav connection in
Windows Explorer and navigate, view and open/save files. I can also
access the website via a browser and browse directories/view browser
appropriate files, etc. The problem is that I cannot access any .asp
files at all. If I look in the logs for the website I get a entry for
the WebDav request (PROPFIND) with a 404 error. The file *is there* I
just can't access it. Other files (.html, .css., .jpg, etc.) work fine.
What can I enable/disable in IIS to make this work?? I have spent hours
on this already and about to give up. Tag: How to Use SQL OLAP in Web application Tag: 326656
Response.Write
Here is an easy one for the pros, yet hard for me (newbie).
If my recordset is empty I want to write "Not Complete" and if there is
a value, I want to write the value. Can someone tell me what I am
doing wrong?
<%
If IsEmpty(rsa.Fields.Item("reclaima")) Then
Response.Write("Not Complete")
Else
Response.Write(rsa.Fields.Item("reclaima"))
End If
%>
Also tried....
<%
If rsa.Fields.Item("reclaima") = "" Then
Response.Write("Not Complete")
Else
Response.Write(rsa.Fields.Item("reclaima"))
End If
%> Tag: How to Use SQL OLAP in Web application Tag: 326644
Comparing fields
Greetings,
I have a simple html/asp form that submits data to an access DB. The
idea is
when calling a record back from the db, the page will have an option to
change certain fields (drop down) then a new submit option.
My question at this point would be what logic or commands would I use
to compare the original data in the fields to what's being submitted. I
ultimately want to preserve the original records and somehow append
data that changes only. I'll need to eventually call a record and see
all the changes/updates made.
Someone mentioned I would prob need a couple of tables with a link
(relationship) but is it possible to dynamically create fields as
changes are made?
Thanks in advance, Tag: How to Use SQL OLAP in Web application Tag: 326643
Change the returned rows in a gridview
Hi!
I've got a DropDownlist with predefined numbers(5,10,15,20 etc.) which I
want to do a postback to the GridView pagesize, so that the user manually can
change returned rows. Is there a way to do that in the properties of the
Designview or must there be a code behind. If so, what is the code for this?
"Learn by doing, do by asking;)" Tag: How to Use SQL OLAP in Web application Tag: 326629
Service unavailable error
Service unavailable error comes randomly while accessing our website
and gets alright in matter of seconds....Could some one tell the
possible reasons for these to happen: i got a earlier suggestion to our
error as follows:
-------------------------------------------------------
If the error continues, it means that your website is exceeding the
resource thresholds we set in IIS. Your website has been allocated 20%
CPU and 800 MB of virtual memory. We set the limits to prevent any one
site from impacting server performance. IIS will restart your
application pool if these limits are exceeded. Your website will
display the "Service Unavailable" error while it is restarted.
If you find that this is happening, you will want to audit your scripts
to reduce resource usage.
If the error seems to happen randomly during the day and cannot be
linked to one or more specific scripts, then you are probably exceeding
our virtual memory limit. You can try to reduce memory by reducing
your per-session memory demands (session variables, objects, etc.)
and/or by reducing your total sessions (for example, by decreasing your
session timeout).
If the error is triggered by a particular script, then you will want to
first audit the script for high CPU usage. In particular, make sure
that the script doesn't have any infinite loop conditions.
-------------------------------
The points mentioned above was suggested earlier....But How to rectify
this error or atleast the process to find out which of the script pages
have errors which eat lot virtual memory.
We are runing a site with asp and database as sql...any help on this
account..
Mansi Tag: How to Use SQL OLAP in Web application Tag: 326623
VERY new to ASP, http 401.5 error
I've been trying to start out learning some ASP and I've been trying to
create the classic 'Hello world' program. I'm running the ASP pages on some
webspace I have, rather than on my computer. Everytime I try and run the asp
page it brings up a HTTP 401.5 error.
"HTTP Error 401.5 - Unauthorized: Authorization failed by an ISAPI/CGI
application.
Internet Information Services (IIS)"
I'm certain the webspace hosting the asp page allows asp pages (especially
since the company is called 'asp-host'!). I'd appreciate any help in
understanding why this is happening and how I might fix it. Tag: How to Use SQL OLAP in Web application Tag: 326614
Unique Way to Detect if Cookies are set - opinions?
I was thinking about an easy to determine if cookies are set or not in ASP. I began
thinking about how the Session ID is dependent upon a cookie - right?
Well, I disabled cookies in Firefox and then loaded a webpage that displayed
Session.SessionID. Viola, I got one! And then, I reloaded the page. And then, I noticed
that the SessionID incremented by one!
This still isn't yet a one-page method of detecting if cookies are enabled or not (like
BrowserHawk does), but are there any possibilities here?
Vic Tag: How to Use SQL OLAP in Web application Tag: 326613
Trigger
Need some help/advise.
I need 2 colums of one table to equal the value of 2 columns on another
table any time data is inserted there. Never messed with a trigger
before so I'm want to get help so I dont screw something up.
table - dbo.lotinfo
column - idrma
column - idlot
table - dbo.lotbd
column - idrma
column - idlot
anytime lotinfo has data inserted in the above columns I need the
respective columns in lotbd to equal the same thing automatically.
Any professional advise out there for a begginer with this subject?? Tag: How to Use SQL OLAP in Web application Tag: 326610
classic asp - returning records from access in a random order
Hi everyone.
I've recently written a classic asp website which uses an MS Access
datasource. I know this is less than an ideal data source as it has
limited functionality. I have a search form on my website which allows
users to define parameters and return results accordingly. The problem
i have is a need to return these results in a random order each time.
With SQLServer i know NEWID() would do the trick - used this many times
before but how do you acheive this with access?
After searching google for ages and trying many different things i came
upon this solution.
module called randomizer with the following code:
Public Function Randomizer() As Integer
Static AlreadyDone As Integer
If AlreadyDone = False Then Randomize: AlreadyDone = True
Randomizer = 0
End Function
Then i created a view with a simular sql statement as below
SELECT col1,
col2,
col3,
Rnd(isNull([Accomm_data].[Accomm_id]) * 0 + 1) AS ID
FROM accomm_data
ORDER BY member, rnd(isnull([accomm_data].[accomm_id])*0+1);
When i open this view in access each time it returns the results in a
different order. However when i use an sql statement in access with an
adodb object to pull the results from the access query it returns the
same results everytime :S Any idea's of what could be going on here?
If not anyone have any other ways of returning results in a random
order.
To clarify i do not want to select a random 3 records - i want to
return all records that match the criteria but in a random order all
into the same ADODB.Recordset object.
Regards
James Brand Tag: How to Use SQL OLAP in Web application Tag: 326601
INSERT statement error.
I have the following to insert a new record:
<%
.
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "DSN=qqqqq;"
SQLStmt = "INSERT INTO tbl_qqqqqq (main_cat, cat_fee, fee_amount) "
SQLStmt = SQLStmt & "VALUES ('" & main_cat & "','" & cat_fee & "','" &
fee_amount & "')"
Set RS = Conn.Execute(SQLStmt)
set rs=nothing
.
%>
The "fee_amount" is a number value that has a default value associated
with that field in the Access DB.
When I submit the form WITHOUT a value in the "fee_amount" form field, I
get the following error:
"[Microsoft][ODBC Microsoft Access Driver] Data type mismatch in
criteria expression."
That error typically means something like letters are are trying to be
inserted into a field that has a number data type.
In this case, no value has been given, when isn't the default value
being used when the INSERT statement is run?
Thanks.
Brett
bawork@sprynet.com Tag: How to Use SQL OLAP in Web application Tag: 326596
Add to exsiting value on update
I need a quick suggestion on the best way to accomplish the below:
A user can update a record in the db on the front end so....
if this is the first entry they input the value and submit it....
if the exsisting value needs to be updated because more came in, I want
the update to add to the exsisting value automatically on the front end
when the form is submitted ( dont trust the users math skills )
any help/suggestions are appreciated..... Tag: How to Use SQL OLAP in Web application Tag: 326595
Problems using ASP and Crystal Reports 8.5 to create dynamic PDF reports
As the subject of this topic suggestions I am trying to find a way to
use ASP, SQL Server, Com+ and Crystal Reports 8.5 to Create Dynamic PDF
Reports Over The Web, but the only article I found that decribes this
process is located on ASPToday.com which is no longer an active
website. When I try and suscribe to the site I just get a message
saying to email, and when I email I don't recieve a response.
Anyway the article I am looking for is entitled:
Using ASP, SQL Server, Com+ and Crystal Reports 8.5 to Create Dynamic
PDF Reports Over The Web
by Maria Alcalde Youngberg
If anyone had any imformation on how I can get this article or the
information that it would contain it would be much appreciated. If you
happen to already be part of ASPToday.com and could send me the
information in the article I would greatly appreciate that as well.
Again I have tried to access the website and I have even emailed APress
the owner of ASPToday, but so far I have no recieved any reponses.
I have even gone as far as trying to find contact information for the
author of the article Maria Alcalde Youngberg.
Thank you for any help that you can provide. Tag: How to Use SQL OLAP in Web application Tag: 326594
Form to Email question
Hi,
I have an asp page which I am designing.
On this page will be a set of records pulled from my db. These records
will be displayed within a form.
Each record will have a 'dropdown' displayed on the right hand side of
each record, so the user can select 'Approved' or 'Scrap' for each
seperate record.
I then want the user to be able to submit this form to us by email.
All I need to know is how to get the records with the selected answers
in the form into the body of the email ?
i.e.
Record1 > xxxxx yyyyy ffff rrrrrr 'Approved'
Record2 > xxxxx yyyyy ffff rrrrrr 'Approved'
Record3 > xxxxx yyyyy ffff rrrrrr 'Scrap'
Record4 > xxxxx yyyyy ffff rrrrrr 'Approved'
Record5 > xxxxx yyyyy ffff rrrrrr 'Approved'
Record6 > xxxxx yyyyy ffff rrrrrr 'Scrap'
Appreciate your help
Thanks
David. Tag: How to Use SQL OLAP in Web application Tag: 326593
"Non-persistent" session variables
Dear ASP community,
I have a question regarding ASP session variables.
My assumption was that a session variable has the same lifetime as the
session itself: as a consequence, given that closing the browser doesn't
terminate the session, the session variable is kept alive until the
session expires.
But, surprisingly, I've found this to be true for the session variables
whose value is set in the global.asa file, but if the value is set in an
.asp script, it appears to be erased from the session object as soon as
the browser is closed although the session is still alive. Strange. Is
this a bug?
What I'd need to know is: how I can make session variables whose value
is set in an .asp script persistent as long as the session is alive.
Thank you for your help,
A. S. Tag: How to Use SQL OLAP in Web application Tag: 326584
Request.Form not working?
I am having an issue with an app that I built, it seems that Request.Form
doesn't want to work sometimes, and only sometimes. For instance, I got a
call last week about an error, I had the user screenshot it and email it to
me, the error was,
Microsoft OLE DB Provider for SQL Server error '80040e14'
Line 1: Incorrect syntax near '='.
/file.asp, line 158
Line 158 points to a DELETE Statement with a WHERE clause of "...WHERE UID =
" & Request.Form("UID" & i).
This error bugged me, I couldn't figure it out because the app worked for
me. So today I get into work and find that there is another email report of
a problem. I do some troubleshooting and find that UID1 cannot be found, I
mean it is there on the submitting page, but Request.Form("UID1") returns
nothing. The weird thing is that Request.Form("UID2") returns the value of
UID2, as do all the other UID's (there are 25 of them). I tried all of the
usuals, Request("UID1"), even tried a loop to write out all of the form
values, there was no UID1 listed (although the source from the previous page
has a value for UID1), I checked the spelling, everything! I finally got
the error resolved by refreshing the page a few times, then it worked
without a hitch.
Has anyone seen anything like this? This is very troubling because it just
quits working out of the blue, no rhyme or reason (that I can tell).
Thanks,
Drew Laing Tag: How to Use SQL OLAP in Web application Tag: 326581
Looping code for an unknown reason!
Hi,
Im pretty new to asp so all light on this question would be great.
Basically i need to test to see what value is set (where to retrieve the
data from) so ive done it like this:
If Request.Querystring("id") = "" then
TidF=Request.Form("TidF")
Else
TidF=Request.Querystring("id")
End If
The data Request.Form("TidF") comes from a form if submit is pressed.
The data Request.Querystring("id") comes from the url being .asp?id=number
However it seems to keep looping round even though i have ended the if
statement and set the var.
all help would be great thanks. Tag: How to Use SQL OLAP in Web application Tag: 326571
Evaluate a recordset value
Hi,
I am new to ASP, HTML and iis.
I have my asp code working so that I can retrieve my desired record
from the database. I can place the data on the screen in table form.
All works fine.
I wish to evaluate one field in the record and depending on the value
in that field I wish to change the colour of the line in the table. As
in a status check.
My DB field is NCHAR.
I need to be able to do something like this....
IF rs.statusoferror = "Closed" THEN
response.write "it works"
END IF
I cannot find a way to return true for - rs.statusoferror = "Closed"
It is like the datatype is not compatible with my variable. If I
write rs.statusoferror to the screen it comes up with - Closed , but I
cannot evaluate with the same text.
I tried CAST, unsuccessfully. Am I barking up the wrong tree?
Cheers for any help.
Dave Tag: How to Use SQL OLAP in Web application Tag: 326569
Using Visual Studio to test ASP pages
I've downloaded both MS Visual Basic 2005 Express Edition and MS Visual Web Developer
2005 Express Edition.
All I want to do is be able to write some code snippets, in ASP (VBScript) and then run
them locally for debugging purposes. I've been going through the docs for both these
programs and I don't know if they can do this - can anyone help me with this? Can I use
either of these programs to debug ASP programs, and if so, how?
Thanks,
Vic Tag: How to Use SQL OLAP in Web application Tag: 326566
IIS4 application variable removal
Hi. Any way to do this from asp page in IIS4? Application.Contents.Remove is
IIS 5+. Setting variable to empty string does not remove variable.
thx,
nf Tag: How to Use SQL OLAP in Web application Tag: 326559
How can I reference an include page from global.asa?
I have different database connections that I use for DEV and PROD versions
of our web app.
I want to put the database connection string in one location so I only have
to change it once when we push live.
So I put it in an include file and reference it in all my asp pages as:
<!--#include file="includes/db_conn.inc"-->
But this will not work with the global.asa page.
How can I reference an include page from global.asa? Tag: How to Use SQL OLAP in Web application Tag: 326557
DemandADate-females earn $44 per date/up to $4000 a month
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft DHTML Editing Control">
<TITLE></TITLE>
</HEAD>
<BODY>
<P>New way of online dating. Free sign-up. </P>
<P> We are a growing company. </P>
<P>The only reliable way to date online.</P>
<P>Sign up at <A
href="http://www.demandadate.com">http://www.demandadate.com</A></P>
</BODY>
</HTML> Tag: How to Use SQL OLAP in Web application Tag: 326554
Window Scheduler
there is a job (exe) to generate a html page every night.
is it possible to have a asp to trigger the job in window scheuder?
Thanks a lot.
tony Tag: How to Use SQL OLAP in Web application Tag: 326551
Send report by email
Hello Friends,
I am generating two reports but two files.
First report is Shipment Booking Form. After generating this form, I
want to send to the cargo management by email. As far everything ok.
Along with this report, I have another file which generates packing
list and is also to be attached to the same email at one click from the
form.
How can I call that file which generates packing list and retrieve to
current page and send in the same email with two reports?
thanks in advance Tag: How to Use SQL OLAP in Web application Tag: 326550
Dropdown list in ASP
This is probably really stupid, but I cannot figure it out, and none of
the references I've found seem quite right for what I'm trying to do.
How do I do the below, but have the option values and Option Choice
Text Description pull from the db instead of requiring manual data
entry?
<option value="1" <%If (Not isNull((RS.Fields.Item("ID").Value))) Then
If ("1" =CStr((RS.Fields.Item("ID").Value))) Then
Response.Write("SELECTED") : Response.Write("")%>>Option Choice Text
Description</option>
Can anybody point me to some resources for this? Thanks in advance. Tag: How to Use SQL OLAP in Web application Tag: 326547
W3c Xinclude in xml parsing
Hello,
i've searched a lot on the webm but i cant end up with a solution.
Is it possible to process Xinclude directives in asp (server side)?
thx
Fab Tag: How to Use SQL OLAP in Web application Tag: 326546
Server object, ASP 0177 (0x800401F3)
Hi,
I have built a DLL using VB 6.0 and trying to run create the object in
ASP.
Eg:
<%
set a = Server.Createobject("Office.clsOffice")
%>
When the ASP is executed, I received the error message:
Error Type:
Server object, ASP 0177 (0x800401F3)
Invalid class string
I have regsvr32 the dll, added the DLL in Component services, grant
full access to the dll for the ISUR_XXX , IWAM_XXX users and even
administrator. But no matter what, it still doesn't work.
I am using WinXP Pro client and IIS 5.1.
The ASP and DLL works fine in my Win2K server. Is there some settings
in XP that I have missed out?
Any help is appreciated. Thanks.
Julian Lim Tag: How to Use SQL OLAP in Web application Tag: 326542
How to destroy an session
This is a multi-part message in MIME format.
------=_NextPart_000_0076_01C6F43C.D3F39950
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hello=20
How to destroy an session
thanks
Shun
------=_NextPart_000_0076_01C6F43C.D3F39950
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.2180" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>Hello </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV>
<P><FONT face=3DArial size=3D2>How to destroy an session</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>Shun</FONT></P>
<P><FONT face=3DArial size=3D2></FONT> </P>
<P><FONT face=3DArial size=3D2></FONT> </P></DIV></BODY></HTML>
------=_NextPart_000_0076_01C6F43C.D3F39950-- Tag: How to Use SQL OLAP in Web application Tag: 326541
Printing reports from ASP
how many ways to print reports from ASP?
Is it good to make use of Ms Office for printing process?
i find sometimes the excel or word is hanged up in server by using Office.
if it is a big report, is there any problem when other users activates
another report.
Grateful if you could put me some ideas. Thanks a lot.
tony Tag: How to Use SQL OLAP in Web application Tag: 326539
Urgent help need in ASP
I have a dll returning a variant array of 40,000 rows to an ASP page. I
can't use a Variant variable in ASP since the maximum rows it accepts
is 32717 approx. Can someone advice how to get the Variant array
returned by the dll into the ASP page?
Thanks! Tag: How to Use SQL OLAP in Web application Tag: 326524
Best practices for deployment from dev to stage to production
We have different settings for our development, stage and production
environments. For example, our development environment connection strings
point to development database instances, stage connection strings point to
stage database instances and so forth.
Without having to maintain separate web.config files, what are the various
approaches to having environment-specific settings? Tag: How to Use SQL OLAP in Web application Tag: 326520
W3 Jmail
I am new to Jmail/ASP and either need some help or someone to tell me I
am stupid...
I got Jmail to work fine. My problem is I need to send an email based
on somthing a customer submitted. When we receive the submission in
our system an auto-receipt email will be sent. What I need to have
happen (and cant figure out) is that email to include what was received
not just a on liner saying it was received. The information is pulled
from the db with a query. Anyone got any suggestions?
Danny Tag: How to Use SQL OLAP in Web application Tag: 326513
RegExp
I'm trying to validate and input field that allows an integer or a single
'*' character using regular expressions, but I'm not getting the results I'm
expecting.
I'm trying to match against the pattern "[^0-9]*|[^\*]", which I hoped would
translate to 'match against groups of the numbers (0-9) or against a single
*'. However, it's matching against character 1 for each of the examples
below when Global = False. When Global = True, it matches against character
2 for S4/S5, and against one after the last character for S1-S3.
I'm sure this is a simple one for the RegExp experts amongst us. Any
thoughts?
Thansk
CJM
'Code Snippet
Dim oRegExp, oExpMatch, s1, s2, s3, s4, s5
Set oRegExp = new RegExp
With oRegExp
s1 = "12345" 'valid
s2 = "*" 'valid
s3 = "12*" 'not valid
s4 = "ABC" 'not valid
s5 = "**" 'not valid
.Global = True
.Pattern = "[^0-9]*|[^\*]"
Set oExpMatch = oRegExp.Execute(s1)
Set oExpMatch = oRegExp.Execute(s2)
Set oExpMatch = oRegExp.Execute(s3)
Set oExpMatch = oRegExp.Execute(s4)
Set oExpMatch = oRegExp.Execute(s5)
Response.Write "Match " & oExpMatch.Count
End With
Set oExpMatch = nothing
Set oRegExp = nothing Tag: How to Use SQL OLAP in Web application Tag: 326512
Response.binaryWrite chunks of data
Hi,
I made a posting a while ago regarding doing a binarywrite of a large
file in chunks and got a lot of helpful responses. I was able to make
it work then. Unfortunately when the project is being tested its not
working and I am getting some weird results when testing. A month ago I
was able to stream a file of size 80Mb and it worked like a dream
Yesterday it would not work on the same file, but would stream smaller
files. The largest file i was able to stream yesterday was 55.5MB.
Today it wouldnot work with the 55.5MB file but only with a file of max
size of around 54.5MB. I can't seem to figure out what is causing this.
Because the code is the same. I actually get no error, with the file
size i mentioned i get a popup window within seconds for the file
download. But anything greater than that file size (max size as of
today 54.5) even if it is an MB more i get a blank screen but it never
pop ups the file download box
I am attaching my code below for reference, here is the main part of
what I am doing
Set BinaryStream = CreateObject("ADODB.Stream")
set fs = Server.CreateObject("Scripting.FileSystemObject")
Set Fil = fs.GetFile(path & filename)
BinaryStream.Type = 1
BinaryStream.Open
BinaryStream.LoadFromFile Fil.path
Dim i
Const BlockSize = 1000
For i = 1 To BinaryStream.Size Step BlockSize
Response.BinaryWrite BinaryStream.Read(BlockSize)
Next
'f Not BinaryStream.EOS Then Response.BinaryWrite
BinaryStream.Read
Any help on this crazy stuff would be appreciated :)
Thanks :) Tag: How to Use SQL OLAP in Web application Tag: 326511
Asp and Frames
Hi,
Can any help please...
I am trying to use frames in asp page. Well I am aware that frames are
on client side etc..
what I need is following. Let me explain using the main page which have
the frames skeleton :
******FRAME.asp**
<HTML>
<HEAD>
</HEAD>
<FRAMESET ROWS="50%,50%">
<FRAME SRC="which.asp" NAME="which" FRAMEBORDER=0 BORDER=0>
<FRAME SRC="what.asp" NAME="what" FRAMEBORDER=0 BORDER=0>
</FRAMESET>
</HTML>
************
1) on page what.asp i am extracting value from database in a table
format.
2) when any row in what.asp is clicked the value should change in
which.asp
3) Finally I should be able to submit the whole FRAME.asp when the
update button on what.asp is selected.
Tried to search for examples on the net but unable to find any. If any
of you knw any examples please guide me to the site.
Thank you very much ..
regards
philin Tag: How to Use SQL OLAP in Web application Tag: 326503
POST url based upon item selected in dropdown list (sounds Simple)
Is this possible? I have three items in drop down "Select Payment
Type", "Credit Card" and "Check". if user select Credit card then i
need to post the form variables to different URL than check selecting.
Thanks for your help in advance.
suresh
...... Method="POST", Action= & url ........
IF (dropdown.index =1)
{
url = "http://somebank.com/1/post.asp"
}
IF (dropdown.index =2)
{
url = "http://somebank.com/2/post.asp"
} Tag: How to Use SQL OLAP in Web application Tag: 326500
Is their an FTP class in .NET 1.1?
I am trying to validate a persons FTP access (username and password)
but I cannot find a way, in .net 1.1, to logon to an FTP server. In
2.0 there is a class for it but how do I do this in 1.1?
Thanks for any help you can give.
Tom P. Tag: How to Use SQL OLAP in Web application Tag: 326495
How to make ASP page pause for some time
Hi All
I am having an ASP page which will get some set of files from
VSS.After that, in the same page I am running a bat file to remove some
unwanted files.Then I am displaying the files remaining in the page.
Every thing is working fine ,but the bat file is taking some time to
remove the files. so first time when it displays the files , it is
displaying the unwanted files also.Once after fully loading the page
,if I press refresh those unwanted files are not there.
I want the page to wait for some time to get the files deleted and then
display them on the page.
Any idea, how can I do this..????
Any help would be appreciated Tag: How to Use SQL OLAP in Web application Tag: 326489
query in ASP to SQL db
<% Datum = "1/1/2005"
Datum = cdate(datum)
Datum2 = datum + 9
Datum = Month(Datum) & "-" & Day(Datum) & "-" & Year(Datum)
Datum2 = Month(Datum2) & "-" & Day(Datum2) & "-" & Year(Datum2)
sql = "SELECT R_Reenval.NAAM, R_Reenval.Jaar, R_Reenval.Maand,
R_Reenval.Dag, R_Reenval.Reenval_Silo, Sum(Reenval_Silo) AS
SumOfReenval_Silo FROM R_Reenval WHERE ((R_Reenval.NAAM)='klerksdorp')
AND (R_Reenval.Datum Between " & cdate(Datum) & " And " & cdate(Datum2)
& ") Group By R_Reenval.NAAM, R_Reenval.Jaar, R_Reenval.Maand,
R_Reenval.Dag, R_Reenval.Reenval_Silo ORDER BY Jaar, Maand, Dag" %>
I am tryng to query some data according to dates...No matter hw I
change the format of the date variables, my recordset still returns no
data.
Any ideas, suggestions please. Any help will be gr8ly appreciated..thanx Tag: How to Use SQL OLAP in Web application Tag: 326486
creating bulk email through cdosys.dll
is it possible to rn a client side vbscript to send messages using
cdo.message and cdo.configuration? what are the requirements to do this? my
wks are xp and 2000 and all have cdosys.dll registered. do i have to have
outlook express loaded. i have workstations that don't have outlook but
rather lotus notes and want to send email to an smtp server. these emails
have local attachment thus the need to run client script versus server
scripts. is this possible or am i on the wrong track. Tag: How to Use SQL OLAP in Web application Tag: 326482
passing correct value types from ASP/VBScript to VB/DLL
Hi All,
I'm getting an error on my ASP page:
Microsoft VBScript runtime error '800a000d'
Type mismatch: 'StoreFileIntoField'
I assume - 99.5% - the error is generated because of worng value types,
I attemp to pass from my ASP/VBScript page to the VB/DLL function.
My relevant ASP/VBScript Code is:
<%
sTemp = "SomeStringOK"
mcsSQL = "select * from tbl1"
' creates an object ref to the VB/DLL function
Set obj = Server.CreateObject("SaveCreateFileADO.cStoreCreateFileADO")
' creates a ref' to my recordset object
Set rs = Server.CreateObject("ADODB.Recordset")
' openning the recordset with values of the string connection
rs.Open mcsSQL, mConn, 1, 3
With rs
.AddNew
If Not .EOF Then
'VB5: Dim fldFileName As ADODB.Field
'VB5: Set fldFileName = .Fields![sFileName] 'set reference to this
field
' vbscript:
Set fldFileName = rs("sFileName")
'VB5: Dim fldLongBinary As ADODB.Field
'VB5: Set fldLongBinary = .Fields![oPicture] 'set a reference to the
file field
' vbscript:
Set fldFileName = rs("oPicture")
rs("desc")= now() & "hello"
With obj
' call the VB/DLL
' THIS IS the line that generates the ERROR
If .StoreFileIntoField(rs, fldFileName, fldLongBinary, sTemp) Then
' do something End If
End With
End If
.Update
.Close
End With
%>
The Function in the VB/DLL is - returns a boolean value -
StoreFileIntoField(rs, fldFileName, fldLongBinary, sTemp)
suppose to get THESE values types:
rs VB5: As New ADODB.Recordset
fldFileName VB5: As ADODB.Field
fldLongBinary VB5: As ADODB.Field
sTemp VB5: As String
My Question is :
How do I pass the correct value types from ASP/VBScript to VB/DLL,
using this notion of ADO/ASP 2.0 syntex on PWS 4.0? Tag: How to Use SQL OLAP in Web application Tag: 326481
passing correct value types from ASP/VBScript to VB/DLL
Hi All,
I'm getting an error on my ASP page:
Microsoft VBScript runtime error '800a000d'
Type mismatch: 'StoreFileIntoField'
I assume - 99.5% - the error is generated because of worng value types,
I attemp to pass from my ASP/VBScript page to the VB/DLL function.
My relevant ASP/VBScript Code is:
<%
sTemp = "SomeStringOK"
mcsSQL = "select * from tbl1"
' creates an object ref to the VB/DLL function
Set obj = Server.CreateObject("SaveCreateFileADO.cStoreCreateFileADO")
' creates a ref' to my recordset object
Set rs = Server.CreateObject("ADODB.Recordset")
' openning the recordset with values of the string connection
rs.Open mcsSQL, mConn, 1, 3
With rs
.AddNew
If Not .EOF Then
'VB5: Dim fldFileName As ADODB.Field
'VB5: Set fldFileName = .Fields![sFileName] 'set reference to this
field
' vbscript:
Set fldFileName = rs("sFileName")
'VB5: Dim fldLongBinary As ADODB.Field
'VB5: Set fldLongBinary = .Fields![oPicture] 'set a reference to the
file field
' vbscript:
Set fldFileName = rs("oPicture")
rs("desc")= now() & "hello"
With obj
' call the VB/DLL
' THIS IS the line that generates the ERROR
If .StoreFileIntoField(rs, fldFileName, fldLongBinary, sTemp) Then
' do something End If
End With
End If
.Update
.Close
End With
%>
The Function in the VB/DLL is - returns a boolean value -
StoreFileIntoField(rs, fldFileName, fldLongBinary, sTemp)
suppose to get THESE values types:
rs VB5: As New ADODB.Recordset
fldFileName VB5: As ADODB.Field
fldLongBinary VB5: As ADODB.Field
sTemp VB5: As String
My Question is :
How do I pass the correct value types from ASP/VBScript to VB/DLL,
using this notion of ADO/ASP 2.0 syntex on PWS 4.0? Tag: How to Use SQL OLAP in Web application Tag: 326480
How to view the code using VS 2003?
When I open a page from an existing website file in VS 2003, the page
immediately executes without giving me the opportunity to view the code or
insert a stop or break. How to view the code?
Thanks,
Keith Tag: How to Use SQL OLAP in Web application Tag: 326473
Dear all,
Is there is any way to use SQL OLAP in Web application .IS possiable How plz
give me some example Links