help with database pull

Results 1 to 2 of 2

Thread: help with database pull

  1. #1
    Join Date
    Dec 1969

    Default help with database pull

    I have this pasge written and the sql works in access. However <BR>I cannot get it to work in asp. It gives me this error:<BR>Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another. <BR>monselfint.asp, line 22 <BR>on this line: objRecordset.Open sSQL, objConnection, adOpenForwardOnly, adLockReadOnly, adCmdText<BR><BR>&#060;%<BR>Language=VBScript <BR>&#039;option explicit<BR>dim objConnection<BR>dim objRecordset<BR>dim sSQL<BR>Dim Conn, dbPath<BR> Dim objRec<BR> Dim rsDates, dtbegin,dtend<BR> dtbegin = Request("begin_date")<BR> dtend = Request("end_date")<BR> <BR> set objConnection = server.CreateObject("ADODB.Connection")<BR> objConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=d:diuDIU 2A.mdb; Persist Security Info=False"<BR> <BR> set objRecordset = server.CreateObject("ADODB.Recordset")<BR> <BR>sSQL = "SELECT " & chr(34) & "Selected Range" & chr(34) & ", (Sum([yes count].question1)/Sum(total_answers.total_answers))*100 AS Expr2, (Sum([yes count].question2)/Sum(total_answers.total_answers))*100 AS Expr3, (Sum([yes count].question3)/Sum(total_answers.total_answers))*100 AS Expr4, (Sum([yes count].question4)/Sum(total_answers.total_answers))*100 AS Expr5, (Sum([yes count].question5)/Sum(total_answers.total_answers))*100 AS Expr6, (Sum([yes count].question6)/Sum(total_answers.total_answers))*100 AS Expr7, (Sum([yes count].question7)/Sum(total_answers.total_answers))*100 AS Expr8, (Sum([yes count].question8)/Sum(total_answers.total_answers))*100 AS Expr9, (Sum([yes count].question9)/Sum(total_answers.total_answers))*100 AS Expr10, (Sum([yes count].question10)/Sum(total_answers.total_answers))*100 AS Expr11, (Sum([yes count].question11)/Sum(total_answers.total_answers))*100 AS Expr12, (Avg([yes count].question12)) AS Expr13 " &_<BR>"FROM [yes count] INNER JOIN total_answers ON [yes count].Date_submit = total_answers.Date_submit " &_<BR>"WHERE [yes count].Date_submit Between " & chr(34) & dtbegin & chr(34) & " And " & chr(34) & dtend & chr(34) & _<BR>" GROUP BY " & chr(34) & "Selected Range" & chr(34)<BR>objRecordset.Open sSQL, objConnection, adOpenForwardOnly, adLockReadOnly, adCmdText<BR>%&#062;<BR>

  2. #2
    Join Date
    Dec 1969

    Default Did you forget... #include ADOVBS.INC file?<BR><BR>See the ASPFAQs for what it is, how it works, and how to include it.<BR><BR>If it is missing, you will get zeroes for all those adXXXX values, and that will give you the error you are seeing.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts