Wrox Programmer Forums
|
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 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 January 16th, 2005, 02:38 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I try this code but it give following error

Error Type:
Microsoft VBScript runtime (0x800A01B6)
Object doesn't support this property or method: 'EoF'
/alart/triggered.asp, line 18


getInfo = conn.execute(sql)
If NOT getInfo.EoF then // line 18

other property method can use here ?

regards.

Mateen



 
Old January 16th, 2005, 08:02 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

;;;other property method can use here?

Use what ever method you usually use to get records from a data store.
Getting records:
sql = "SELECT id FROM tblName WHERE birthDate = " & (date()+3) & ";"
Execute query:
getInfo = conn.execute(sql)
Is there records:
If NOT getInfo.EoF then

Hard code some date in there I think you will find it works.

Wind is your friend
Matt
 
Old January 19th, 2005, 01:59 AM
Authorized User
 
Join Date: Dec 2004
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi all, some help needed help again.

How is it possible to change the select statement, where I want the warning to be set to 3 mths instead to 3 days?

Hope someone can help me respond asap. Thanks!


 
Old January 19th, 2005, 02:25 AM
Authorized User
 
Join Date: Aug 2004
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I hope you are using sql server.
If so please use the following code
sql = "SELECT id FROM tblName WHERE month(birthDate) = month(getdate());"

OR if it is MS ACCESS
sql = "SELECT ID FROM tbl_tblName WHERE month(birthDate) = month(now);"





 
Old January 19th, 2005, 02:27 AM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

I would use the dateAdd function:
"Returns a date to which a specified time interval has been added"
<%
'----------cut n paste start------------------
dim todayPlusThreeMonths
todayPlusThreeMonths = DateAdd("m", 3, date())
response.write todayPlusThreeMonths
'----------cut n paste finish-----------------
%>

Wind is your friend
Matt
 
Old January 19th, 2005, 02:27 AM
Authorized User
 
Join Date: Aug 2004
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Just forgot to add "3" to your sql.

sql = "SELECT id FROM tblName WHERE month(birthDate) = month(getdate())+ 3;"

OR if it is MS ACCESS
sql = "SELECT ID FROM tbl_tblName WHERE month(birthDate) = month(now)+ 3;"



 
Old January 20th, 2005, 01:43 AM
Authorized User
 
Join Date: Dec 2004
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you all so much for responding to my post. I managed to get the alert to work and printed out on the page. One last thing,
How do i format the text if let's say

<%Response.Write MonthName(Month(DATE))%>

I wanna print the Month out in Capital letters instead of small letters? How so i solve it?

And if I wanna print out ONLY the current month in my Access database which is in DateTime data type, how do i select? Sorry for the trouble.

Cheers,
Hayley
 
Old January 20th, 2005, 02:20 AM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

You are welcome:

Using th uCase function:
Response.Write uCase(MonthName(Month(DATE)))

sql = "Select month(dateTypeFieldName) FROM ...."

Wind is your friend
Matt





Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy whole sentence that contains "Alarm" mona_upm84 Excel VBA 3 September 10th, 2008 01:03 PM
Alarm Program nilgol1 Apache Tomcat 1 April 23rd, 2007 11:29 PM
alert darkhalf Javascript 3 November 18th, 2005 12:56 PM
Alarm Clock/How to Compare Set TIme mjwelker VB How-To 2 May 5th, 2004 05:04 AM
alert collie Javascript 2 December 29th, 2003 02:29 AM





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