Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Basics
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." 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 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old June 24th, 2008, 11:48 AM
Registered User
 
Join Date: Jun 2008
Location: Miami, FL, USA.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default display last user and modified date

I am having a hard time trying to display the last user who modified the record including the date. Any ideas? HEre is what I have so far.

        <td>

            <%
              Dim mySQL, objRS, createdByMsg, auditreason

              Set objRS = Server.CreateObject("ADODB.Recordset")

              mySQL = "SELECT * FROM ConAdmPSAAgreementsAudit" & _
                   " where agreement_no ='" & strAgreementNum & "'"

              'mySQL = "Select * from ConAdmPSAAgreementsAudit where auditreason = '" & auditreason & "' select *, '" & session("username") & "', getdate(), " & _
                  '"'TEST'" & "' from ConAdmPSAAgreements(nolock) where agreement_no = '" & strAgreementNum & "'"
              'response.write mySQL & "<br>"
              'response.end

              objRS.Open mySQL, cn

              if objRS.eof then
                response.write "NO RECORDS ADDED/UPDATED"
              elseif objRS.fields("auditreason") = "AFTERINSERT" or objRS.fields("auditreason") = "AFTERUPDATE" then
                createdByMsg = iif(isnull(objRS("auditUserID")), objRS("auditreason"), " Record was " & objRS("auditreason") & " on " & objRS("auditdate") & " by " & GetUserName(objRS("auditUserID")))
              end if
            %>
                <b><%=createdByMsg%></b>

         </td>

Any help is appreciated. :D
Reply With Quote
  #2 (permalink)  
Old June 24th, 2008, 02:52 PM
Friend of Wrox
 
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,652
Thanks: 3
Thanked 141 Times in 140 Posts
Default

Ummmm...what is the error???? If any?

VBScript doesn't *HAVE* an IIF( ) function built in. You can easily create one, but if you didn't do so then for sure your use of IIF( ) in that code would cause an error.

When you don't say WHAT doesn't work and/or tell use what the error is, it's anybody's guess.

One major question: Will there ever be more than one record returned from the query???? If so, you have no code at all in there to account for that.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
date display problem varia_mahesh Access ASP 3 October 22nd, 2012 03:56 AM
Dynamic Date Display velcrobomb SQL Language 3 April 3rd, 2007 10:10 AM
last modified date on folders holdmykidney J2EE 0 May 23rd, 2005 07:47 AM
Display Table by Date werD420 Classic ASP Databases 9 January 31st, 2005 04:26 PM
Date didn't display in pdf chinhow Crystal Reports 4 April 13th, 2004 03:29 AM



All times are GMT -4. The time now is 08:53 AM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.