Too few parameteres - Query ASP-Access

Results 1 to 3 of 3

Thread: Too few parameteres - Query ASP-Access

  1. #1
    Alberto Ferrari Guest

    Default Too few parameteres - Query ASP-Access

    I have an ASP with a query to MsAccess, I&#039ve got this error:<BR><BR>Microsoft OLE DB Provider for ODBC Drivers error &#039 80040e10&#039 <BR>[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 2. <BR><BR>this is the ASP code:<BR><BR>&#060;%<BR>Set Conn = Server.CreateObject("ADODB.Connection")<BR>PRU = "DRIVER={Microsoft Access Driver (*.mdb)};<BR>DBQ=E:WEBguichondatabasesPRU.mdb;"<BR >Conn.Open PRU<BR><BR>SQL = "SELECT P.*, T.tipo, C.calle "<BR>SQL = SQL & "FROM Propiedades P, Tipos T, CallesBA C "<BR>SQL = SQL & "WHERE (P.Id=233) AND (P.IDtipo = T.IDtipo) AND (P.IDCalle =<BR>C.IDCalle)"<BR><BR>Set RS = Conn.Execute(SQL)<BR><BR>%&#062;<BR><BR>This Select dont requires parameters!! but what is wrong?<BR>If I try to join only 2 tables (i.e. Propiedades & Tipos OR Propiedades & Calles) it runs OK, but when I add a 3rd table in the Select it returns that error "Too few parameters". <BR>Thanks in advanced.<BR>

  2. #2
    Richard A. Lowe Guest

    Default RE: Too few parameteres - Query ASP-Access

    Try Response.Writing the resultant SQL out and running it directly in Access - sometimes access will infer a parameter when you misspell a column name (I think).<BR><BR>Anyway, trying the SQL in access should be the first step.<BR><BR>Richard

  3. #3
    Alberto Ferrari Guest

    Default RE: Too few parameteres - Query ASP-Access

    I&#039ve just did it, I&#039ve made the same qery INSIDE Access and works OK. Actually I want to do 2 LEFT JOINS, which works OK inside Access:<BR><BR>SELECT * FROM (Propiedades P LEFT JOIN CallesBa C ON P.[IdCalle] = C.[IdCalle]) LEFT JOIN Tipos T ON P.[IdTipo] = T.[IdTipo];<BR><BR>but when I move that query to ASP it returns "Too few parameters. Expected 2." (the same error than my example before)<BR><BR>But if I try the following code in ASP (only one JOIN):<BR><BR>SELECT * FROM Propiedades P LEFT JOIN CallesBa C ON P.[IdCalle] = C.[IdCalle]<BR><BR>it works OK, both in ASP and Access !!!<BR>The problem seems to be when joinning more than 2 tables??<BR>Thanks!<BR><BR> r<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