Database - recursive function calls - how would you do this?
.:: The Specs:
MS Access 2000 (host charges extra for SQL/MySQL)
MS Windows Server 2003 (prod) / MS XP SP1 (dev)
.:: The setup:
The database has been setup with two tables;
tblDownloads
tblCatagories
Each "download" consists of a catagory field that corresponds to fldID in
tblCatagories. Each catagory, where the catagory is a parent, has a parent
field of value: 0 and each child, has a field with a value corresponding to
the fldID of it's parent. So for example;
**********************
fldID / fldName / fldParent
**********************
1 Multimedia 0
2 Audio 1
3 Video 1
Now, each child can have children of it's own (I've not put a drill level on
it as the app I'm writing is for a friend and he's specifically asked for
"no limit" on how low it can go), so for example (the following represents
how tblCatagories is setup);
**********************
fldID / fldName / fldParent
**********************
1 Multimedia 0
2 Audio 1
3 Video 1
4 MP3 Players 2
5 Skinnable 4
6 Add-ons 4
7 Misc 6
.:: The problem:
What I'm basically needing to do, is count the downloads in the current
catagory, so for example, in the case where the selected catagory was MP3
Players, it would run through "MP3 Players", "Skinnable", "Add-ons" and
"Misc" and count each download from tblDownloads, that corresponds to one of
those catagories. In the case where the catagory selected was null (i.e.
default downloads page), it would show all downloads for Multimedia and it's
children.
The code I've written will get the PC (parent catagory) and it's children,
but will not then progress to get the childrens children.
I search several places for recursive queries (or alternate ways to do what
I am needing) and unfortunately, I've thus far been unsuccessful in finding
one that works for my situation (they all either assume to be working with
SQL, or that there's a limit on how far down it can go, or uses INNER JOIN
(assumes the values are in two different tables, which is not the case
here)). Had this been VB, I could have simply used a GoTo [LABEL] where
child catagories were present, unfortunately ASP does not support this.
No error is returned to the server's logs or the event viewer, and no error
is returned to the client browser (client debug is turned on and the browser
is set to display the real error, rather than the horrid 500 error), the
page (and subequently, the server) stops responding. I've been trying to
figure this one out for just over 3 days now and am at my wits end (I know
recursive queries work as I've used them before, so why isn't it in this
case?).
.:: The code:
The functions involved are;
IsParentCatagory (returns boolean value)
HasChildren (returns boolean value)
GetChildren (returns long)
GetParent (returns long)
GetDownloadCount (returns long)
The function thats called to get the children is below. What I tried doing
was, looping through the children returned (after closing the existing rs of
course), and re-calling the function for each child (to then get the
childrens children and so on). Unfortunately, this does not apparently want
to work.
Sub CountEm(lCatID)
'// Init call for current catagory
GetChildren lCatID
'// Debugging (checked that there was actually something to process)
'// Response.Write "sKids: " & sKids: Response.End
arrChildren = Split(sKids, ",")
For x = LBound(arrChildren) To UBound(arrChildren)
'// Tried without the Call aswell, just incase
Call GetChildren(arrChildren(x))
Next
End Sub
Function GetChildren(lID)
Set oDB = Connect(DB_Downloads, 1)
sSQL = "Select fldID, fldParent From tblCatagories Where fldParent = " &
lID
Set rRst = oDB.Execute(sSQL)
If rRst.EOF Then rRst.Close: GetChildren = 0: Exit Function
Do Until rRst.EOF
'// The following If/End If is on one line,
'// just re-wrote it here incase of linewrap
If Len(sKids) = 0 Then
sKids = rRst("fldID")
Else
sKids = sKids & "," & rRst("fldID")
End If
rRst.MoveNext
Loop
rRst.Close: Set rRst = Nothing
'// Once returned, a Do/Loop is performed to run through
'// the children and count their downloads using GetDownloadCount
GetChildren = sKids
End Function
What I'm basically wanting to do is recurse to the lowest child catagories
(where HasChildren = False), regardless of how far down that actually is,
and return the download count for each child (upto and including the top
level parent). phpBB does this with ease for their downloads catagory, so
I'm almost positive this is relatively simple to do, but for the life of me,
I can't figure out where I am going wrong (and can't understand PHP or would
have took a look at their coding for hints). As an FYI, I also tried making
the above function a sub (since sKids is a public string anyway) and that
didn't help either.
Does anyone have any suggestions please?
--
Regards
Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk
Keeping it FREE! Tag: Using sql reporting services in asp Tag: 316131
how to manage frames by c# code
Hi,
I am new user of Asp.net. I want to open a page in right frame when i click
a button from left frame. this must simple but i don.t know how to this?
regards
omer Tag: Using sql reporting services in asp Tag: 316127
Creating an Excel file from ASP and setting a LineFeed
From ASP I create response, which is to be shown as an Excel worksheet in
the user's browser (by setting the ContentType and creating a table). This
works fine.
Does anybody know what to do, if one of the cells should contain a multiline
text? I already tried by inserting a <br> inside the <td>. But this won't
work.
--
Michael G. Schneider
MTLookup http://www.mtlookup.com
Movable Type Weblog http://www.movable-type-weblog.com/ Tag: Using sql reporting services in asp Tag: 316124
Building Multilingual Portal
Building Multilingual Portal
I have been assigned a new project to build a multilingual portal using ASP
and/or ASP.NET and the expected Microsoft technologies including ADO and SQL
Server 2000.
To date, all of my Web Solutions use ADO to access data which is stored in
SQL SERVER. Given the need to develop a solution that is very easy to
localize, I wonder if now I should consider instead using XML rather than SQL
SERVER, or a combination of both.
If anyone has experience on this subject, or could point me to some
articles, suggesting alternative approaches to developing multilingual
portals using XML and/or SQL Server, that would be great. Thanks. Tag: Using sql reporting services in asp Tag: 316121
ASP: Multiple page forms, with dynamic form elements - HELP!
I'm having serious issues with a page I'm developing. I just need some
simple help, and was hoping someone might be able to help me out in
here.
I have a form, that consists of 3 pages of fields. I'd like to create
a page in which all of this is stored as you move along as hidden
variables, until the end, when the user submits. I can't figure out
one thing: I have dynamic form elements (dropdowns), that I'd like to
use instead of setting the dropdowns statically.
Here's the dynamic select I'd like to use - can someone help me out? I
can't just add them into the code - I keep getting an error message as
soon as I do it, but I'm not sure why. Novice ASP developer here. :(
Again, all I want to do is replace the <select> from the ASP page
underneath with my dynamic <select>...
<select name="settingOffered" id="settingOffered">
<%
While (NOT rssettingOffered.EOF)
%>
<option
value="<%=(rssettingOffered.Fields.Item("pkSettingOffered").Value)%>">
<%=(rssettingOffered.Fields.Item("settingOffered").Value)%></option>
<%
rssettingOffered.MoveNext()
Wend
If (rssettingOffered.CursorType > 0) Then
rssettingOffered.MoveFirst
Else
rssettingOffered.Requery
End If
%>
</select>
**********************************************
And here's the page that I can't get to work:
**********************************************
<%
Const NUMBER_OF_PAGES = 3
Dim intPreviousPage
Dim intCurrentPage
Dim strItem
intPreviousPage = Request.Form("page")
Select Case Request.Form("navigate")
Case "< Back"
intCurrentPage = intPreviousPage - 1
Case "Next >"
intCurrentPage = intPreviousPage + 1
Case Else
intCurrentPage = 1
End Select
If Request.Form("navigate") <> "Finish" Then %>
<form action="<%= Request.ServerVariables("URL") %>" method="post">
<input type="hidden" name="page" value="<%= intCurrentPage %>">
<%
For Each strItem In Request.Form
If strItem <> "page" And strItem <> "navigate" Then
If CInt(Left(strItem, 1)) <> intCurrentPage Then
Response.Write("<input type=""hidden"" name=""" & strItem & """" _
& " value=""" & Request.Form(strItem) & """>" & vbCrLf)
End If
End If
Next
Select Case intCurrentPage
<%
Case 1
%>
<table>
<tr>
<td><strong>Age:</strong></td>
<td>
<select name="3_age">
<option></option>
<option<% If Request.Form("3_age") = "< 20" Then Response.Write("
selected=""selected""") %>>< 20</option>
<option<% If Request.Form("3_age") = "20 - 29" Then Response.Write("
selected=""selected""") %>>20 - 29</option>
</select>
</td>
</tr>
</table>
<%
Case 2
%>
<table>
<tr>
<td><strong>Age:</strong></td>
<td>
<select name="3_age">
<option></option>
<option<% If Request.Form("3_age") = "< 20" Then Response.Write("
selected=""selected""") %>>< 20</option>
<option<% If Request.Form("3_age") = "20 - 29" Then Response.Write("
selected=""selected""") %>>20 - 29</option>
</select>
</td>
</tr>
</table>
<%
Case 3
%>
<table>
<tr>
<td><strong>Age:</strong></td>
<td>
<select name="3_age">
<option></option>
<option<% If Request.Form("3_age") = "< 20" Then Response.Write("
selected=""selected""") %>>< 20</option>
<option<% If Request.Form("3_age") = "20 - 29" Then Response.Write("
selected=""selected""") %>>20 - 29</option>
</select>
</td>
</tr>
</table>
<%
Case Else
Response.Write("Error: Bad Page Number!")
End Select
%>
<br />
<% If intCurrentPage > 1 Then %>
<input type="submit" name="navigate" value="< Back">
<% End If %>
<% If intCurrentPage < NUMBER_OF_PAGES Then %>
<input type="submit" name="navigate" value="Next >">
<% Else %>
<input type="submit" name="navigate" value="Finish">
<% End If %>
</form>
<%
Else
For Each strItem In Request.Form
Response.Write(strItem & ": " & Request.Form(strItem) & "<br />" &
vbCrLf)
Next
%>
<p><strong>
Here's what you entered:
</strong></p>
<pre>
<strong>Name:</strong> <%= Request.Form("1_name") %>
<strong>Email:</strong> <%= Request.Form("1_email") %>
<strong>Address:</strong> <%= Request.Form("2_address") %>
<strong>City:</strong> <%= Request.Form("2_city") %>
<strong>State:</strong> <%= Request.Form("2_state") %>
<strong>Zip:</strong> <%= Request.Form("2_zip") %>
<strong>Sex:</strong> <%= Request.Form("3_sex") %>
<strong>Age:</strong> <%= Request.Form("3_age") %>
</pre>
<p>
<a href="<%= Request.ServerVariables("URL") %>">Start Again</a>
</p>
<%
End If
%> Tag: Using sql reporting services in asp Tag: 316119
SQL Server Errors - HELP
3 workstations previously installed and able to access server.
4th workstation am able to map to server access files but when
attempting to log in receive the following error.
EXTERNAL DATABASE OPEN FAILURE
Error: -2147467259[Microsoft][ODBC SQL Server Driver][Shared Memory]SQL
Server does not exist.
The workstation that is unable to connect is running XP SP2, MDAC 2.7..
the difference btwn this and the others is that it is running wireless.
Ruled out wirelss as being the problem because hooked LAN cable and
receive the same error.
Checked that TCP/IP is enabled and port is 1433
Went to Adminstrative Tools ODBC to access server and receive the
following error:
Connection failed
SQLState: '01000'
SQL Server Error: 20
[Microsoft][ODBC SQL Server Driver][TCP/IP
Sockets]ConnectionOpen(PreLoginHandshake()).
Connection failed;
SQLState: '08001'
SQL Server Error:20
[Microsoft][ODBC SQL Server Driver][TCP/IP Sockets]Encryption support
on SQL Server
Tried some other setting changes as well can someone help.. PLEASE !! Tag: Using sql reporting services in asp Tag: 316114
DLL from ASP
I created a simple dll. I am able to reference and use it from a vb
program, but not from an asp page. This code
Set o = Server.CreateObject("MyLib.MyClass")
gives me this error:
Server object, ASP 0177 (0x800401F3)
Invalid class string
I gave Full Control permission to Everyone to both my dll file and
msvbvm60.dll.
What is going wrong? Tag: Using sql reporting services in asp Tag: 316111
bypassing web form hardcoding login and password
I need to hide the complexity from users to access an information
webpage, which is normally accessible after filling in a web
form with the correct data.
The address of the information webpage is like
https://external.address.com/info.asp?<numeric code>
where <numeric code> is a number generated by the server.
This number (always different) is generated by the server only when you
open the first web page in your browser, fill in the right values in 2
fields (user, password) and click Login.
Any advices? Tag: Using sql reporting services in asp Tag: 316109
is it Hidden prame issue?
I have an ASP page which has 2 list boxes. When the selection changes from
L1 it runs another asp page in hidden frame (hidden1), that page will do
some database fetch and will set some control values on the original page.
When the selection changes from listbox L2 i.e. it runs another asp page in
a hidden frame (hidden2), that page will also do some database interaction
and will set some control values on the original page.
When these 2 actions explicitely did then they work great.
Now I want to load the page initally and I have to set the default values
for those 2 list boxes which will ultimately run 2 differnet pages in 2
different frames. This too works well....no issues...
My question is, when initally loaded and 2 pages runs in 2 hidden frames
that time I noticed that my status bar is still progressing but the values
have been already processed and the pages have been procesed in the
repective hidden frames. Then, why the status bar is still
progressing....this is creating unnecessary confusion and people think that
the page is still loading or doing something but the truth is that page is
processed and stable to use.....
How can I stop that the status progress bar....or any other solution!!!
Thanks Tag: Using sql reporting services in asp Tag: 316107
Cannot create a asp dot net project
I have 2 developper machine running visual studio 2003 and Windows
2000.
On the first machine (Machine A) I may create a new asp project without
problem. On the second (Machine B) I cannot create a new project.
Visual Studo create the project but not the initial files and freezes.
But I may create a new project from Machine A using the web server of
machine B.
I have checked the access rights of both servers, the access rights on
directory wwwroot and inetpub.
Everything seems the same.
Thank you for help
Patrick Tag: Using sql reporting services in asp Tag: 316103
classic asp byRef vs. byBal
what is the default behavior of asp for passing values to a function, byRef
or byVal? i was under the assumption that if you do not specify, then it
defaults to passing the parameter byRef.
so for example, the following function is accepting param1 and param2 as
"byRef" parameters:
function myFunction(param1,param2)
'do something
end function
am i correct?
thanks,
jt Tag: Using sql reporting services in asp Tag: 316102
Replace function - error 80020009
Hello,
I try to use the replace function with a very long text and I have this
error :
error '80020009'
Exception occurred.
Do you have any idee to resolve this problem ?
Thanks Tag: Using sql reporting services in asp Tag: 316094
Expired Web Page!
I want to show users a custom "Page Expired" page when users go back to
the previous page by clicking the "Back" button of the browser (or when
he right-clicks anywhere on the current page & selects "Back" from the
menu). How do I do this?
Thanks,
Arpan Tag: Using sql reporting services in asp Tag: 316085
text stream going back....
I'm using
file.OpenAsTextStream(ForReading, _
TristateUseDefault)
and then i read some lines.
Line = TextStream.readline
Then when i finished reading it i need to go to the begiining and read some
lines again.
But i dont see how to go back to the begining.
I mean, Is there a way to go back to the first line of the file if i
allready read some lines
How do i do that??? Tag: Using sql reporting services in asp Tag: 316079
Randomly generated filename.
How could I create a random filename for a single-use download? So, if
a user was to download a file from a site it would send them a unique
filename that could only be used once. That link would not be available
after the download completed. Tag: Using sql reporting services in asp Tag: 316078
ActiveX Control problem in ASP with IIS 6.0
Hi
I have a custom ActiveX Control that is working fine with ASP in IIS
5.1 on WinXP.
But the same ASP page is failing in Server.CreateObject of that ActiveX
Control in IIS 6.0 on Win Server 2003. Do i need to change any
configuration on my IIS 6.0
Thanks Tag: Using sql reporting services in asp Tag: 316077
Delete complete folder
Can't find exemple. How can i delete a complete folder including subfolders
and files in the subfolders. Or do i to delete one by one ?
Gérard. Tag: Using sql reporting services in asp Tag: 316068
impersonation, LDAP, IIS6 and my brain full of knots
Hi all,
somehow I'm going nuts with this authentications inside IIS6, but from
the beginning:
We have a W2k3 Server running IIS6 with an application running as
NetworkService. The Authenticationmode on this Web is integrated
Microsoft.
Up to now, everything worked fine, but we want to add a new function,
which is getting me into problems.
The function should be to get informations via SamAccountName by
querying LDAP.
My first start was to get it done by a serverscript.
That failt, because of the NetworkService Account.
So, we created a domainAccount, which we put into the IIS_WP group and
set the application to run with this.
Now the WEB doesn't authenticate anymore. You are prombted for the
authentication and if You lookup the Sec Eventlog You see, that the
server tries to Authenticate with an empty username and domain. Just
the source Workstation is filled with the IP of the Client trying to
connect to the Application.
After struggling around with some different local policies, I quit.
The next Idea was to set up a clientscript, which is started by a
Button. The page loads, the user enters the SamAccountName in a field,
hits a button and a VBScript-Function is started to query. but now we
are running into an ActiveX Error, failt to GetObject.
Now to my question.
How can I get this running?
Just to explain the function I want again:
I have a field (NETID) and want to get the rest of the Informations
from the AD. Best would be to runn this on the WebServer, which is
Member of the AD.
Thanks in advance for Your Help.
If You need any additional Informatons, don't hesitate to ask.
Carsten Tag: Using sql reporting services in asp Tag: 316064
Request.Form returns nothing
I have a long list of checkboxes and a text field is associated with
each checkbox. So I created a loop that should get the value of each
text field that has a marked checkbox next to it. Here's my code
for each g in gildi
aths = Request.Form("rok_" & g)
...
next
then I create a query with the value and send it. Anyway here's my
problem:
the aths variable gets the correct value on the first iteration but is
blank every time after that. Please help, this is urgent. Tag: Using sql reporting services in asp Tag: 316063
cannot compare dates with ASP and Access backend
Help! :{
I have a simple select query in an Access database that has three
parameters. Two are text, one is a date. If I run my query in Access, it
prompts for the date, and two text parameters, I enter them, and they work
fine. However, if I try to run the same thing in ASP, I get an error:
Microsoft OLE DB Provider for ODBC Drivers error '80040e07'
[Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria
expression.
The code I am using is:
Const adCmdStoredProc = &H0004
Const adParamInput = &H0001
Const adVarChar = 200
const adDate = 7
dim cmd
set cmd = server.createobject("adodb.command")
with cmd
.ActiveConnection = "....dsn"
.CommandText = "qryName"
.CommandType = adCmdStoredProc
.Parameters.Append
.CreateParameter("strFName",adVarChar,adParamInput,40,sFirstName)
.Parameters.Append
.CreateParameter("strLName",adVarChar,adParamInput,40,sLastName)
.Parameters.Append
.CreateParameter("dteDate",adDate,adParamInput,255,cDate(tmpDate))
set rsSched = .execute
end with
Now, if I go into the query and set the date criteria to be:
[dteDate]
then it works fine. However, if I set my criteria to be:
>=[dteDate]
then it errors out.
I originally had this as an adodb connection with a SQL string,
unfortunately, some of the last names have apostrophes, so this was the only
way I figured I could do it.
Any ideas?
Thanks! Tag: Using sql reporting services in asp Tag: 316054
Check directory/file protection?
Using ASP in a VBScript environment, how can I check the protection on a directory, or a
particular file? Tag: Using sql reporting services in asp Tag: 316053
How to build a table layout
I would like some guidance as to how to proceed to build a webpage in asp or
aspx. I am going to hit a SQL db needing to get the following data:
SELECT ServerName,PrimaryTech FROM tblservers GROUP BY
PrimaryTech,ServerName
The idea is to display the data in a table format where the Column header
would the PrimaryTech and under each tech would the ServerName they are
responsible for.
ie.....
John Matt Joe
Srv1 Srv3 Srv2
Srv4 Srv6 Srv14
TIA
CD Tag: Using sql reporting services in asp Tag: 316052
HTTP/1.1 500 Server Error
Opening an ASP page brings up this error HTTP/1.1 500 Server Error
This is from the Event Viewer:
Error: ASP will not serve requests because it could not perform the first
request initialization..
For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.
Any ideas will be much appreciated.
Thanks, Tag: Using sql reporting services in asp Tag: 316049
Hanlding comma in a field in a form which takes currency values
Hi,
I have form where one has to input officer's salary along with other data.
The officer's salary field is tied to a currency field in backend Access.
Right now folks enter numbers e.g. 30000.00. However, when someone is writing
30,000.00
a error message comes which shows syntax error. The sql statement via
response.write does not allow me to update the database. However, without the
comma, things are fine. Is there any way to create a error message, which
will not allow one to save the record, if comma is put in the salary value
e.g. 40,000.00?
Any help is appreciated. Thanks. Tag: Using sql reporting services in asp Tag: 316046
The requested resource is in use Error
Sorry for the multiple post but did not know where exactly this belonged.
I am getting an error message - The requested resource is in use on Windows
Server 2003.
I have tried check and uncheck the Cache ISAPI extensions.
The web server can serve up HTML pages and images. The problem is with the
ASP/ ASPX pages.
Any help will be much appreciated.
TIA Tag: Using sql reporting services in asp Tag: 316044
Build page based on link
This may have been asked before but I couldn't find it. I'm not
really an asp guy but I'm fumbling my way around. I don't have problems
creating connections, recordsets etc. But the in's and out's of asp I
don't really know. So.... Let's say I have access to data. Based on
which links (basically view, edit, new) I want a page to build in a
manner reflecting the link that was chosen. That is, if view is chosen
just show associated data, if edit is chosen, add to data, etc. It
seems like maybe the request object could help me out with this but I'm
not sure how. Tag: Using sql reporting services in asp Tag: 316036
Get System user name at WINNT and WIN2000
I am writing a web application to get System user name. By reading the
previous post, it seems that this method works
<%@ Language=VBScript %>
<%
Dim user, pword
user = Request.ServerVariables("AUTH_USER")
Response.Write user
%>
but I want to ask is it only work at WINNT? How about WIN2000 Server, I
can get nothing when use this statement on WIN2000 Server.
Besides,
If I want to use Jsp, is there any methods to achieve the same thing?
Thank you! Tag: Using sql reporting services in asp Tag: 316026
Topic Completion
Everyone who contributed, thank you. But I just wanted to put one
final note on this topic to "round out" the real issue and goal of my
original post.
My real goal was to "obfuscate" the links in my web pages to graphics
on an e-commerce supplier's web host. Their domain is different than
mine, so I didn't want hackers or other curious types investigating my
upline supplier by going to the root of the domain specified in the
"img src=" tag. I get a database from them with the name of the
graphic, and I have a set of "strings" in my scripts of directories
for different sizes of the same graphic, etc... so I put together the
URL with two parts, [URL directory "string"] & [graphic name].
When sending any text from the the buffer back to the IE browser, for
the rest of all buffer flushes, it is set into a mode that will
interpret binarywrites as "ascii"... so, even a small piece of html
before the binarywrite will cause the browser to show a bunch of
interpreted stuff on the screen... response.clear, gets rid of
everything, but I wanted to intermingle the html and by binarywrite.
I don't know of a contentType that would make this happen together.
Furthermore, writing the file to the disk is way too intensive for
just browsing my catalog pages full of graphics, BUT is great code for
page scraping and saving graphics.
Anyway... it dawned on me. duh. All I wanna' do is make sure they
don't know the domain of the graphic source, so...
I created an getImage.asp file. It gets two querystrings: Image, and
Size. Image is the image name, size is a short variable denoting the
directory on the web host (the complete url/[directory] that only I
KNOW). From a <img src="getImage.asp?image=[blah]&size=[blah]"
border=0> tag within the document one can integrate the graphic
because the browser is making separate http socket connections out to
the script. The script does the appropriate binarywrite of the
responsebody in the img tag container.
At first I thought I could "encrypt" the q-string and then that led me
to see that I didn't HAVE to put the whole domain URL on the q-string.
Other code in this topic would be very good for page scraping. Tag: Using sql reporting services in asp Tag: 316023
cdo.message emails stuck in queue
I'm working on a classic asp site and am having sending mails in my
development environment.
In attempting to use CDO.Message the emails usually (but not always)
get stuck in my mail Queue folder.
Any ideas? I can provide more info if that would help.
Thanks. Tag: Using sql reporting services in asp Tag: 316022
Replcae Broken Images
Not sure if this can be done with ASP but I would like to find a way
to detect if an image is missing and replace it with a default image instead
of the dreaded RED X showing up.
How can I achieve this?
Thanks in Advance! Tag: Using sql reporting services in asp Tag: 316020
Real Newbie
This is a multi-part message in MIME format.
------=_NextPart_000_00A0_01C5D32A.206452A0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I just installed Visual Studio.NET and now when I try to just open an =
ASP page in my IE browser, it goes straight to the Visual Studio's =
Microsoft Development Environment [design] page and I can't figure out =
how to get it to show in a regular IE page. Like I said I am a real =
newbie with ASPs and visual studio and I am sure most everyone is =
laughing at this question, but before I get into reading and studying =
the programs, I still need to be able to open a few asp pages that I =
already use.
Thanks, :-(
------=_NextPart_000_00A0_01C5D32A.206452A0
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.2722" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>I just installed Visual Studio.NET and =
now when I=20
try to just open an ASP page in my IE browser, it goes straight to the =
Visual=20
Studio's Microsoft Development Environment [design] page and I =
can't=20
figure out how to get it to show in a regular IE page. Like I said =
I am a=20
real newbie with ASPs and visual studio and I am sure most everyone is =
laughing=20
at this question, but before I get into reading and studying the =
programs, I=20
still need to be able to open a few asp pages that I already =
use.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Thanks, :-( =
</FONT></DIV></BODY></HTML>
------=_NextPart_000_00A0_01C5D32A.206452A0-- Tag: Using sql reporting services in asp Tag: 316019
Recordset!
Assume that an ASP page has 3 SQL queries. Can a recordset object be
populated with the records of all these 3 queries at the same time?
Please note that the 3 queries are distinct queries, not related to
each other in any way. Also please note that I am not talking about
populating the recordset with the records of the 1st query, then
closing it & again opening that recordset, populating it with the
records of the 2nd query so on & so forth.
Thanks,
Arpan Tag: Using sql reporting services in asp Tag: 316013
Request.ClientCertificate collection type mismatch
I have used simple asp pages to enumerate value/properties of the
Request.ClientCertificate collection like so:
For Each strKey in Request.ClientCertificate
Response.Write strkey & " = " & Request.ClientCertificate(strkey) & "<BR>"
Next
exactly as suggested in the MSDN documentation here (under the Sample Code
for VBS):
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/iissdk/html/2c81853d-3199-4013-9e3b-c921d64e549f.asp
That worked in W2k Pro sp2 ... last year, but I recently upgraded to XP Pro sp2
and now, that simple asp enumeration throws a VBS mismatch error:
Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch
/cryptoasp/clientcert00.asp, line 10
I need to explicitly convert to a string to avoid the error using:
CStr(Request.ClientCertificate(strkey))
When did this change occur??
Note that this explicit casting to a string using CStr is not required for collections
such as Request.ServerVariables
Thanks,
- Mitch Gallant Tag: Using sql reporting services in asp Tag: 316008
How can I avoid the windows authentication for viewing a report
Hi: Could anyone pls let me know how can I avoid the windows
authentication screen for viewing a report in Reporting Service. TIA
Zahir Tag: Using sql reporting services in asp Tag: 316007
How to split the contents of a page???
Hi,
Hi,
>
> I have a problem in the display of the ASP screen actually i am
> retrieving and displaying the data from a database when the view
button
> is hit.The contents for display is so long so i want to have a
previous,
> next link on that page so that some 100 records are displayed in each
> page.Pls help me.
> I am attaching my code here please help me where can i make the change
> to split the display of my page.
>
> This is for entering the couriers that is received in an company. Here
> fd=from date
fm=from month
td=to date
tm=to month
fy=from year
ty=to year
rpt=report
and this program displays the details of the courier
> received on the basis of the input
fdate-from date and
tdate-todate will be displayed.
> Please help me
>
> <%@ LANGUAGE="VBSCRIPT" %>
> <SCRIPT language="javascript">
> function CClr(oCmp, Num)
> {
> if(Num == 1)
> oCmp.style.backgroundColor = "#FFFFBF"
> else
> oCmp.style.backgroundColor = "#FFFFFF"
> }
>
> </SCRIPT>
> <html>
> <title>courier</title>
> <body>
>
> <%
> dim fd,fm,fy
> dim td,tm,ty
> dim rpt,stxt
> dim fdate, tdate
> dim branch
> dim toatalrec
>
>
> fd=Request.QueryString("fd")
> fm=Request.QueryString("fm")
> fy=Request.QueryString("fy")
> branch=Request.QueryString("branch")
> fdate=fm+"/"+fd+"/"+fy
>
> td=Request.QueryString("td")
> tm=Request.QueryString("tm")
> ty=Request.QueryString("ty")
> tdate=tm+"/"+td+"/"+ty
>
> stxt =Request.QueryString("stxt")
> number=Request.QueryString("number")
>
> rpt="N"
> dim cn, rs
> set cn = Server.Createobject("ADODB.Connection")
> set rs = Server.Createobject("ADODB.Recordset")
>
> //cn.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist
Security
> Info=False;Initial Catalog=mmpl;Data Source=mailserver", "it","it"
>
> cn.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist
> Security Info=False;Initial Catalog=mmpl;Data Source=aarServer",
> "it","it"
>
> if stxt=VbnullString then
> if branch="ALL" then
> rs.Open "select * from mmpl_in_trans where rpt_date>='" & fdate & "'
> and rpt_date<='" & tdate &"'", cn
>
> else
>
> rs.Open "select * from mmpl_in_trans where rpt_date>='" & fdate & "'
> and rpt_date<='" & tdate &"' and in_fn='" & branch &"'", cn
>
> end if
>
> response.write("<font Face='Arial Unicode MS'><B>INWARD ENTRY <a
> href='eml_in.asp'>back</a> <a href='..\mmplinout.asp'>Home
> page</a></br>")
> Response.Write ("<Font Face='Arial Unicode MS'><B>From : " & fdate & "
> to : " & tdate &" </br>")
>
> rpt="Y"
>
> else
>
> rs.Open "select * from mmpl_in_trans where in_details like '%" & stxt
&
> "%' order by in_fn", cn
>
> response.write("<font Face='Arial Unicode MS'><B>INWARD entry</b> <a
> href='eml_in.asp'>back</a> <a href='..\mmplinout.asp'>Home
> page</a></br>")
>
> Response.Write ("<Font Face='Arial Unicode MS'><B>Searched for : " &
> stxt &"</br>")
>
> rpt="Y"
>
> end if
>
> if rpt="Y" then
> response.write("<table border=0 > ")
>
> response.write("<tr colspan=0 onblur='CClr(this, 2)'
> onfocus='CClr(this, 1)'><th bgcolor=orange><Font Face='Arial Unicode
MS'
> size=2>DOCDT </Font></th>")
>
> response.write("<th height=5 bgcolor=orange><Font Face='Arial Unicode
> MS' size=2> BRANCH </Font></th>")
>
> response.write("<th bgcolor=orange><Font Face='Arial Unicode MS'
> size=2>DEPT </Font></th>")
>
> response.write("<th bgcolor=orange><Font Face='Arial Unicode MS'
> size=2>DETAILS </Font></th>")
>
> response.write("<th bgcolor=orange><Font Face='Arial Unicode MS'
> size=2>COU NO </Font></th>")
>
> response.write("<th bgcolor=orange><Font Face='Arial Unicode MS'
> size=2>COU DATE </Font></th>")
>
> response.write("<th bgcolor=orange nowrap ><Font Face='Arial Unicode
> MS' size=2> REC TIME </Font></th>")
>
> response.write("</tr><tr>")
>
> if Rs.EOF=False then
> Rs.MoveFirst()
>
> With Rs
> response.write("<td align=Center bgcolor='#A4D867'><Font face='Arial
> Unicode MS' size=2 >" & .Fields("IN_DATE") &"</Font></td>")
>
> response.write("<td align=Center bgcolor='#A4D867'><Font face='Arial
> Unicode MS' size=2 >"+.Fields("IN_FN")+"</Font></td>")
>
> response.write("<td align=Center bgcolor='#A4D867'><Font face='Arial
> Unicode MS' size=2 >"+.Fields("IN_DP")+"</Font></td>")
>
> response.write("<td bgcolor='#A4D867'><Font face='Arial Unicode MS'
> size=2 >"+.Fields("IN_DETAILS")+"</Font></td>")
>
> response.write("<td align=Center bgcolor='#A4D867'><Font face='Arial
> Unicode MS' size=2 >"+.Fields("IN_CRNO")+"</Font></td>")
>
> response.write("<td align=Center bgcolor='#A4D867'><Font face='Arial
> Unicode MS' size=2 >"&.Fields("IN_CRDATE")&"</Font></td>")
>
> response.write("<td align=Center bgcolor='#A4D867'><Font face='Arial
> Unicode MS' size=2 >"+.Fields("ENT_TIME")+"</Font></td>")
>
> response.write("<tr>")
> Rs.MoveNext()
>
> End with
> next
> End if
>
>
> End if
>
> %>
> </table>
> <input type="Submit" name="submitted" value="Next">
> </Font></pre></font><form>
> </BODY>
> </HEAD>
> </HTML>
>
> Thanks,
>
> Aarthy
>
*** Sent via Developersdex http://www.developersdex.com *** Tag: Using sql reporting services in asp Tag: 315994
serving XML
A site I regularly work on has, in its web root, a static XML file. This
XML happens to be an ADO persisted recordset with 0 rows, all of ~3 KB in
size. (Clients can open it, insert records, and then push the appended
recordset back to the server for an UpdateBatch, but that's not important to
this question.)
Everything works, however, during an analysis of the site's IIS logs, I
noticed that requests for this static XML have, on occasion, taken as long
26 seconds to be processed! The thing that's mind-numbing is that we have
an ASP script that gets requested 2-3 times more often, that, when called
with a certain parameter (that causes it to return last error details stored
in the session) has never taken more than a sub-second to process, no matter
how busy the server is!
This has led me to wonder if this XML is truly as static as I'd assume, so
my question is, does an xmlns attribute cause an implicit request, thus
imposing a dependency on a foreign site? Specifically, does
"xmlns:rs='urn:schemas-microsoft-com:rowset'" cause an http request to
schemas.microsoft.com?
Given that requests for ASP scripts are completing concurrently while a
request for this static file is being "processed", what could cause this
tiny little download to lag so badly?
I'm considering changing the file to an ASP, that sets content type and then
response.writes the XML from a string buffer, but I can't imagine how that
could be more efficient. (The server O/S is 2K3/IIS6.)
tia,
Mark Tag: Using sql reporting services in asp Tag: 315983
msxml2.serverXMLhttp and response.binarywrite
Question:
I get the eror listed at the bottom of the post. What can I do to
make the response of the x1.send a "binary" type? Or, in general,
how can I just "make this work"?
<%@ Language=VBScript %>
<%
Response.Buffer = TRUE
Response.ContentType = "image/jpg"
Set x1 = Server.CreateObject("Msxml2.ServerXMLHTTP")
x1.open "GET", "[http link to your favorite image.jpg]", FALSE
x1.send
Response.BinaryWrite x1.responsestream
set x1 = nothing
%>
Error is returned below:
'Response object error 'ASP 0106 : 80020005'
'Type Mismatch
'/scraps/getGraphic.asp, line 10
'An unhandled data type was encountered. Tag: Using sql reporting services in asp Tag: 315981
ASP/SQL Connundrum (kinda long)
Hey guys,
I currently have a giant client editor form in ASP/SQL. The form is
fine. The problem is that there are several sub-forms that store their
data in other tables. Which gets cluttered. For example, I can't let
users add data in these sub-forms until the main form is completed and
an autonumbered ID is generated.
We're taking a few months out of new developments to go back and fix a
bunch of things (like this), and I was wondering what the best way
would be (if anyone has run in to a similar issue) to allow a large
editor that touches multiple tables to have one giant master "Save"
button that validates everything and that doesn't make changes until
it's clicked.
Sadly, transactions are unable to span across multiple pages (and I
don't wanna store recordsets as session objects), and they wouldn't
work anyways, since in the event of new additions, I would need to wait
until I have that autonumbered ID generated before I attempted to store
anything in one of the smaller tables.
I was thinking of perhaps session variables that corresponded with the
names of the tables that I was working with that had an array of data
that corresponded with {fieldName} => "Value," and then loop through it
and validate it, then execute the appropriate SQL.
Cliffs: In ASP/SQL, does anyone know of some industry-standard way to
have one "Save" button store data collected through multiple pages,
assuming that in some cases, when adding a new record, we'd need to get
the value of the autogenerated "ID" field first before saving data that
affects other tables?
Wow... what an obnoxiously long question. If you're bored, feel free to
read through :) Tag: Using sql reporting services in asp Tag: 315979
Time Function returns Wrong Time
I am writing an ASP program that includes a Form.
When the Form is submitted I use the Date() and Time() functions to put the
date and time into the Body part of the e-mail.
The time reported is three hours earlier than the time at which the Form is
actually submitted.
I understand these functions are evaluated on the server so the server must
be in a time zone three hours earlier than where I am .
Is there any way I can get the local time at the location where the user is
actually located. ??
Thanks Tag: Using sql reporting services in asp Tag: 315977
Can perform task from a .vbs file but not from an .asp file! Why?
Hi
I had asekd previously a question qith regards to running a DLL file from
ASP. It was not running for me. Bo error returned, nothing, Just an empty
string (when it should have not been empty). I created a .vbs file and put
it in the same directory as the .asp file on the web. The same exact code.
It runs fine. Soon as I call the asp file, it still does nothing. Would
anyone have an idea as to why the .asp has no ability to run this dll?
The dll in question will create a folder within the same directory as the
calling file. I thought it could be a permissions thing, but after creating
a new dll file to test creating folders, it had no problem doing so
I am stuck as I am not sure what else I could do to make this run from asp
Thanks
Leo Tag: Using sql reporting services in asp Tag: 315970
response.redirect within frame set
I've inherited a web application that uses frames :-(
I have an ASP page (within the frame set) that I want to refresh the WHOLE
frame set
Response.redirect just launches the frame set again but within the current
frame, not as a top level item, so I end up with a frame set within a
frameset.
This must be simple to achieve, but a bit stumped by it.
Thanks Tag: Using sql reporting services in asp Tag: 315967
DetailsView & FormView controls using drop down lists
Hi,
FormView & DetailsView are great controls in the new version of ASP.Net, but
I am finding it tricky to display more than the record that either control is
bound to at the time. For these controls to be useful in any mode other than
read-only, we need the ability to populate controls like drop downs that hold
associated data, which in the DB represents foreign key related data. In
order to do this, do I create a template field that has a seperate control
that binds to a different data source pulling back the "lookup" data?
Thanks for any help in advance
Paul Tag: Using sql reporting services in asp Tag: 315948
Pages times out regardless of settings
Hi all,
I've written a page that uses a emailer component and it keeps timing out.
It takes 2-3 seconds to send each mail, gets part way through the list of
recipients and dies.
I have tried changing the Script Timeout setting in IIS to some huge number
(2147483647?).
I have tried setting Server.ScriptTimeout = 0 and Server.ScriptTimeout =
2147483647.
None of these make any difference. What can I do now?
--
Sean. Tag: Using sql reporting services in asp Tag: 315947
how to redirect 404 error to custom error page?
I want to know how to redirect 404 error to custom error page? For
example, if test.html doesn't exist and the user type
http://www.myserver.com/test.html, it will show my custom error page,
instead of the default "The page cannot be found" error page generated
by the web browser.
Please advise. thanks!! Tag: Using sql reporting services in asp Tag: 315941
Start/End Dates for a Week
If I know the week number and the year, how can I calc the beginning and
ending dates of the week?
For background I'm going to do some grouping by week but don't just want
to call the weeks Week 25, Week 26, Week 27, etc.
Thanks in advance,
J. Paul Schmidt, Freelance Web and Database Developer
http://www.Bullschmidt.com
Access Database Sample, Web Database Sample, ASP Design Tips
*** Sent via Developersdex http://www.developersdex.com *** Tag: Using sql reporting services in asp Tag: 315940
Password Encryptor/Decryptor for ASP 3.0?
Hi!
Im planning to encrypt the password that was stored on msaccess database and
also the text inputed from a password textbox. Also, if I want to get the
password from the database, I need to decrypt it so it can be comparable to
the one that is inputed on the textbox. Is there a way on how to handle
this?
MP Tag: Using sql reporting services in asp Tag: 315939
Triggering automated Emails
Dear All,
I need to send a set of Emails from my application (reminders) each month
1st. Is there anyway in ASP scripts to trigger an event to run
automatically? I have no dedicated server, so no DLLs or Scheduler scripts
can be used. Also adding the trigger script in the application object may
not send emails in time, as we have not enough visitors to that application.
Is there any way other than 'Clicking a Send button'?
Any support will be appritiated.
Warm Regards,
Benny Tag: Using sql reporting services in asp Tag: 315935
text file
Hello,
I am using asp classical and connection to SQL 2000 on a Windows 2000
machine.
I am using this code to generate a text file when the user clicks on the
link. This is so the user can download the file on an as needed basis.
DIM filename
filename = "Companies.txt"
Response.ContentType = "Unknown"
Response.AddHeader "content-disposition", "attachment;filename=""" &
filename & """"
The issue I am having is if the text file is less than approx. 1 mb then the
file downloads fine. If the file is bigger than that I get this error:
"Internet Explorer cannot download <the name of the asp page> from <the name
of the website> Internet Explorer was not able to open this internet site.
The requested site is either unavailable or cannot be found. Please try
again later."
I get my data here:
DIM rs, strSQL
Set rs = Server.CreateObject("ADODB.Recordset")
rs.CursorLocation = adUseClient
strSql = "stored procedure" & param1 & "," & param2
rs.Open strSql ,objConn ,adOpenForwardOnly ,adLockReadOnly ,adCmdtext
I then write it to a text file like this:
<%
Response.Write "CompanyName" & "|"
if not rs.BOF and not rs.EOF then
rs.MoveFirst
Do until rs.EOF
Response.Write rs.fields("Company_Name")& "|"
rs.MoveNext
Loop
end if
rs.Close
Set rs= nothing
%>
There are many more fields that are being returned but to keep it short I
only included one so you could see the layout of my code.
If someone could help me I would appreciate it.
If you need more information please let me know.
Thanks Gary Tag: Using sql reporting services in asp Tag: 315927
making a session-less app
hi
if i disable session state...
how can i identify the user session ???
and, assuming that i generate my own "session id" for each login
carrying it along the requests...
how can i, latter, release the session ?
remember that Session_OnEnd( ) don't work well all the time ...
thanks
--
atte, Hernán Tag: Using sql reporting services in asp Tag: 315925
Can i make us of the sql reporting services in asp? If so then how do i make
a call since what i know is that sql reporting services are available as web
services?