I'm terribly sorry if this has been asked before, but I need a clear explenation without having to sift through other bits of information.
Can somone explain how functions work in asp (not asp.net)? I need to call a function that returns a value, and I get an error when I have a return statement in there. If there is no "return" statement, then what do you use to get this value back?
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. Code:
I have implemented a logic for my requirement with a recursive call. The logic is I need to get IDs from database for a scenario. There are corresponding records for each ID.
I need to store these IDs in an array variable. Then I need to get (dependent)IDs for the fields in each ID. There may be morethan one dependent per each ID. I append these IDs to my array. Like this it goes.
The problem is if there are many levels like this, the number of database cursor count is reaching to maximum and I'm getting the error
{Microsoft OLE DB Provider for ODBC Drivers error '80004005' [Microsoft][ODBC driver for Oracle][Oracle]ORA-00604: error occurred at recursive SQL level 1 ORA-01000: maximum open cursors exceeded }
each recursive call runs a SELECT query.
Can any one suggest me an alternate solution for this ?
I'm very interested in finding out what ways you experts out there have made your data dips more efficient in your asp (not asp.net) code.
I have a wizard-type application that dips into the database with each page, I know there's a better way to do this out there, just pressed for time and can't think right now.
I need to implement an application that receives http calls from a remote client, do something with it and returns some feedback. I want to use IIS (version 6) as my front end http server (with https and ssl services) which will facilitate all the requirements of a http server and then foreword the incoming call to my application and will return the process result to the client at the end.
Does IIS support this? And if yes - what are the requirement from my application to use it (built in .net if anyone interested)?
I'm developing web surveys where users logon to a web survey and answer up to about 50 questions, one after the other, shown only one question at a time. The answers are saved in a database.
A fellow developer and I are discussing when is the best time to save the answers. We have two approaches in mind:
Approach 1: After each question is answered, the answer is saved in the database. Sessions are only used to store the User ID.
Approach 2: After each question is answered, the answer is saved in a session variable. When the user has finished the entire survey, all the answers are saved at once in the database. Also, if the user logs out, or if the session times out, the answers answered so far are all saved in the database at once.
The amount of actual data sent to the database is the same in both approaches, but Approach 1 have much more frequent calls to the DB, thus creating an overhead of opening and closing connections. I'm not sure how significant that is. On the oter hand, Approach 2 store a lot of data in sessions. I'm not sure how bad a thing that is.
Which approach is better and for what reasons? I'd be happy to supply more information if needed.
I am looking for a tool/product (commerical or shareware) to correlate classic ASP pages (not ASP.NET) with timings of ADO calls made from each ASP page. The information I am looking for are
T1, url = http://..../product.asp, DB Server=SQLSvr1, DB Name=products ADODB.Connection.Open 10ms ADODB.Recordset.Open 189ms ...
T2, url = http://.../search.asp, DB Server=SQLSvr2, DB Name=productindex ADODB.Connection.Open 15ms ADODB.Connection.Execute 350ms ...
It would be nice if the tool can automatically rewrite existing ASP pages if necessary.
This would be a good performance monitoring tool for classic ASP pages.
I'm using the following function, which uses a recursive call. every time when I get a conf it opens a record set. So increases the cusor count. Some times I'm getting the following error:
Microsoft OLE DB Provider for ODBC Drivers error '80004005' [Microsoft][ODBC driver for Oracle][Oracle]ORA-00604: error occurred at recursive SQL level 1 ORA-01000: maximum open cursors exceeded.
Any body know of a resource that compares/benchmarks the expense (in terms of milli seconds, or server load) of using various programing options?
I know a lot of articles and forum posts reccomend best practices between functions and programming options, but I would be interested in some type of definitive benchmark to decide between various prgramming options, depending on the need.
For example, I can call a Recordset and quickly write it into an array, so that the connection can be closed even before I write the data to the HTML page. This would save conection time and server resources, but I'd like to be able to judge the worth when considering coding it.
Every time I do a Server.Transfer how expensive is it to the server? How much am I loading the server with Session varaibles? If I store some info in a cookie, but have to call it, how long will that take? Am I using up server resources by creating large arrays?
I want to use the instr function, but return results from it depending on surtain functions, I can't realy explain so I'll show my example:
I have a string in wich some word I want to find might be in diffrent Capital Letters order, I want the Instr function to return all the values of the place of that word (avcourse I'll run a for and increase the starting point of the Instr func until it returns 0). The instinct thought is to use the Lcase or the Ucase functions, but in this case I don't know how to use them. In the same Idea I wanted to use the Instr Func with the trim Func, But Its realy the same principle if I just understood how to do so.
Function ShowXML(strXML,strStyleSheet) Set objXML = CreateObject("MSXML.DOMDocument") Set objXSL = CreateObject("MSXML.DOMDocument") objXML.load(Server.MapPath(strXML)) objXSL.load(Server.MapPath(strStyleSheet)) Response.Write objXML.transformNode(objXSL) Set objXML = Nothing Set objXSL = Nothing End Function %>
calling the function in an asp file <%Call ShowXML("http://msn.foxsports.com/feedout/syndicatedContent?categoryId=142","nhl/xsl/news/teamNews.xsl")%>
the errors 1. the http:// part 2. and the ? mark
the error message says that the path has been typed wrong.
I am using the now() function to be displayed on an email after a form submission has been sent. The problem is that the server is not in the same timezone as I am for the result. How do I adjust the hours on the now() to allow for this please ?
I know the basic difference between a subroutine and a function is a subroutine performs a task and a function performs a task and returns a value. The Call keyword is required when using parens with subs with more than 1 parameters. Parens around values passed are ByVal vs ByRef and is a waste of processing if passed ByRef for no reason. I am told there is no reason to ever use a subroutine as a function can be used even if it doesn't return a value. While this appears to be true, is there any reason why it's ever a bad idea to use a function, instead of a subroutine, that doesn't return a value? Are there memory, performance, etc. issues?
I am trying to locate information on how to call a sub within VBScript on an ASP page but I can't locate generic information. What I want to do is generate a page that will stay up but the information on it will change based on a series of drop down boxes. I need the first drop down box to call a second dropped down box based on the state that is chosen then city and so on.
I have a column in the table which contains 2 full names seperated by "&" (e.g: Joe Smith & Jeff Scott) I want to display only the first names of the whole record in an asp page. Is there an asp function using which i can do this?
im using the mod function to create a calendar for me, which everything works perfectly, all is totally well with that! but...when i use the mod function it churns out this loooooooooong string which is the whole table... if there is some way that i can insert hard breaks IN THE CODE ITSELF.
I used to be quite an experienced ASP programmer but I haven't used it for a while
I’m trying to do something that I remember as very simple I'm trying to check that the value of a form text box is numerical using the isNaN function. The code I am using is:
<% quantity = Request.Form("number1")
if isNaN(quantity) = true then Response.Write "Your input was not a number" else Response.Write "Your input was a number" end if %>
var str = "A" 'convert to ascii num = asc(str) Response.Write num ' 65 shows up 'when I have a whole string str = "hello" str = mid(str, 1, 1) ' return 'h' num = asc(str)
'I get an error:
Invalid procedure call or argument:'asc'What can be done to fix this?
I've an array to store alphabets, in my code...in a random order. How can i use the Asc() function to get the equivalent Ascii of each alaphabaet of that array.... whenever i use ,
for i = 0 to NoOfElements Response.write Asc("ArrayName(i)") next
it displays 65, "NOOfElements" times (ascii of A)...on the other hand..i can't write
Response.write Asc(ArrayName(i))
since this shows some error...How can i solve this?
Depending on some situations, I or the user, need to execute a function (e.g., login, sending email, etc...) and then continue from the original place. How can I make one function to be available from any page from my site?
I have a problem with max() function. The SQL is as follow SELECT max(group_no) as group_no FROM doc_groups. if I run the sql in MS SQL server, it will return correct result. However when I run in ASP file, there is no record return. I check with RecordCount property and it return -1.