Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 10th, 2005, 07:54 PM
Registered User
 
Join Date: Nov 2004
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default update qry to run on page load

I am looking to add an update qry to the asp page below, so that the update qry will run when page is refreshed.

the current code likes like

<%
Dim adoMyRecordset
Dim strSQL, strSQLWhere, strSQLSort, strSQLCount, intRecordCount, strSQLWhereUrgent


strSQL = "SELECT qryUpcomingCases.ClientID, qryUpcomingCases.CourtDateFull,qryUpcomingCases.Ca seID, qryUpcomingCases.CourtNameShort, qryUpcomingCases.CourtDate FROM qryUpcomingCases; "

Set adoMyRecordset = RsOpen(strSQL)

If Not adoMyRecordset.EOF Then
Do Until adoMyRecordset.EOF

Response.Write "<b><a STYLE='text-decoration:none' href='NS_Main.asp?CaseID=" & adoMyRecordset("CaseID") & "' target='Main'>" & _
"" & "*" & adoMyRecordset("CourtNameShort") & " " & (WeekdayName(Weekday(adoMyRecordset("CourtDateFull ")))) & "," & " " & adoMyRecordset("CourtDate") & "</a></samp><br>" & vbCrLf

adoMyRecordset.MoveNext
Loop
End If %>
-------------------------------------------------
I want to add this qry to execute upon page load

UPDATE Cases SET Cases.DispoSentDate = 12/1/4
WHERE ((([Cases].[DispoSentDate]) Is Null) And (([Cases].[CaseNotes])="prospective") And (([Cases].[Paid])<1) And ((DateDiff("d",[DateEntered],Date()))>15));
 
Old February 10th, 2005, 08:00 PM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

Please elaborate your problem.. Are u getting any error in updation..?

Om Prakash
 
Old February 10th, 2005, 08:32 PM
Registered User
 
Join Date: Nov 2004
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It is not hard to believe but I know very little asp, I am modifying the code with the little I know.

I am not getting any error, because I didn't try anything yet.

I just need help droping in another qry.

Thanks for your patience.
 
Old February 11th, 2005, 01:23 PM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

If you are using SQL server then u can write the query as :

UPDATE Cases SET Cases.DispoSentDate = '12/1/2004'
WHERE ((([Cases].[DispoSentDate]) Is Null) And (([Cases].[CaseNotes])='prospective') And (([Cases].[Paid])<1) And ((DateDiff(day,[DateEntered],getDate()))>15));

Om Prakash





Similar Threads
Thread Thread Starter Forum Replies Last Post
Use a frm based on a qry to update a tbl Brucifier Access 1 August 8th, 2006 10:06 PM
How to load & run a oracle script file? hapytran C# 0 October 12th, 2005 11:47 PM
Getting VB.NET to load & update XML file kyma XML 0 March 19th, 2005 04:58 PM
why not run in MM:update event? zzzz8888 ASP.NET 1.0 and 1.1 Basics 0 May 26th, 2004 10:07 AM
Prb: COUNT qry result NOT SAME as SELECT qry savoym SQL Language 5 July 2nd, 2003 04:44 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.