CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Count of replies - forum example

Print topic Send  topic

Author Message
vj
Posted: 05/06/2002, 2:57 PM

Hi,

I looked through some old discussions on the count of replies
in this forum, and found that you can use the following line
in Before Show event for a dummy form field:

'fldnreplies = cn.execute("select count(*) from messages where
message_parent_id="&fldmessage_id).fields.item(0)'

to generate the number of replies for each message. I tried
doing the same thing but keep on getting the error message:

Microsoft OLE DB Provider for ODBC Drivers error '80040e10'

[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.

/cmdtps/Count.asp, line 231

Any help you can provide will be greatly appreciated. Thanks.


VJ
Nicole
Posted: 05/07/2002, 5:39 AM

Hello,
try to do the following.
Add Label field to the form, do not select table field for it. Create Before Show event like:
fldField1 = dLookUp("messages", "count(message_parent_id)", "message_parent_id=" & fldmessage_id)

It works perfectly for me.
Andrew B
Posted: 05/07/2002, 1:26 PM

Could you show us the code that you are using?

If you are not sure exactly where it is failing, generate the code and then open the file in a text editor. Go to the line # that the error is on and copy it out.

Thanks
vj
Posted: 05/07/2002, 9:22 PM

Hi,

Here's the sample code:
fldnFruits=cn.execute("select count(*) as nFruits from fruits where fruit_name="&fldfruit_name).fields.item(0)

If I used fruit_name as above, I always get a fault, and I can't get around the double quotation mark issue (""). Then, I changed fruit_name to fruit_id, and got it to work, since fruit_id is a number variable. Thanks.


VJ
Wayne
Posted: 09/24/2002, 1:55 AM

I tried this code

Function messages_replies_BeforeShow() 'messages_replies_BeforeShow @141-24BFA536


'Custom Code @142-73254650
' -------------------------
messages.replies.value=CCdLookUp("count('message_parent_id')","forum_messages", "message_parent_id=" & messages.message_id.value,dbconnection1)
'End Custom Code

End Function 'Close messages_replies_BeforeShow @141-54C34B28

An got this error

Source: CCDLookUp function
Command Text: SELECT count('message_parent_id') FROM forum_messages WHERE message_parent_id=96
Error description: No value given for one or more required parameters. (Microsoft JET Database Engine)

Source: CCDLookUp function
Command Text: SELECT count('message_parent_id') FROM forum_messages WHERE message_parent_id=93
Error description: No value given for one or more required parameters. (Microsoft JET Database Engine)

Source: CCDLookUp function
Command Text: SELECT count('message_parent_id') FROM forum_messages WHERE message_parent_id=87
Error description: No value given for one or more required parameters. (Microsoft JET Database Engine)

Deen
Posted: 10/30/2002, 2:46 PM

I tried with this tip but still I could not figure it out can you please explain it in detail,
Thanks

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.