Need To Use On Error Resume Next But Timing Out
I have a piece of code that i created. It actually works as it should. The only problem is the objrs2.update causes an error-duplicate primary key. However when i check the database it has done what it should.
I then tried to use on error resume next, but it keeps timing out and i do not want to extend the time limit. Does someone know how to get round this? Code:
View Replies
ADVERTISEMENT
I've a query on On Error Resume Next. I've explained what I understand for each case, I'm not sure that this is true.
Case:
1] Used in Function/Sub: will resume to the next statement in the
function or sub; but will not affect the error out side of the functions
2] Used at the top of the asp page: will affect all the page code and
will not affect the function/sub in the page at all.
3] Used in the page where ever required:?
View Replies
View Related
I put the On Error Resume Next command as the very first line in my ASP
pages, which may contain various inc files and sub-routines/functions, so
that I can try and stop the dreaded DB error messages displaying to visitors
and would-be hackers.My question is, does this one statement at the top of the page cater for all of the code that might be executed in the page, in the include files and in
sub-routines/functions or do I have to put the statement in certain places
as well?The reason I ask is that I'm sure if I get one of my include file names
wrong it brings up an error rather than going straight through and
displaying a funny page.I hope I don't have to put it in various places as I like to have this one statement so that I can flip back and forth between live and dev time and
having to go into 'x' amount of pages to flip between these 2 states would
be tiresome.
View Replies
View Related
My code works when the table is not found. But when the table is found it doesn't do the else part..Code:
Dim oConn
Dim oRs
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open "Store_Form"
Set oRs = Server.CreateObject("ADODB.Recordset" )
elseif campo = "txtAN_GEN" then
on error resume next
Set oRs = oConn.Execute("SELECT * FROM 00_MOD48")
If err <> 0 then 'If table not found
GetFieldValue = "00001"
else
GetFieldValue = "150"
end if
View Replies
View Related
I am using On Error Resume Next to allow my application to deal with errors accessing the database, i.e. if the DSN-less connection doesn't work then it tries the DSN connection and this is fine.
What I want to find out is how can i stop the rest of the page continuing after errors, in essence I want to cancel the On Error Resume Next statement after the database connection stuff is done so that errors will stop the page and I can debug them.
View Replies
View Related
Is there a way to avoid On Error Resume Next for:
cnn.Open strCon
SQL = "EXEC Customer @txtEmail='" & email_address & "'"
set rs = cnn.execute(SQL)
'On error resume next
rs("email_address")
'// This record does not exist thus throwing up an error. I could use On
Error to resume and then do this
'// If rs.eof or rs.bof
'//
.....But I hate this convention as I find debugging a problem. Is there a
better way?
View Replies
View Related
This has been puzzling me for very long time and no where has
talked about the scope of a 'On Error Resume Next' statement.
When we program ASP(.NET) pages then we usually like to let
ASP(.NET) stop at errors and report back to us. However there
are parts of our scripts that we know an error will be thrown
and we encapsulate that area inbetween:
On Error Resume Next
Err.Clear
'Try block
If Err.Number Then
'Catch block
End If
On Error GoTo 0
This is similar to the infamous try {} catch(e) {} blocks in
Java/C++, etc.
If we forget the last line 'On Error GoTo 0' then our ASP(.NET)
scripts runs over all errors thrown and we find it hard to
find bugs. So the big question is, does 'On Error Resume Next'
go out of scope when it's written inside a block
(eg. Function)?
Function Function1()
On Error Resume Next
'Our code
End Function
When the Function1 call returns, does the outside calling scope
automatically stays as it was (On Error GoTo 0)?
View Replies
View Related
I'm on the last piece of this project, when a user goes to this page "myfolder.asp" it shows the contents of their folder.
If they don't have one created yet, I want to give them a friendly message: "You have nothing in your folder!" , and continue with the rest of the HTML code, but then ignore the Repeat Regions and dynamic text thats inside the HTML.
Right now I have it woking if the table exists, it shows the records. If I delete the table, I have this message at the top of the screen and nothing else: "You have nothing in your folder!"
Here is the code:
View Replies
View Related
Can ASP resume download/ upload when uploading large files using ASP, like Download programs do? If so, can anybody point me to tutorial or a script I can start with?
View Replies
View Related
I did a program with allowed to user to upload an excel file and insert those data into the access database. I did the testing on xp pro and to upload abt 300 records took me less than a minute.
However, the computer which the program is to be located is using windows 98. So i dowlnoaded the free server thingy. The upload time for 300 records here took about 15 minutes. haha
Just want to know what makes the uploading time so different?
View Replies
View Related
Can ASP pull the time it takes for a query to be hit on a DB and returned?
I see outputs like :
"6 results, query took 0.24 seconds"
I know the "6" comes from a record tally, but how can I calculate the time?
View Replies
View Related
I have been tasked with producing a script that times the amount of time it takes to upload a file from client to server.Unfortunately for me, part of the spec is that the script must be written in ASP which is something I have about 30 minutes experience in.
I have been playing around with the script located at this address :
http://www.asp101.com/articles/jacob/scriptupload.asp
Which does almost everything I need, the only thing it doesnt do is tell me how many seconds/milliseconds/widgets it took to upload the file to the server (excluding time to write to disk once received)Can anybody point me in the direction of another script that can give me timings, or at least give me some pointers on how I can hack the above script to give me the data I need (I have already worked out how to get rid of the save to DB and user name option and this is now gone from the display page and the working scripts behind it)
View Replies
View Related
Is it possible to put a time counter on a page which say after 20 minutes will automatically terminate the session using the abandon function?
View Replies
View Related
I open a asp page where the user fills in some details in and submits the page. The form will be submitted and sent to a diffrent page, it will check and return whether the transaction was successful or not.
This is a timebound process the time starts as soon as the form get loaded. Suppose the time is 10 minutes so if the user fills in the form and submits the form. We would consider the transaction successful if we receive notificaton of the transaction being successfully completed within this 10 minutes limit, if it takes more than 10 minutes than we consider the transaction to be unsuccessful.
View Replies
View Related
I want to call a procedure 20 minutes after the page loads in vbscript. Could someone how to time the page?
View Replies
View Related
i need 2 files html as well as asp forms. pls help me with working code.
View Replies
View Related
I'm having a problem where I'm losing Session variables as soon as they've been set up. The user logs onto the system, the system sets some Session variables, and redirects to a menu page. The menu page checks the Session variables, can't find them, and asks the user to log in again - the second login is successful. Has anyone seen this before, and do you know what I should do about it?
View Replies
View Related
I have a small (half a meg or so of source, and a 2.5MB database, and a few images) ASP web app in place, and it's running fine except for the fact that occasionally people have session timeouts and are suddenly not logged in.
I've turned the session timeout in IIS up, but they still seem to get logged out in less than 15min, rather than 2 hours, as intended.
View Replies
View Related
I usually clean the session when the result page is presented to the user.
At this time, say an email confirmation was sent to the user and a pdf file
they can becdownloaded from the result page.
But if the user click the refresh or back button etc. for some reasons, they
pdf file is not available since it created on the fly when the request was
submitted.
So I am thinking about pull pdf file from database, but don't want the
database being hitted everytime the refresh button was clicked or the
requested is resubmitted.
View Replies
View Related
I am having a problem executing long running queries from an ASP application which connects to SQL Server 2000. Basically, I have batches of queries that are run using ADO in a loop written in VBScript. This works pretty well until the execution time of a single query starts to exceed some threshold, which I am trying to narrow down. I can typically run 2 - 10 queries in a loop, with the run time being anywhere from under a minute to an hour or more. Now that this application is being subjected to run against some large databases (25 - 40G), I'm having problems getting the application to continue beyond the first query if it takes a while to run.
I used SQL Profiler to try to diagnose what was going on. I can see the query executes to completion, but immediately after completing I can see an "Audit Logout" message, which apparently means that the client has disconnected. The query durations vary from 45 or 50 minutes to up to over 90 minutes. I have the ADO connection and query timeouts set to very large values, e.g. 1000 minutes, so I can't think its that. My guess is that there is some IIS setting or timeout that I am running up against and the connection to SQL Server is just dropped for some reason.
The configuration is
NT 4.0 SP6
SQL Server 2000 SP3
IIS 4.0
Explorer 5.5
I'm only running into this problem on the very largest databases we run against. The vast majority continue to function properly, but this is going to happen more often as time goes on the databases continue to grow in size.
View Replies
View Related
I got an error saying
Microsoft VBScript runtime error- Error '800a000d'
Type mismatch
/briansforums/default.asp, line 923
also another error called Code:
View Replies
View Related
# Error Type:
Server object, ASP 0177 (0x800401F3)
Invalid ProgID. For additional information specific to this message please visit the Microsoft Online Support site located at: http://www.microsoft.com/contentredirect.asp.
/CoxAxis/adminEditPage.asp, line 6
My code:
<%
dim self, pid, i, c
self = Request.ServerVariables("URL")
pid = Request.Querystring("pid")
set Session("pageContent") = Server.CreateObject("Scripting.Dictionary")
Set custObj = Server.CreateObject("NFIFunctions.ValidateField") Line 6
set psi = Session("pageContent")
set errDict = Server.CreateObject("Scripting.Dictionary")
i = 1
View Replies
View Related
i'm getting
Provider error '80004005' Unspecified error
admin/dbconnection.inc, line 4
what this is, it only started happening after i did a recent upload of my database!, i 've tryed uploading it again but the error still appears.
View Replies
View Related
Let me start by saying I'm fairly new to Asp coding. That said...
My ISP only uses AspSmartMail. I've created an online form that uses fill out, which is then e-mailed to the collector of the information and CC-ed to the person who submitted the information.
The error I'm receiving is this:
aspSmartMail.SendMail : Error 28 error '8004001a'
504 Invalid Username or Password
In my script, I've Dimensioned several items, as you'll see below, passing the authenticating username/password to the smtp server, but it's not working. I tried not passing the information by entering in the actual info without it being passed by the diminsioned items. This didn't work either. I of course verified that the username/password I'm usine is correct.
Can someone plase tell me why I can't authenicate? I would really appreciate any help that might be out there.
Relavant Asp code below:
-----------------------------------------
Dim smtpserver,youremail,yourpassword,yourusername,rem oteemail
'Edit these 3 values accordingly
smtpserver = "mail.smtp_server.org"
youremail = "yourname@smtp_server.org"
yourpassword = "password"
yourusername = "yourusername"
remoteemail = "email_address_to_send_to"
Dim ObjSendMail
Set ObjSendMail = Server.CreateObject("AspSmartMail.SmartMail")
'Config remote SMTP server info.
ObjSendMail.Server = smtpserver
ObjSendMail.ServerTimeOut = 35
ObjSendMail.SenderAddress = youremail
ObjSendMail.Password = yourpassword
ObjSendMail.Username = yourusername
'End remote SMTP server config.
'Config E-mail.
ObjSendMail.Recipients.Add remoteemail
ObjSendMail.CCs.Add Request.Form("Confirm_Email")
ObjSendMail.Subject = "Email Subject"
ObjSendMail.SenderAddress = "Confirmation-NoReply@smtp_server.org"
ObjSendMail.SenderName = "SenderName"
ObjSendMail.ContentType = "text/html"
ObjSendMail.Body = strBody
'Note - strBody is Dimensioned elsewhere in my script to build the HTML message body.
'End Config E-mail.
'ObjSendMail.Send
ObjSendMail.SendMail
if err.number <> 0 then
response.write("Error n° " & err.number - vbobjecterror & " = " & err.description & "<br>")
else
Response.Write "aspSmartMail has sent your message with this file as attachment : <br>"
'Response.Write ObjSendMail.Attachments.Item(1).FilePathName
end if
Set ObjSendMail = Nothing
---------------------------------------
End code
View Replies
View Related
i m getting this following error:
Compiler Error Message: BC30002: Type 'ODBCConnection' is not defined.
Following is my code: ...
View Replies
View Related
I keep getting an error when I try to run this update statment: [CODE]
INSERT INTO MYPosts ( IEname, country, server_name, LANIPAddy, license_ver, wrkstn1, wrkstn2, wrkstn3, wrkstn4, wrkstn5, notes, status, rdse, esc, eso, parent, , timezone, ) VALUES ( '" & lcIEname & "', '" & lcCountry & "', '" & lcServerName & "', '" & lcLicenseVer & "', '" & lcwrkstn1 & "', '" & lcwrkstn2 & "', '" & lcwrkstn3 & "', '" & lcwrkstn4 & "', '" & lcwrkstn5 & "', '" & lcNotes & "', " & lcStatus & ", " & lnRDSE & ", " & lcESC & ", " & lcESO & ", " & lcParent & ", " & lcTimeZone & ")"
I get the following error:
Microsoft JET Database Engine error '80040e14'
Syntax error (missing operator) in query expression
View Replies
View Related
I am trying to display data from three tables in an MS Access database. Here is my code:
View Replies
View Related
CDONTS is not working on my webserver. IIS 5.0 Windows 2000
I am using this code
<%
Dim objNewMail
Set objNewMail = CreateObject("CDOnts.NewMail")
objNewMail.From ="webmaster@test.com"
objNewMail.To = "***@***.com"
objNewMail.Subject = "Test"
objNewMail.MailFormat=0
objNewMail.BodyFormat=0
objNewMail.Body = "<html><b>test test</b></html>"
objNewMail.Send
Set objNewMail=nothing
%>
But it gives me error
__________
Microsoft VBScript runtime error '800a0046'
Permission denied
/test.asp, line 11
_________
I have also referred this Microsoft KB but no help....
View Replies
View Related
I'm trying to send an email with a list of people in the body of the email but when i ty to send the mail i get the error
Microsoft VBScript compilation error '800a03ea'
Syntax error
/admin/tr1.asp, line 124 do while not rsp.eofwmail is the body of the email.I'm completely stumped here. Code:
View Replies
View Related
I have a database driven (ms access) website which runs fine on my computer (win 2000 iis6). However, on uploading, some pages am receiving the following error
"An Unknown script error occured while processing your request."
......
View Replies
View Related
I am testing a new website I built on the actual server. My section for uploading documents seems to be giving me problems. Can someone help me please? This is the error I am getting:
Microsoft JET Database Engine error '80004005'
'c:logindatairb.mdb' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.
/login/insert.asp, line 28
I had this before: .....
View Replies
View Related
This New Company I'm with Sets their Default WebSite to a local Directory on "D" Yea I've been down the whole route reinstalling XP Pro,,, IIS 5.1 The .NET framework everything. Now I'm just frustrated.
What the Heck !! Theres a web project (C# ASP.net) in the solution containing many many some odd 19 or so projects. MSVSS is additionally in the picture to make things a little more complex. (I.E. the non web projects go elsewhere on the D drive) All I'm asking for here are the BASIC Settings to get my DEV environment and my IE to "SEE" this D:Web folder as Localhost. It worked for a sec. A very brief second. Then it was Gone. Specific ERROR:
Could not load type 'appname.web.Global'. Parser Error Server Error in '/' Application.
View Replies
View Related
My text file, dsn file, and asp page are all in the same directory on the web server.My problem is that I want the text file to be on drive U: (which is each users drive)When I do this I get the following error (even if I copy the dsn file to the U: drive):-
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Text Driver] '(unknown)' is not a valid path.Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.
View Replies
View Related