Go Back   DeveloperBarn Forums > Programming & Scripting > ASP Development

Sponsored Links

Discuss "another access problem" in the ASP Development forum.

ASP Development - Learn coding practices and tips to get the best out of your Active Server Pages (ASP). The Classic ASP forum is for ASP/VBScript and ASP/JScript applications.


Reply « Previous Thread | Next Thread »  
 
LinkBack Thread Tools Display Modes
  #1  
Old July 30th, 2008, 10:39 AM
Barn Frequenter

 
Join Date: Mar 2008
Posts: 197
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 1
todd2006 is an unknown quantity at this point
Default another access problem

Hi,

I have this query
Code:
str="SELECT Sum(Amount) FROM Registration where Id=" & id & " and RespMsg='Authorized' and Test_Id=" & getno
following are the datatype
Code:
Amount - currency
Id -- number 
Test_Id -- number field
RespMsg -- text field
it gives me this error
[Microsoft][ODBC Microsoft Access Driver] Too few parameters.
Reply With Quote
Sponsored Links
  #2  
Old July 30th, 2008, 10:43 AM
Rebelle's Avatar
V.I.P/Donor


 
Join Date: Mar 2008
Posts: 254
Thanks: 48
Thanked 1 Time in 1 Post
Rep Power: 1
Rebelle is on a distinguished road
Default

i think you need the other fields...maybe?...like:

Code:
str="SELECT Id, RespMsg, Test_Id,Sum(Amount) FROM Registration where Id=" & id & " and RespMsg='Authorized' and Test_Id=" & getno
Reply With Quote
  #3  
Old July 30th, 2008, 10:49 AM
mehere's Avatar
Super Sarcasm Mistress


 
Join Date: Mar 2008
Location: Wide Awake In Dreamland
Posts: 143
Thanks: 10
Thanked 27 Times in 25 Posts
Rep Power: 1
mehere will become famous soon enough

Awards Showcase
Microsoft SQL Server Classic ASP 
Total Awards: 2

Default

have you tried a response.Write to see if the string is being built correctly
Code:
str="SELECT Sum(Amount) FROM Registration where Id=" & id & " and RespMsg='Authorized' and Test_Id=" & getno
response.Write(str)
response.End
are id and test_id both number fields? have you tried running the query directly in access?
__________________
Quote of the Month:
Regret: It hurts to admit when you make mistakes - but when they're big enough, the pain only lasts a second.

Questions to Ponder:
Could it be that all those trick-or-treaters wearing sheets aren’t going as ghosts but as mattresses?

iif([sarcasm]=true,iif([you have to ask]=true,"didn't work","ha ha ha"),"not sarcasm")
copyright © 2008 sbenj69
Reply With Quote
  #4  
Old July 30th, 2008, 10:57 AM
Barn Frequenter

 
Join Date: Mar 2008
Posts: 197
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 1
todd2006 is an unknown quantity at this point
Default

rebelle,

I tried ur query it gives me an error


You tried to execute a query that does not include the specified expression 'RespMsg' as part of an aggregate function.

Mehere,

yes both are number fields

str="SELECT Sum(Amount) FROM Registration where Id=" & id & " and RespMsg='Authorized' and Test_Id=" & getno
response.Write(str)

the output is like this

SELECT Sum(Amount) FROM Registration where Id=11 and RespMsg='Authorized' and Test_Id=9
Reply With Quote
  #5  
Old July 30th, 2008, 11:02 AM
mehere's Avatar
Super Sarcasm Mistress


 
Join Date: Mar 2008
Location: Wide Awake In Dreamland
Posts: 143
Thanks: 10
Thanked 27 Times in 25 Posts
Rep Power: 1
mehere will become famous soon enough

Awards Showcase
Microsoft SQL Server Classic ASP 
Total Awards: 2

Default

are those fields listed as numbers in your database? what datatype is amount? and have you tried running the above query directly in the access database?
Reply With Quote
  #6  
Old July 30th, 2008, 11:09 AM
Barn Frequenter

 
Join Date: Mar 2008
Posts: 197
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 1
todd2006 is an unknown quantity at this point
Default

I got it had to trim the request.querystring

thanks guys
Reply With Quote
Reply

  DeveloperBarn Forums > Programming & Scripting > ASP Development

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
access problem todd2006 Microsoft Access 4 July 30th, 2008 11:38 AM
MS access distinct datetime problem todd2006 ASP Development 16 July 24th, 2008 01:05 PM


All times are GMT -4. The time now is 06:11 PM.



Content Relevant URLs by vBSEO 3.2.0