Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    ASP




Handling Dates


sql = "SELECT * FROM Calls WHERE Date BETWEEN " &startdate& " AND " &enddate

Where did I go wrong?????????????

Ugly response:

Microsoft OLE DB Provider for ODBC Drivers (0x80040E10)
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
ASP Handling
I have been trying to find a script on the net that would allow me to handle directory listings through ASP. I'm basically looking to change the default generated pages when browsing directories. Eventually I would love to be able to change which directories/files show based on permissions and be able to allow uploads to current directory listings.

URL Handling
I am attempting to use url's on a database driven webpage - the url's are really ugly (created by mapquest) - I have tried to put " quotes " around the urls in the database as well as without - but all i get is a blank about page, can anyone help.

Here is my code:
<td><a href="<%Response.Write(rs("Directions"))%>" target="_blank">Directions</a></td>

Error Handling
how do i do error handling using asp...

liek taking an example i am getting this error on trying to save a record twice whihc has a primary key constraint:

Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship. Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again.

how can i handle such cases and where do i place the code???

Error Handling
I have made the Error Handler in all of my asp pages, and I also includes some codes to automatically send email to me specifying the error occurred, in which page it occurred. However, I am trying to include the line number, but no luck... anyone know the code to get the error line number..?

Exception Handling
I have a piece of code which causes an exception. Now i don't know why that is. I would like to know the best way to debug the exception.

I know about try and catch statements. However with these you need to have a basic idea of the type of exceptions that could occur. Does someone have a better suggestion on how to debug an exception?

ASP Date Handling
I’m trying to write a script that will select some records from an Access database within a certain date range one of the fields is a date. Code:

Error Handling In ASP
I want to error handling in ASP. But i think that ASP is not enough for
error handling. I have got two chance.
1. I can prapare an error page and control throught IIS.
2. I can use on error resume next.
For 1. This is a general handling. I want to handle local error. Maybe i do
special thing when error occured.
For 2. I have to write alot of lines code. I have to control every line.

String Handling
if I have two strings as follows :

"1,3,45,65,777,89,00

and

"8,9,67,54,89,23

The numbers represent a predefined access permission to a certain file.

I need a function to sift through the first string, and compare it to the second string. What numbers are located in the second string, which are are located in the first string need to be removed (from the second string) leaving only unmatched numbers beind.

Error Handling
how can I display my own message instead of the error message which may appear in the explorer? , and can I use ASP code in this message?
Iam looking to display a custom page when somebody type a URL for a page in my site, and this page is no longer available

like: http://www.site.com/me.asp

and me.asp is not available

ERROR Handling
I have written a script on an include page which pretty much will write all the required ServerVariables and session variables into a string and email off to me incase a page happens to error out.

I have the code working as I want it to using the folllowing:

If Err.Number = <> 0 Then
'RUN INCLUDE
End If

My issue is, where do I include this on the pages? If I put it at the top will it only run if there is an error at the start of the page or will it be assigned no matter how far down the page the error exists.

Or do I need to put in On Error Resume Next at the top then put the include at the bottom?

Array Handling
how use the array handling in asp

Error Handling In Asp?
Is there a possiblity that, when an error comes in asp page in server, especially with sql script, to hide that error from user and display just Error, report to admin,

i just want to make a general case where when an error comes i should take the page to report to admin.

String Handling
im following all single quotes as follows:

email = request.form.item("email")
email = Replace(email, " ' ", " ' ' ")

so as not to crash my database. Only problem is, when i take a value out of the database it now has two quotes instead of one (example Linda D'Agostini --> Linda D''Agostini)


Handling A String
i want to create a long string and save it inside rs("history")
what is the best way to save texts every action. with comma(,) in the end?
and how when i want to view the list i will be able to add <br> after every comma in order to view this all list normaly?

Error Handling
I have an error handling routine that emails me the Err.Source, Err.Nbr, and Err.Description in the event of an error. How can I include the line number of the error as well and the filename?

Error Handling
I'm capturing errors using ON ERROR RESUME NEXT. VBScript's default error
object works fine but lacks the file, line, and code that the
Server.GetLastError function gives you. Unfortunately, I can't get the
Server.GetLastError to work properly.Simplistic code:

if err.number <> 0 then
Response.Write err.number & " - " & err.description & "<br>"
end if

this works fine. If I use:

dim oAspErr
if err.number <> 0 then
set oAspErr = Server.GetLastError
Response.Write "Description: " & oAspErr.Description
end if

the only output I get is the word "Description:". Can someone shed some
light for me?

Event Handling,
Can you please help me with event handling (for eg: capture key press, mouse overs, mouse_over drop-down menu, on_click drop down box) in asp.

Exception Handling
I am using global.asax to handle my web application exceptions and have
configured it to create event log entries for errors that occur and to
display an error page advising the user to contact the helpdesk.
I have an intermittent uninitialised object error that I am not able to
reproduce in test and for which I really need the source line number.
I believe this information is contained in the PDB but am not sure if one is
created if I set the debug="true" flag in the compilation part of the
system.web section of the web.config when the application is recompiled.

ASP Event Handling
I want to handle events of the AO Connection object in my ASP page. How can I do it?

Error Handling
I have just got back into ASP development after a years break and am playing catchup. I am developing a simple page with combo boxes on it, so that when it is processed it searches a database for all records between the chosen entries in the combo boxes.

However I am also trying to stop the page from returning errors when a user clicks submit without choosing any entries from the combo boxes. I am trying to get the page to just re-display itself with a simple error message on the page informing the user that they have to choose an option from both combo boxes.

Handling Spaces With Sql/asp In A Url
I have written some code to query a database and create a hyperlink based on a value, however, if the value comprises of more than one word, the hyperlink only references the first part of the value. e.g. For instance, if the value retrieved is "the strokes", the hyperlink will only contain the word "the".

Here is my code: ....

Error Handling
i am coding in VBScript. i am coding for an online survey. for error handling (eg if the user forgets to fill out a field), is it possible to ensure all fields have been filled out BEFORE clicking the submit button? i wish for the user to be notified via a MESSAGE BOX, how would i go about this(using VBScript)?

Handling Questions
i have a scenario where i have to serve users of my site questions on daily basis,but before they can answer a question they must answer a previous question correctly served previously before the current day .

This means to me that i have to keep a log of each questions served each day and users response whether they attempt the questions or not .i am scared to keep a scenario of a million users each day,their actions on a particular questions.what is the smartest way to achieve this.

Handling Of COM Exceptions
We are interfacing an ASP page with a COM object. In the COM object, if there is a condition that makes it not possible to perform the requested action, an exception is raised that can be caught by the calling application.

When an exception is raised by the COM object during the processing in the ASP page, the processing seems to lock up on the ASP side on the line of the function call that raises the exception.Has anyone else ran into similar issues? If so, how can we work around them?

Error Handling
Just a quick question about making a custom error handler. Can I use. Code:

<%On Error Response.Redirect("error.asp")%>

instead of defining a custom error page in IIS? My site is hosted by an ISP so doing the latter would leave me completely without error messages; my way I could comment out the On Error code when debugging.

Error Handling
I am calling some stored procedures from ASP. These strored procedures have to deal with lots of deletes and updates. So i have thought of implementing transaction commits and rollbacks.

But if a rollback occurs in these stored procedures, i want to get a value back to asp page, based on this value i will run the next stored procedure.

Error Handling In ASP
How i can handle the errors in ASP. Please suggest something.

Error Handling
I am facing some problems for the database query.

Error Type:
ADODB.Field (0x800A0BCD)
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record. How to do the error hanndling, if certain record cannot be found in the database? If possible, please show the coding.

Handling Concurrent Users
I have an issue with handling concurrent users in asp page.
The server is win 2003.

Asp page calls a dll developed in vc++ for displaying reports from oracle database.
Application works fine for less than 10 users .but it fails with object cannot be intialized for more users.

I tested the same application in my m/c for load testing it supports 50 users without problem.

Iam wondering any settings at IIS or OS needs to be checked for supporting more users.

WDDX And Error Handling
I am am using WDDX.Deserializer.1 to parse some XML data to display on an ASP page. Occasionally, I get an error like this:

Microsoft VBScript runtime error '800a01fb'
An exception occurred: 'deserialize'
/includes/sidebar.asp, line 25

Line 25 is:

set MyRs = MyDeser.deserialize(content)

I would like to set up some error handling so that if this error occurs it will display a custom error message rather than this one. Right now this message occurs near the top of each page on the site, in effect crashing the whole site. How can I test this to see if an error will occur?

Paging Error Handling
I inserted an error handling code for the code bellow. What happen is
the page is taking a long time to load. Upon loading it takes me to
"page not found" of microsoft internet explorer. How do I solve the
problem? Code:

Session Handling Problem
I have problems in handling sessions. ( HTTP: 500:100 error ) While I was accessing web pages from a local IntraNET based web site I encounter problem. I have checked the cookie setting it was set as per requirements Here is the code:

<%
Session("test")="testing"
Response.Redirect "session2.asp"
%>

session2.asp

<%
Response.Write Session("test")
%>

does not display anything. I'm using IE ver 5.0 and above on Windows 95, 98, NT, 2000 Pro, 2000 Server, and XP I have problem with NT, 2000 server and on XP

Note: I was able to access the same pages on machines running 98,95, 2000

Custom 404 Error Handling
When a user tries to visit a non-existant page in our web site they receive a custom 404 error message. I want to capture the URL the user tried to visit. Does anyone know where I can find this string?

404 Page Not Found Handling
actually i am doing php and know how to handle 404 error page not found errors but one of my client needs it in ASP and i am not that much faimliar with ASP. so i need some help if some body could give me code to handle these broken links .

actually it has to be done like this that if user clicks some where on the site and that page does not exist so the programme should take him/her to a page where message will show e.g 'this page doesn't exist'.

Handling Null Data
The chunk of code:Code:

c1 = rs1.fields("field1").value
If c1 = null then

response.write "no data"

else

c1 = replace(c1, "'","'")
c1 = cint(c1)error '800a005e'
Invalid use of Null: 'replace'

this mean that eventhough the data is null, it ignores the 1st condition of the IF

End Of File Marker Handling!
Ive encoded some HTML to a text file, and annoyingly its putting a small strange squre symbol near the end of the file. After some searching on google I found out that this is the "end of file" marker for a text file. What is strange is that this marker isnt actually at the end of the file that I am reading, because the file has been encoded from a webpage.

This is making handling the text in the file very difficult, because it gets confused when it finds more text after the end of file marker:

Microsoft VBScript runtime (0x800A003E)
Input past end of file

If I remove the end of file marker "manually" the script runs fine...and if the end of file marker is moved, again manually, to the end of the file, the script works fine....its just when its part way through the file...

Apparently &H1A is the symbol for an end of file marker, but if i use something like:

Replace(server.HTMLencode(targetfile), "&H1A", "")

it gets very confused, and doesnt seem to work. Any ideas?

How To Perform Error Handling In ASP?
how can i put the error messages in HTTP 500.100 - Internal Server Error - ASP error page in a nicer way so that it suits my web design.. ?

Recordset Handling In ASP Program
I'm selecting data from an oracle table into my recordset in ASP program. The program reads all the data from recordset until end of file and then again move the record pointer to beginning by using 'MoveFirst' command.

The program works fine if there is less data in the record set say 15-16 records. The moment the data exceeds 100 records, it fails to get data from te record set after 'MoveFirst' command. In other words the data from the recordset is lost after 'MoveFirst' command.

Handling Apostrophes And Other Characters
Been a while since I've done any asp coding, but happy to be getting back
into it. My question is what is the best way (now) to handle apostrophes
coming in from forms and going into the database? I remember I used to use
a replace function replacing single quotes with two single quotes in one of
my old apps.

Is this still the best way, use this function on all fields I
think an apostrophe may come in, or on all fields? Or should I use a
javascript regular function (which may not even work due to a client
disabling this feature on their browser)?

Handling Ref. Integ Error?
Is there an elegant way to check for the REFERENTIAL INTEGRITY VIOLATION in Access via ASP. The reason I ask is that if the user attempts to refresh the screen after implementing an INSERT he will be trying to insert an identical record which thows up the following error (below).

I could place On error resume next before but I find this dangerous or am I overworrying. I could preface the insert by doing a check for the record but this creates longer code which warps my anti-debugging frame of mind :) - is there a better way? Code:

Better Way Of Handling Errors Than Err.number?
Is there a better way of handling errors than err.number, err.description and err.source. What i want is to be able to get the line, file etc that you get in the error message when you dont trap for errors so that i can email it back to myself whenever an error occurs.

Handling Unload Of Page
I have a page where user can enter data, which will be saved in the database. I want to handle the closing of window, by clicking on the 'X' of IE. The user should be Displayed a message asking him if he wants to save the data. If yes then submit the same page to save the data and then close the page, else close the page.

I tried to use the 'OnBeforeUnload' event but not able to submit the page while closing. if this can be done. Please send me links useful in this context.

Easy Date Handling
I'm working on a system that requires alot of date handling, and i'm getting pretty tired of doing custom calculating when modifying dates, so i hope someone would be able to help me. Is there any easy way to do re-calculating of dates? such as adding 2,11
or 36 months to a date, and have it automatically checking whether or not it should increase months or year, and by how much?

Like, if i have to add 11 months to the date right now, i have to check which month it's in to see whether or not i could just take one month lesser the next year and so on.

XML HTTP Error Handling
I currently use this for my error handling in XML HTTP... Code:

On Error Resume Next
If NOT xmlHttp.readyState = 4 then:xmlHttp.waitForResponse = 5:End if
If err.number then
response.redirect("error.asp?error=2&pg=" & Current_page_URL)
else
If xmlHttp.Status <> 200 OR NOT xmlHttp.readyState = 4 then
response.redirect("error.asp?error=2&pg=" & Current_page_URL)
Else

