I need to create an ASP page that automatically queries my database once every hour on the hour. So, what I was hoping to do was just create an ASP page that constantly loops and never actually turns itself off. Within this code, it could check the current time and if it's the top of the hour again, my database gets queried however I have a feeling that my web host probably won't permit this.
So I was just wondering if this would work or if not, is there a work around? Worse case senario is I could create a visual basic application that sits on my desktop and just works off of there but I would prefer to develop this in a web based language such as ASP or .NET if possible.
I have an ASP page in which I reference quite a few ADO constants such as adOpenStatic, adLockReadOnly and they work fine but a reference to adUseServer comes up as undefined?
for eg strtext =" response.write ""hello world!"" "
now i have tried single quotes and double and both give the error Unterminated string constant reason i want this is so that i can write this line to a text file
or better yet "<%response.write "hello world!"%>" into a file and then save it as an asp page, and then open that page from my browser.
I have a table (MSSQL 2000 server) with a column called "Content" whose datatype is text. Now I'm trying to insert data into the table using a stored procedure. What is the ADO constant that I should use to insert value into that column? Code:
I have a quick question regarding a text field for inserting record, I have a page which inserts various fields including area code an phone number for a new record, however I am curious if there is a way that I can either make the area code appear with brackets around it in the text field which is sent so that the user does not have to type it in each time.
I was thinking I could concantenate the value i send in each time with brackets but am not sure what the syntax would b for this. or perhaps there is another way of doing this?
I am trying to resize images which have been retrieved from my database using 2 DLL files. I can display the images correctly but get an error message (Unterminated string constant) when I try to resize them.
Microsoft VBScript compilation (0x800A0409) Unterminated string constant
Here is my Query, It is slight incorrect: HELP.
newest_sql = "SELECT TOP 5 CatID, ContentID, DateAdded, Title, FeaturedLabel, NewestLabel FROM Content, ContentTypes Where Content.ContentTypeID = ContentTypes.ContentTypeID AND (((Content.Display)=1) AND ((ContentTypes.ContentTypeId)=4)) ORDER BY DateAdded DESC"
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:
select case code case "01" ups_desc = "OPTION1." case "02" ups_desc = "OPTION2." case "03" ups_desc = "OPTION3" case "07" ups_desc = "OPTION4" case "08" ups_desc = "OPTION5 " case "11" ups_desc = "OPTION6" case "12" ups_desc = "OPTION7" end select
I then have table called "users" which has the following id UserID Code
now the trick
I want to loop through the recordset of the user tables and populate a drop down where the code from the case and the user table are the same.
Something like
do while rs("code") = code <option> This then is populated based upon the loop(I have this code)</option> loop
i have 2 tables (A & B) with date records now i loop table A and then table B, the output will be table A in the front and table B in the back.how can i make the output show by date in both tables altogether? do i need to combine tables before but the number of records is over 100K which may spend a lot of processing power?
on my classifieds site i would like to create a simple ads system. i currently have the ads site made but need some advice.
on my classifieds site i would like to display the ads down the left hand side.
however i dont want to over display ads.
if there is not many items listed i only want a small amount of adverts shown on the left hand side. however if there is lots listed i would like quite a few adverts listed.
otherwise i would have a big list of adverts and only a small number of items listed making a big blank space on my page.
i am guessing this would have to be a loop or something.
the code i am using to show the text links is <%=adurl%>
I am using a for loop in one of my asp page. Could someone let me know if I can do the for loop as follow:
[code]<% for i = 1 to 5 %> my html code my html code my html code <% Next i %> instead of [code]<% for i = 1 to 5 Response.Write "<input name = 'id'"&i&" type='text' value = "&id& ">" Next i %>
im writing some script to add records to my db. but if a value thats about to be added exists, then dont add that record.for example: if i want to add 7 records to my db with the values 1 - 7, but the db already has 3, 5 and 7, then it should only add 4 new records (1, 2, 4 and 6).
i have a record returning all records form my db, and an array with the values i want to add. i want to loop through my recordset of all existing entries, then for each loop, start another loop to see if the value exists, and if it doesnt , then add a new record.
How to use the for loop or do while loop to create the age range from 10 -100 to let the user to select from the form object - list/menu by using asp? The coding below is just a concept. For example
Response.Write("<select name=""select"">")
for (a=0; a<101; a++) ( Response.Write("<option value=""" & age & """>" & age & "</option>") )
I'm trying to create a page where images are displayed based on an id in a sql table (basically its an unlit candle until a value in the id field exists). I'm not getting an error with my code below - but its not working right either. Code:
<% If rs("my_id")="2" Then Response.Write "<img src=""images/07.jpg"" width=""56"" height=""97"" alt="lit candle">"Else Response.Write "<img src=""images/UNLIT_07.jpg"" width=""56"" height=""97"" alt=""unlit candle"">" End If %> ...
Microsoft OLE DB Provider for ODBC Drivers error '80004005' [Microsoft][ODBC Microsoft Access Driver]Numeric value out of range (null) /database/data_entry.asp, line 90
Line 90 is shown below...
// count the total records by iterating through the recordset for (rsProducts_total=0; !rsProducts.EOF; rsProducts.MoveNext()) { <---- Line 90 rsProducts_total++; }
This is an access database, connected to via a DSN. Any help will be muchly appreciated! I'm stuck on this one.
I'm using three loops on a page and would like to set the loops individually to start at either 0 or -1 based on a condition. As an example, I would want the loop to start at either -1 as shown or 0.
I'm trying to give the variable sStart a new name on each loo
EG sStart1 = value1 sStart2 = value
however the following piece of code doesn't work
set oNodes=xml.selectNodes("/Project/Tasks/Task/Start" for each oNode in oNode sStart=oNode.tex response.write("<BR>" for i=0 to 10 response.Write(sStart(i) nex next
I've been coding now for around 3 years. A year ago, I inherited a forum from a friend who didn't have the time to run it anymore. It's an old, very old, version of the WebWiz template, much modified. So modified in fact that upgrading to a newer version is impracticle, the best I can do is add features that you'd expect a forum to have these days. Code:
Here's my problem (aside from the fact that I'm a newbie.) I'm using ASP to call an Access database with four separate tables. The first three are working perfectly. The fourth is a little more tricky. I'm pulling the information based on a registration number (entered via a form). In the fourth table, each registration number is listed multiple times with production information for each year and quarter. For example:
I want to use a Do While...Loop (print the information while the registration # is equal to the one entered) to print out the information for each entry. Code: