Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 10th, 2006, 02:52 AM
Registered User
 
Join Date: Apr 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default too few parameter expected 2

Can any one tell me i have design a form which i tried with a table of having 10 records it works ,but when i try to acces main table which have more than 5,000 record
it gives me the error "too few parameters expected 2"
why
<html>
<head>
<title>
AOTS
</title>
</head>
<jsp:useBean id="AOTSBeanId" scope="session" class="aots.AOTSBean" />
<jsp:setProperty name="AOTSBeanId" property="*" />
<body>
<%@ page language="java" import="java.util.*"%>
<body>
<p>update database content
<form action="updatephonebook.jsp" method="post">
Region:<input type=text name=regionparam><br>
Bill Month From:<input type=text name=billfromparam><br>
Bill Month To:<input type=text name=billtoparam><br>
<input type=Submit value="Retrive from DB">
</form>
<p> content of phone book database:
<table border=1 cellpadding=0 cellspacing=0>
<tr><td> Phone NO </td>
<td> Current Bill </td>
<td> Net Payable </td>
</tr>
<%
  Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
  java.sql.Connection connection = java.sql.DriverManager.getConnection("jdbc:odbc:AO TS1");
  java.sql.Statement statement = connection.createStatement();
  Enumeration parameters = request.getParameterNames();
  if(parameters.hasMoreElements()){

    String LastValue = request.getParameter("regionparam");
    String FirstValue = request.getParameter("billfromparam");
    String PhoneValue = request.getParameter("billtoparam");
   // statement.executeUpdate("INSERT INTO updatephonebook (LAST,FIRST,PHONE) VALUES ('"+LastValue+"','"+FirstValue+"','"+PhoneValue+"' )");

                            java.sql.ResultSet columns = statement.executeQuery(
                             // "SELECT * FROM updatephonebook");
                             //"SELECT LAST,FIRST,PHONE FROM updatephonebook WHERE LAST=" + LastValue + " AND FIRST =" + FirstValue + " AND PHONE="+PhoneValue+" ");
                           "SELECT PHONE_NO,GROSS_CURRENT_BILL,AMOUNT_PAYABLE FROM AOTS WHERE REGION_CODE='" + LastValue + "' AND ISSUE_DATE ='" + FirstValue + "' AND DUE_DATE='"+PhoneValue+"' ");
                                while(columns.next()){
                            String last = columns.getString("PHONE_NO");
                            String first = columns.getString("GROSS_CURRENT_BILL");
                            String phone= columns.getString("AMOUNT_PAYABLE");%>
                            <TR>
                            <TD> <%=last %></td>
                            <TD> <%=first %></td>
                            <TD> <%=phone %></td>
                            </tr>
                            <%}
}%>
                            </table>
                            </body>
                            </html>





 
Old April 19th, 2006, 03:23 PM
Registered User
 
Join Date: Apr 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

First you posted your topic in Access VBA not Java so you're not going to get much help here most likely.

Second, the error you're experiencing usually comes from failure to suppy a parameter to a function. In other words, you called a function that requires two parameters and one is missing.

Cheers

AvGuy





Similar Threads
Thread Thread Starter Forum Replies Last Post
expected Then Adam H-W Classic ASP Basics 6 April 17th, 2008 05:41 AM
Parameter object malfunction - out parameter dash dev C# 2005 6 December 4th, 2007 12:58 PM
expected ';' RoniR Javascript 3 February 1st, 2007 05:28 AM
Expected 'Then' Adam H-W Classic ASP Basics 5 July 26th, 2004 02:36 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.