Function Return Breaking For Loop
Can anyone tell me why the funciton checkCode returning in the middle of the for loop breaks the for loop? ie. If I remove the section:
if checkCode("0011") = 1 then
response.write "<br />Passed submission of user code"
else
response.write "<br />failed submission of user code"
end if
from the code snippet below, then the code will successfully loop through and print out all the post var fields (there are in fact 4).
If however you leave this in, the function returning seems to break the for loop from continuing through all the other post variables after "user_code" Code:
View Replies
ADVERTISEMENT
How can i break out from a while loop or for loop in vbscript.
in jscript we can use break etc..
in vbscript how can i do it. can i go to statment.
View Replies
View Related
I'm trying to break this loop for 4 different contacts to be inserted into the system.
For new inspections I want to be able to search the DB for the Owner, User, Contractor, and Cert_Recipient for new boilers the certificate will be mailed to the contractor which will be the Cert_recipient first.
then for annual inspections I want to be able to search for Owner, user, and Cert_Recipient for annual inspections I will have to search the DB for either the owner or User as the Cert_Recipient
For some apparent reason I can't stop the search, it keeps going thru the loop. I must be missing something. Code:
View Replies
View Related
When should we use 'return' in a function to return the result versus 'FunctionName = result'
View Replies
View Related
Code:
function findcinemaid(nameofthecinema)
findcinemaid = "select cinemasid from cinemas" &_
" where brand = 'tgv' and cinemaplace2 like '"&nameofthecinema&"'"
set cinemaidfound = objconndb.execute (findcinemaid)
optainedcinemaid = cinemaidfound("cinemasid")
end function
tgvcinemanamexcel = "[1u_f$]"
cinemaname = "ONE UTAMA"
findcinemaid(cinemaname)
response.write optainedcinemaid
if I put response.write inside funciton it will display the cinemaid properly but if I put it outside , it wont display
View Replies
View Related
im trying to create a function that accepts a sql statement as a parameter,
makes a db connection, returns a recordset, and inserts all items from the
recordset into a data dictionary - then i want to set the value of my
function equal to my newly created dictionary of items from the recordset -
this is where im having a problem. is it possible to set a function equal
to a dictionary? i cant seem to make this work and it seems that this
should be possible.
here is some sample code:
View Replies
View Related
i am trying to write a function which will add an entry to to a table in my DB
and then return me one of the values of the newly added entry.
For e.g. I use the function to add a new Order Entry into the DB, but i would also
like the function to return me the value of the OrderID field for the new entry. Code:
View Replies
View Related
I need a VB function to return array of collections like
Private Type Employee
empname as string
address as string
salary as integer
deptno as integer
End Type
dim employees() as Employee
Public Function getEmployees() as Employee()
getEmployees=employees
End Function
I will call that function in ASP.This was not working any other method is welcomed.
View Replies
View Related
is there a way to 'force' ASP date function to return date in a given format; I mean, my need is to force 'date()' function to give me system date in italian format instead of english (O.S. is in english as well as locale settings for IIS anonymous user); is there a directive or something similar to put in ASP code?
View Replies
View Related
I am trying to loop around a split and the code I have is below:
response.Write("<tr>")
response.Write("<td class=""tableHeader"" valign=""top"">Keywords</td>")
keywordsSplits = Split (keywords, ", ")
For each keywordsSplit in keywordsSplits
response.Write("<td>")
response.Write(keywordsSplit)
response.Write("</td>")
Next
response.Write("</tr>")
The problem is that it does actually put the seperate keywords into seperate cells (td's)
I get the following:
<tr>
<td class="tableHeader" valign="top">Keywords</td>
<td>test test1 test2 test3</td>
</tr>
I actually want
<tr>
<td class="tableHeader" valign="top">Keywords</td>
<td>test</td>
<td>test 1</td>
<td>test 2</td>
<td>test 3</td>
</tr>
Can anyone help?
View Replies
View Related
I have a string --> 7,8,9,10. This string may contain more or less than 4 numbers.
I want to separate each number and run an sql query for each number.
for example:
select * from table1 where code = '7'
select * from table1 where code ='8'
and etc....
Can I do this in a loop?
View Replies
View Related
Im new to ASP.NET as well as classical asp. To become strong in .NET, should i learn vb verywell (because im relatively new to it but it doesnt look that foreign working with vbscript) or the .net framework such as classes and server controls?
View Replies
View Related
I am wondering if any body can guide me on how to break up a string so that i can use the first letter as a querystring.
View Replies
View Related
I need to break out of the frames in the following line, or a line that does a similar thing:
Response.Write("<meta http-equiv=""Refresh"" content=""2; URL=http://localhost/MyWeb/Loanerz.asp"">")
View Replies
View Related
I have a string of text which I have managed to seperate with commas
e.g. test,test1,test2,test3,test4
if anyone knew how to split this up into individual words. so i can write them to a databse.I have been stuck on this.
View Replies
View Related
I am trying to merge 2 strings together from the database to create a meta tag. It comes up as
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="description" content="Looking for Architects in NY? Click here for Architects in New York."><meta name="keywords" content="architect, local, builders, home design, remodelling, construction, Albany County, Albany, Colonie, Saratoga County, Rensselaer County, Troy, Schenectady County, Schenectady, Montgomery County
">
It works fine, however the the last "> breaks off to the next line which shouldn't be happening. I tried searching for "<br>" and chr(34) (the carriage return),but there's nothing.
View Replies
View Related
I have a script that allows you to edit an html page (the html being stored in a database). The problem is that any characters in the html disappear when viewing the page for editing. Is there some way to escape them?
View Replies
View Related
I would like to prevent a page from breaking out of it's iframe when indexed by a search engine. I would like to use asp (which I am just starting out in) and I know it is somewhere along the lines of "yourframespage.asp?id=pageid".
Can anyone give me a rundown of how I do this exactly because I cannot seem to work out how to do it.
View Replies
View Related
The login state in my site relies on a combination of session variables and encrypted cookies. Some of my users are reporting that they are being "logged out" by the system - which seems to be related to their cookies being blanked out. I've checked all of the code and now that it's not being overwritten by my ASP.
The weird thing is that my site has two domain names, both pointing to the same pages and directories (no redirect). If this problem is happening to them and they switch to the other domain name and log back into the site, they stay logged in no problem. It also seems to not recur if the person is "logged out" and then logs back into the site on their own.
I had one problem like this in the past, because I had a tracking cookie that was being written on every page, and found that some browsers (don't remember which) had a limit of how many cookies could be written - and when they hit the limit the oldest cookie was tossed out. However, I don't have any code doing this now.
Anybody have any ideas what could be going on? Are there any session variable/cookie limits on the server side?
View Replies
View Related
Is there any way that I can break up text in a text field to spread across multiple fields in an access database? I've got a FAQ section that I want admins to be able to edit via an online interface. Unfortunately, it often doesn't fit into the 255 character restriction that access has. Any ideas?
View Replies
View Related
I skinned an LMS (Learning Management System) using CSS and Javascript. The forms were skinned with niceforms.js, the site works perfectly in FF, IE 7 and IE6 but in ASP the javascript doesn't replace the images with the skinned elements. All the javascript functions initialize but the images are not placed in. Code:
View Replies
View Related
I'm trying to pass a parameter from a for loop to the nested while loop
but only the first counter is passed. Here is the code:
View Replies
View Related
I have a recordset that I loop through all of the data within a table, within the same loop, I am trying to add another loops that pulls information from the first recordset to base the second recordset off of: Code:
View Replies
View Related
What's the difference between private and public functions in ASP? When should I use either?
View Replies
View Related
I updated to aspx last three month,after developing serveral
applications,Idecided to downgraded to asp, following is my reasons:
1.in ASPX,the page format is hard to control,in ASP u can change every html
as u like ,but in aspx, a aspx control decide the page format,and its hard
to change the format.
2.ASPX is said to be faster that asp, but it is based on too-often
communication back to the server,for example,u click a radio a button,there
is new page request, but in reality,such a communication is
bandwidth-consuming and time-consuming. the user only need to submit the
form, and the exchange between IE and Server was minimazed.
the Speed of ASPX is not useful for most sites, for bigger sites, the speed
increase is singnificant,but for small sites with less traffic, the speed of
ASP is quite enough.
3.ASPX is based on Object Orinted Programming, but in most small sites,
Procedure orinted programming is used, we never build objects, and POP is
more efficient.ASPX is for three-tiered structure with a single layer of
business logic component, but in reality, most of us used two-tier
structure,that is Presetation layer and Datalayer, we can layout the page
and change the database in a single page, quite effienct too.
View Replies
View Related
I want to return a 404 response from an ASP script (IIS 5).
Response.Status lets me set the response string, but if I don't include any
HTML text myself, the result is an empty page.
Is there a way to 'redirect' it to the server's default 404 response, as if
the URI really doesn't exist, but without really redirecting it so the URL
isn't replaced in the browser's address bar?
View Replies
View Related
I am trying to replace a huge chunck of code that currently I incorporate
with an #Include directive. The program rarely has to flow through that
code, so I thought it would be better if I used Server.Execute.
I found I can pass data TO the called asp file by creating an HTML <input>
and erading it after I get there.
However, I also need to read back ONE variable that the called file must
set. I cannot figuer out how to do that. My backup positions are (1) I can
keep on using the #Include technique, and (2) I can use a database to bridge
the gap.Isn't there a way to carry data BACK TO the calling asp file FROM
THE CALLED asp file?
View Replies
View Related
I am using a stored procedure to insert set of values to a table.I am generating or calculating the value of the primary key and inserting that record and i need that value to use in my application so is there any possibilty to return a value from storedprocedure to asp application.
what i am using to do is creating a #temp table and inserting that value in the sp and then opening that value in the asp application and droping that table, but i hope it is not a efficient method.
View Replies
View Related
When a user logs in, I want to redirect them to the page that they were previously on. How do I do that? I already have the login page working. I just need to edit the redirect part.
View Replies
View Related
The code bellow functions well. However if I want to obtain a return
value using the code bellow, how is it done? Code:
View Replies
View Related
I am using a simple guestbook /portal and i want script to send mail to the thread owner when someone reply his message.
this is the send message code ....
View Replies
View Related
I'm assuming this can be done, but I can't seem to get it to work... I'd
like to easily return a single value from a sql statement, something like:
"intNewItems = conn.execute "SELECT COUNT (ItemID) WHERE ItemDate = Date()",
where conn is the connection object, etc. What am I getting wrong?
View Replies
View Related
There is an access database and asp page .That asp page opens connection with that database,And opens a recordset online..
Is there any way that this opened recordset can be returned to Vb6 application which requested that Asp page to open connection and recordset and return some result.
View Replies
View Related