there are various of loops but i am analyzing to use which one. maybe i could get some opinions from u all. there are
while wend, for loop, do loop
my situation is if i need 2 execute on a daily basis data on the particular month and will stop on the last day of the month.. without interseeing to the next month
can anyone might help me by suggesting on the suitable loop 2 use for this problem?
Attached is the code that I am trying to put together. Does anyone know how to loop (see bold text below) this so it will display all the data from the columns in this row? Code:
I am not sure how exactly to put this, but what I need to do is the following: taking into account that there are multiple URL's pointing to the same server
If url=blah.com do nothing if url=blah-blah.com *break out of frameset.
Now I remember there being an easy way to do this but can't for the life of me remember where to find it?
I was hoping someone would be able to explain the "For Each In Loop" set up.
What I'm really asking is when it can be used and how it is set up.
For example:
If I had something like...
Quote: For Each X in objSomeObject Response.Write X & "<br /"> Next 'X
How do I know I can use the For Each In Loop and what must I do to be able to use the X portion of it?
Sorry if this is a very general question but I want to understand how one can recognise when it is possible to use this structure and when it's not.
More background to this is that I'm going to attempt to use this structure on a listbox in .NET and possible ASP and I want to ensure that I loop through each and every item.
What I'm trying to do is match all buyer requirements in a database table to all available properties in another table. I then want all these matches displayed in a report with the buyer name followed by the relevant matching properties, this should occur until all buyers have been displayed with their matching properties.
The problem is that it only works correctly for the first buyer for which the correct properties are displayed, after that all I get is the buyer names without their matching properties... so it seems to loop perfectly the first time but from then on forgets about the inner loop! Code:
I want to find the next event in my sql database. To do this, I have a query in a while loop. I set a new DateTime variable to the current date and run the query, it checks to see if it found a suitable event, if not, I want to increase the day by one and loop again.
What I have is a recordset listing out a group of names. I've retrieved the field that lists the id numbers for the array and split them to a list. Then I want it to loop through the names listing trying to highlight the ids that need to be hightlighted.
What I am getting is my list repeats the names according to how many ids are in the array. So if I have 2 numbers in the array I see every name on the list twice and the two that I need selected.
I want the list to show the names one time with the correct names selected. What is wrong with this code? Code:
I have two 2-dimensional arrays (made by using GetRows()) What I need to do is:
Loop If Arr1(0) = Arr2(0) then do an update.... End if End Loop
Basically I need to compare each value in Arr1(0) to the values in Arr2(0) - if I get a match, I have to do an update in the database. What is the easiest way to do this .
I have some difficulty with deep inner loop. What I want is Eg
Product Category: Air-Cond
Company: ABC Address: 121, Time City, Malaysia.
Company: XYZ Address: 1, City, Malaysia.
Product Category: Fridge
Company: MAS Address: 2, Old Building, Singapore.
Company: SAM Address: 11 Kiosk, Malaysia.
Basically, the first the first loop is to get all product category and one by one insert into the second inner loop. But, I need another inner loop under the second one, which is to categorized by country. Code:
I have successfully paged through a recordset on my page using the .recordCount, etc. methods, the only thing is I have 2 independent recordsets looping on the page, which when there was not paging involved this worked fine, however now I need to span the results of BOTH of these across pages, I just cannot seem to figure out how!
I have one set of records paging fine, but the other either messes the page up, or shows on the first page of results and no more of the other recordset, etc.... so yeah that is basically the problem I am hitting, so I was just wondering is there any examples or ways you could tell me to do this??
I got a problem while running an application. The code for this is as follows:
aList = Split(strMsg,";") For nX = 0 to UBound(aList) strarry=split(aList(nX),"_") var_year=left(strarry(2),4) var_month=mid(strarry(2),5,2) var_day=mid(strarry(2),7,2) var_date=var_day&"-"&var_month&"-"&var_year var_time1=mid(strarry(2),9,2) var_time2=mid(strarry(2),11,2) var_time=var_time1&":"&var_time2 set rs1=conn.execute("insert into tbl_BackupfileInfo(Filename,Createddate,Createdtim e)values('" &aList(nX)&"','"&var_date&"','"&var_time&"')") Next
while runnig this application some times it works fine .But some times it giving an error
Error Type:Microsoft VBScript runtime (0x800A000D) Type mismatch: 'UBound'.
I have a table with four fields, ID (auto increment), question (varchar(200)), answer (Text), and shop (tinyint(3). When I connect to the database in an ASP page and write this code
but if I change the type of the answer field to type varchar I don't get the error but am limited in the length of the field's contents. I just also noticed that if I keep the type at TEXT and change the collation to ascii_general_ci I don't get the mismatch error but all the ' characters turn into ? characters? Oh woe is me.
I am moving a mySQL db from one server to another. My backup sql is coming from phpMyadmin and I am using another 3rd party db admin program on the server. I am copying and pasting this code:
After about 30 minutes of frustration I finally discovered what was causing a general 500 internal server error and to my surprise it was something I seem to always take for granted for its simplicity. A type mismatch error trying to compare a string to a numerical value, which is something that PHP has no problem or qualms with. However, this continuous problem continues to haunt me year after year and has brought me to tears with frustration. This is the line that raises the error:
nID = Request("ID") If IsNull(nID) Or IsEmpty(nID) Or nID = 0 Then .... (and so on)
In the past I've written a function 30 lines long that compares values by confirming value types of the variables first, but I would rather put a gun to my head than do that. Since there are obviously other bright PHP and ASP developers out there that constantly trip over this problem, I would like to know your suggestions or methods of working around this.
I am new to ASP programming and I am trying to get an existing website to work. I have created the following function to get the day:
function nrDate() nrDate = DAY(Date()) end function
But when I use the page it gives the following runtime error:
Microsoft VBScript runtime error '800a000d' Type mismatch: 'DAY'
I have googled the problem for hours but cannot find anything that may be helpfull. Does anyone have any ideas because this is getting quite urgent and I cannot move forward without this function.
Error Type: Microsoft OLE DB Provider for ODBC Drivers (0x80004005) [Microsoft][ODBC Microsoft Access Driver] Could not use ''(unknown)''; file already in use. /asp/PPLMain/memberpage.asp, line 10
and in my line 1o is RsMember.ActiveConnection = MM_connPPL2_STRING
This works before but then it went like this. Anyone can help?
I use Server.CreateObject("MSXML2.ServerXMLHTTP") etc to grab the content of another asp page. I want the other asp page to look like an xml document. So I set the header to text/xml with the line response.contenttype="text/xml" I set this on the calling page and the page that is called. When I view the headers with http://pgl.yoyo.org/http/server-headers.php it is still set to text/HTML. Also the browser displays the page as if it were HTML, not XML
I pass session variables in a querystring to another page, which increments an array and adds them to it. This had been working absolutley fine on my local machine and I uploaded the scripts to a remote server. Everything worked fine (and still does) on the remote server.
I then decided to try opening the script that receives the querystring in a popup with javascript window.open, to display the results in the popup instead of a full new page as before.
When I tried this I got a Type Mismatch on the receiving page. I hadn't changed any of the code in any of the pages apart from calling the receiving page with window.open, so I thought it just didn't like being called/opened that way. So I removed the window.open and went back to the old way - and I still get the Type Mismatch.
I couldn't see why it was throwing this now, so I downloaded the scripts from the remote server (which work fine) to my local machine and I still get the Type Mismatch on the local machine. I tried stopping and starting IIS and then rebooting, but to no avail. It still works remotely but not locally.
The mismatch is occuring apparently between the String I'm trying to add to the array and the array index (which is also a session variable): Code:
Like so many, I will preface my question by saying I'm a complete ASP noob. I am however very experienced with PHP/MYSQL so I understand the concepts, it's just a syntax problem. I have the following:Code:
sqlGroups = "select groupName from Groups where groupID = '" & rsParts("groupID") & "'" set rsGroups = Server.CreateObject("ADODB.Recordset") rsGroups.Open sqlGroups, strConn
response.write(rsGroups("groupName"))
This is resulting in a type mismatch error. rsParts("groupID") is from another recordset in the script, of type Long Int. groupID in the Groups table is autonumber, also of type Long Int.
I am currently taking a lot of web form information and compiling it into a word document for users to download; however, I want to be able to embed any attachments that they have inside the word document. The attachments are coming from a database and the office suite does not reside on the server. Does anyone know if it is possible to create a word document with embedded attachments for download.
Guys i tried this sqlstr= "UPDATE BorrowerTab SET BorrowerName = '" & strName & "', Email = '" & strEmail & "', Phone = '" & strPhone & "'"
I get the error [Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query.
I think the problem is i need to have a WHERE clause in my sql statement The thing is i dont know how to... Cuz the field is an auto number(BorrowerId)