 |
| 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
|
|
|
|

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

January 16th, 2005, 08:02 PM
|
|
Friend of Wrox
|
|
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
|
|
;;;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
|
|

January 19th, 2005, 01:59 AM
|
|
Authorized User
|
|
Join Date: Dec 2004
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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!
|
|

January 19th, 2005, 02:25 AM
|
|
Authorized User
|
|
Join Date: Aug 2004
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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);"
|
|

January 19th, 2005, 02:27 AM
|
|
Friend of Wrox
|
|
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
|
|
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
|
|

January 19th, 2005, 02:27 AM
|
|
Authorized User
|
|
Join Date: Aug 2004
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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;"
|
|

January 20th, 2005, 01:43 AM
|
|
Authorized User
|
|
Join Date: Dec 2004
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

January 20th, 2005, 02:20 AM
|
|
Friend of Wrox
|
|
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
|
|
You are welcome:
Using th uCase function:
Response.Write uCase(MonthName(Month(DATE)))
sql = "Select month(dateTypeFieldName) FROM ...."
Wind is your friend
Matt
|
|
 |