ASP Update Query

Results 1 to 2 of 2

Thread: ASP Update Query

  1. #1
    Join Date
    Dec 1969

    Default ASP Update Query

    Hi,<BR>I am a beginner with ASP. I have been trying to execute this script for the last 2 days.But have been unsuccessful. <BR>Any help would be greatly appreciated.<BR>I have a asp script which receives input from an HTML form.<BR>The form has only 1 text field. It is this text field that needs to be inserted in the access database.<BR> Everytime I try to execute an Insert Statement I get the Following Error:<BR><BR>ADODB.Command error &#039 800a0bb9&#039 <BR><BR>The application is using arguments that are of the wrong type, are out of acceptable range, or are in conflict with one another. <BR><BR>/gautam/final.asp, line 20 <BR><BR><BR>This is the script that generates this error:<BR><BR>&#060;%<BR>DIM ConObj<BR>DIM RSObj<BR>DIM SQL<BR>Set ConObj=Server.CreateObject("ADODB.connection")<BR> &#039Set RSObj=Server.CreateObject("ADODB.recordset")<BR>Se t ObjCmd=Server.CreateObject("ADODB.Command")<BR>&#0 39ConObj.ConnectionString ="Driver={Microsoft Access Driver(*.mdb)};DBQ=C:Gautam rial.mdb"<BR>ConObj.Open "DRIVER={Microsoft Access Driver (*.mdb)};" & _<BR> "DBQ=C:Gautam rial.mdb;" & _<BR> "UID=Admin pwd=;" <BR>firstn = CStr(Request.Form("first_name"))<BR>&#039lastname= Request.Form("last_name")<BR>ObjCmd.ActiveConnecti on = ConObj<BR><BR>ObjCmd.CommandText = "Insert INTO name (fname) Values (firstn);"<BR>ObjCmd.CommandType = adCmdText<BR>ObjCmd.Execute <BR>Set ObjCmd=Nothing<BR>ObjCmd.close<BR>Set ConObj=Nothing<BR>ConObj.Close <BR>%&#062;<BR><BR>Also If I comment out the Command Object<BR>Commandtype property then the error message changes to<BR><BR>Microsoft OLE DB Provider for ODBC Drivers error &#039 80040e10&#039 <BR><BR>[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1. <BR><BR>/gautam/final.asp, line 21 <BR><BR><BR>I am using a simple access database which is called trial and has just a single table call name. The name table has just 2 fields which are described as follows<BR>fname: lenght 20 type text<BR>primary :Autonumber and it is the <BR> primary key for the table<BR><BR><BR>Thank You,<BR><BR>Gautam

  2. #2
    Join Date
    Dec 1969

    Default RE: ASP Update Query

    I&#039m not sure if it&#039s the only problem, but your connection open string is missing a semicolon between admin and pwd. Also, make sure there aren&#039t any spaces in it.

Posting Permissions

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