'content here (no error)

end if

But when the site I am gathering data from is down, then I get an error saying that It cannot connect to the server. How can I error handle this error?

Page Access Handling
Supressing the "Save password" prompt: Are there any good approaches to keeping a password from being stored client-side if auto-fill is on? Ideally I'd like to supress the prompt. The only other option I can find is to use a timestamp as part of the form name and pass it (the name as well as the value) in a hidden field to the login script.

Unique concurrent logins: Are there any good ways to prevent userX from being logged in from 3 different locations simultaneously? -I can code for a 'logged in / out" field, but that relies on the user actually login out. And if I use a variation of the "who's online" approach the user may have to wait until the seeion expires befor logging in again (suppose thier net connection dropped for a moment and they need to get back online) - At least I think this assumption is correct.

Handling Highres Images
I need to upload a bunch of high-res images for our users to download. I will do that with FTP. However, being lazy, I don't want to create thumbnails and links to every high-res image. It could be hundreds. Is there software out there that can read a directory, create thumbnails and links on the fly? What's the easiest way to accomplish this?

Handling Multiple Forms
i am trying to build an online test that records user input one question at a time. So each question is a form by itself. I want to make a single ASP file that will validate all the form results and write it to a database. How can I know which form is
calling the ASP file?

Also, there may be multiple users accessing the quiz at the same time. Do I have to do anything special for such a case?

Anyone Known A Good Form Handling ASP Script!
Since my efforts to get my current script working are not working out. Does anyone know of a good ASP form handling script that can work with my HTML form.

Error Handling A ICMP Ping
I am having trouble, with Error Handling.. I have a ICMP ping utility in VBScript, it works fine if there is a proper reply but will create an error if the IP or DNS name is unknown, Can someone look through the code and see if theres a way I can catch the Error and display say "REQUEST TIMED OUT" Code:


Copyright © 2005-08 www.BigResource.com, All rights reserved