|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
So confused
It's been a while since I've worked with ASP and I can't figure out why this problem is occurring. I just want do look up some records from a database and loop over them, building a total quantity and price.. Here's the code...
Code:
Dim mpcount, mealTotalCost, mealCost, mealPlanSql, RSm
mpCount = 0
mealTotalCost = 0
mealCost = 0
mealPlanSql = "SELECT * FROM [Individual Entries - Hotel] WHERE [Entry Type] = ""MP"" AND [School Id] = " & RS("School Id") & ""
Set RSm = dcnDBx.Execute(mealPlanSql)
Do While RSm.EOF = false and RSm.BOF = false
mpCount = mpCount + RSm("Meal Quantity")
If RSm("Meal Type") = "Breakfast" Then
mealCost = 5.85
Else 'If RSm("Meal Type") = "Lunch" Then
mealCost = 7.10
End If
mealTotalCost = mealTotalCost + (RSm("Meal Quantity") * mealCost)
RSm.MoveNext()
Loop
I keep getting an error on the "Set RSm = dcnDBx.Execute(mealPlanSql)" telling me that I'm not passing enough parameters... Microsoft OLE DB Provider for ODBC Drivers error '80040e10' [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1. file.asp, line 524 Thanks in advance. |
|
#2
|
||||
|
||||
|
change your sql statement:
Code:
mealPlanSql = "SELECT * FROM [Individual Entries - Hotel] WHERE [Entry Type] = 'MP' AND [School Id] = " & RS("School Id") & ""
__________________
Come JOIN the party!!! Quote of the Month: Retirement: Because you've given so much of yourself to the company that you don't have anything left we can use. Questions to Ponder: What do you do when you see an endangered animal eating an endangered plant? iif([sarcasm]=true,iif([you have to ask]=true,"didn't work","ha ha ha"),"not sarcasm") copyright© 2008 sbenj69 |
|
#3
|
|||
|
|||
|
Awesome. Thank you so much! Is there any certain reason that was breaking the code?
|
|
#4
|
||||
|
||||
|
Quote:
|
![]() |
| Viewing: ASP Free Forums > Other > Programming Help > So confused |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|