Problem with Updating with SQL

Results 1 to 2 of 2

Thread: Problem with Updating with SQL

  1. #1
    Join Date
    Dec 1969

    Default Problem with Updating with SQL

    I&#039ve tried to update a table with SQL but it doesn&#039t work.<BR>I have a include file in which I have my connection string to the database on the top:<BR><BR>set Con = Server.CreateObject("ADODB.Connection")<BR>Con.Ope n("DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & server.mappath("xxxxxxx.mdb"))<BR><BR>I&#039ve created a sub routine that handles the updating in the include file so I only need to send the parameters to the sub routine. Looks something like this:<BR><BR>sub UpdateOwner(owner_id, Owner_Name, blah blah blah)<BR> MySQL = "update OWNER set OWNER_NAME = &#039" & _<BR> FixStr(Owner_Name) & "&#039, .... blah blah ... _<BR> " where OWNER_ID = " & owner_id"<BR> Con.Execute MySQL<BR>end sub<BR><BR>Then I try to call that sub routine and I get the error message: "Too few parameters. 1 expected"<BR>Pointing to the line with the "Con.Execute MySQL".<BR><BR>Do I have to create a new connection to the database for this to work ?! <BR>I have never gotten any update to the database at all to work.<BR>What&#039s the correct syntax...<BR><BR>Please help !<BR><BR>Regards<BR>Anders<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Problem with Updating with SQL

    Hi,<BR><BR>This error is probably due to typo, such as field name, missing quote or something. Just print out the SQL to inspect 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