Too Few Parameters?

Results 1 to 2 of 2

Thread: Too Few Parameters?

  1. #1
    Join Date
    Dec 1969

    Default Too Few Parameters?

    Hello! I am trying to make a function that will open my database connection and execute a (dynamic) SQL statement at the same time. Here&#039;s how it&#039;s supposed to work:<BR><BR>Some code here<BR>&#039;Open database connection: (Database_Location,Password,SQL_Statement)<BR>Dim sqlEmailSystemToUse, oConn<BR> <BR> sqlEmailSystemToUse = "SELECT EmailSystemToUse FROM CurrentSettings WHERE CurrentSettings = 0"<BR> Set rsEmailSystemToUse = OpenDatabaseConnection("databasemydatase.mdb","myp assword","SELECT EmailSystemToUse FROM CurrentSettings WHERE CurrentSettings = 0")<BR> <BR> &#039;Close databae connection<BR> Call CloseDatabaseConnection()<BR><BR>--Code to work with my results and close recordset goes here--<BR><BR>Here&#039;s the function that opens that database connection:<BR><BR>Function OpenDatabaseConnection(strDatabaseLocation,strPass word,strSQLStatement)<BR> <BR> Dim oConn, oConnString<BR> <BR> Set oConn = Server.CreateObject("ADODB.Connection")<BR> oConnString = "DRIVER={Microsoft Access Driver (*.mdb)};" & _<BR> "DBQ=" & constFlyDesertWindsPath & strDatabaseLocation & ";" &_<BR> "PWD=" & strPassword<BR><BR> oConn.Open(oConnString)<BR> <BR> oConn.Execute(strSQLStatement)<BR> <BR>End Function<BR><BR>What I get is an error saying:<BR><BR>Microsoft OLE DB Provider for ODBC Drivers error &#039;80040e10&#039;<BR>[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.<BR>/mypage.asp, line 1474<BR><BR>All help is appreciated!<BR><BR>Thanks,<BR><BR>Defiant005

  2. #2
    Join Date
    Dec 1969
    Los Angeles, CA

    Default RTFFAQs <eop>


Posting Permissions

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