Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
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 January 24th, 2005, 10:14 PM
Authorized User
 
Join Date: Dec 2004
Location: , , .
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default Error Type unable to solve

Hi all,

Got a problem here retrieving data from the database. I got error:
Error Type:
(0x80020009)
Exception occurred.
/text.asp, line 4

Which comes frm the function:
Function TD_Prop
    if rs("Schedule")="" then //line4
        TD_Prop = "EquipmentHead"
    else
        TD_Prop="EquipmentItem"
    end if
end function

Where it is supposed to display on the browser as:

<td width="66" class="<%=TD_Prop%>"><%=rs("Schedule")%></td>
<td width="298" class="<%=TD_Prop%>"><%=Item_Prop(rs("Code"),rs("I tem"))%></td>


Can anyone tell me what's wrong with the problem?
Thanks so much!


 
Old January 24th, 2005, 10:21 PM
Friend of Wrox
Points: 2,473, Level: 20
Points: 2,473, Level: 20 Points: 2,473, Level: 20 Points: 2,473, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2004
Location: India
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

From where rs("Schedule") is coming in below function:

Function TD_Prop
    if rs("Schedule")="" then //line4
        TD_Prop = "EquipmentHead"
    else
        TD_Prop="EquipmentItem"
    end if
end function

I think the code should be:
---------------------------

Function TD_Prop(Schedule)
    if Schedule="" then //line4
        TD_Prop = "EquipmentHead"
    else
        TD_Prop="EquipmentItem"
    end if
end function

Where it is supposed to display on the browser as:

<td width="66" class="<%=TD_Prop(rs("Schedule"))%>"><%=rs("Schedu le")%></td>
<td width="298" class="<%=TD_Prop(rs("Schedule"))%>"><%=Item_Prop( rs("Code"),rs("Item"))%></td>

Hope this helps..

Om Prakash
 
Old January 24th, 2005, 11:11 PM
Authorized User
 
Join Date: Dec 2004
Location: , , .
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hihi om_prakash,

I got the error after trying out:
Wrong number of arguments or invalid property assignment: 'TD_Prop'
/text.asp, line 72 and 73

which is
<td width="66" class="<%=TD_Prop(rs("Schedule"))%>"><%=rs("Schedu le")%></td> //line 72
<td width="298" class="<%=TD_Prop(rs("Schedule"))%>"><%=Item_Prop( rs("Code"),rs("Item"))%></td>//line 73

Hmm..wonder what's the problem..
Click on http://n.domaindlx.com/hayley/PMS_Page.asp if u wanna see the test page. At the bottom U can see the error.

Click on "Complete unit servicing & renew wire rope". It pops up another window with dates. When u remove the date the page is able to display properly. If added date, the page displays error. Why?
 
Old January 25th, 2005, 03:59 AM
Friend of Wrox
Points: 2,473, Level: 20
Points: 2,473, Level: 20 Points: 2,473, Level: 20 Points: 2,473, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2004
Location: India
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

But have u modified the function?

Function TD_Prop(Schedule)
    if Schedule="" then //line4
        TD_Prop = "EquipmentHead"
    else
        TD_Prop="EquipmentItem"
    end if
end function


And what does this function does: Item_Prop

Thanks


Om Prakash
 
Old January 25th, 2005, 05:17 AM
Authorized User
 
Join Date: Dec 2004
Location: , , .
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

The item_prop is actually another function.

Function Item_Prop(sCode,sItem)
if len(sCode)>3 then
Item_Prop = "<a href=Maintenance.asp?EquipmentItemCode="&sCode&"&Y ear="&sYear&" title='Click to add Maintenance' target=MT_Window onclick=OpenWindow('','MT_Window')>"&sItem&"</a>"
else
    Item_Prop = sItem
end if
end Function

When the Item(which is the blue link) is linked to another page where the info are recorded according to the code(scode) linked to the item..




Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to cast object of type 'TheBeerHouseSection DyerOppenheimer BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 4 June 10th, 2008 12:13 PM
Receiving Error Msg:Unable to cast object of type cesemj ASP.NET 2.0 Basics 2 March 4th, 2008 02:18 PM
Unable to cast object of type galua SQL Language 3 January 9th, 2008 01:31 PM
Unable to solve error!! nvillare Classic ASP Basics 1 July 31st, 2003 01:53 AM





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