Update table - Need Help

Results 1 to 3 of 3

Thread: Update table - Need Help

  1. #1
    Jyotsna Guest

    Default Update table - Need Help

    I am trying to update a field in a table. I have been getting this error:<BR>UPDATE tblScenario SET Desc=&#039ftyutfyu67&#039 WHERE ScenarioTitle=&#039dsfgsert&#039 <BR>Microsoft OLE DB Provider for ODBC Drivers error &#039 80040e14&#039 <BR>[Microsoft][ODBC Microsoft Access 97 Driver] Syntax error in UPDATE statement. <BR>I tried a million different things. But nothing works. The following is the code. Please help.<BR>&#060;%<BR>&#039the primary key that I am requesting from a form<BR>ScenarioTitle = request.form ("ScenarioTitle")<BR><BR>&#039the field that needs to be updated<BR>description = request.form ("description")<BR><BR>Set MyConn = Server.CreateObject("ADODB.Connection")<BR>Set RS = Server.CreateObject("ADODB.Recordset")<BR>MyConn.O pen "db"<BR><BR>&#039finding the record that needs to be updated<BR>Set RS = MyConn.Execute _<BR>("SELECT * FROM [tblScenario] WHERE ScenarioTitle = &#039"& _<BR> Request.Form("ScenarioTitle")&"&#039")<BR><BR>Dim sql<BR>sql = ("UPDATE tblScenario SET Desc=&#039"&description&_<BR>"&#039 WHERE ScenarioTitle=&#039"&ScenarioTitle&"&#039")<BR>res ponse.write (sql)<BR><BR>&#039the following is the statement that gives the error irrespective of whatever form of coding I try<BR>Set RS = MyConn.Execute(sql)<BR>%&#062;<BR><BR><BR>Thank you.

  2. #2
    Manpreet Guest

    Default RE: Update table - Need Help

    try removing the space in the column name Scenario Title. replca it by an underscore - Scenario_title.<BR><BR>it will work!

  3. #3
    Jyotsna Guest

    Default RE: Update table - Need Help

    Thanks for the suggestion. But there is no space in the column name. It is a single word ScenarioTitle. Can you give me any other suggestions please?

Posting Permissions

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