Home | Advertising Info46 USERS CURRENTLY ONLINE   
PowerASP
   Site Search Contact Us Wednesday, January 15, 2025  

  Active InfoActive Info  Display List of Info MembersMemberlist  Search The InfoSearch  HelpHelp
  RegisterRegister  LoginLogin
Classic ASP - General
 PowerASP Code Help Area : Classic ASP - General
Subject Info: asp loop and display from db A d d  -  P o s tAdd P o s t
Author
Message << Prev Info | Next Info >>
jimk
Newbie
Newbie


Joined: July/04/2005
Location: United Kingdom
Online Status: Offline
Info: 1
Added: July/04/2005 at 12:47pm | IP Logged Quote jimk

Hi some one out there must do how to do this,

I have been able to return results from the database when a client id is selected but i need it to do this,

for sa users, instead of having to choose a client, if they haven't chosen one display all records received today from every received table ( received_0 , recived_1 etc etc)

heres some of the code:


' Get the received messages from the received table(s)
if session("sa") = "true" then
if len(client) = 0 then
receivedtable = "received_0"
arrivaldatetime = " arrivaldatetime >= '"&dfrom&"' and arrivaldatetime <= '"&dto&"'"

else

receivedtable = "received_"&client
arrivaldatetime = " arrivaldatetime >= '"&dfrom&"' and arrivaldatetime <= '"&dto&"'"
end if
else
receivedtable = "received_"&session("clientid")
arrivaldatetime = " arrivaldatetime >= '"&dfrom&"' and arrivaldatetime <= '"&dto&"'"
end if
if len(client) = 0 then clientsql = "" else clientsql = " and client = '"&client&"'"
if len(shortcode) = 0 then shortcodesql = "" else shortcodesql = " and destination_adr = '"&shortcode&"'"
if len(keyword) = 0 then
keywordsql = ""
else
if ubound(split(keyword," ")) = 0 then
keywordsql = " and prime_keyword = '"&keyword&"'"
else
keywordsql = " and prime_keyword = '"&split(keyword," ")(0)&"' and sec_keyword='"&split(keyword," ")(1)&"'"
end if
end if
mySQL = "SELECT * FROM "&receivedtable&" WHERE "&arrivaldatetime&clientsql&shortcodesql& amp;keywordsql&" ORDER BY arrivaldatetime ASC"
set received = dbConn.execute(mySQL)

' Loop round the received messages and write out
while not received.eof
%>

cheers
Back to Top View jimk's Profile Search for other info by jimk
 

If you wish to make a comment to this info you must first login
If you are not already registered you must first register

  A d d  -  P o s tAdd P o s t
Printable version Printable version

Info Jump
You cannot add new info in this area
You cannot add to info in this area
You cannot delete your info in this area
You cannot edit your info in this area
You cannot create polls in this area
You cannot vote in polls in this area

   Active Server Pages Rule The World
Contact Us  
All artwork, design & content contained in this site are Copyright © 1998 - 2025 PowerASP.com and Christopher J. Williams
Banner ads ,other site logos, etc are copyright of their respective companies.
STATS Unless otherwise noted - All Rights Reserved.

Active Server Pages help tutorial how to ASP Help ASP Tutorials ASP Programming ASP Code - ASP Free CJWSoft ASPProtect ASPBanner ASPClassifieds www.aspprotect.com, www.cjwsoft.com,www.aspclassifieds.com,www.aspphotogallery.com