Problems updating a table - InfoPath Dev
in

InfoPath Dev

Problems updating a table

Last post 07-12-2006 08:51 AM by fredarwin. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 07-11-2006 12:42 PM

    Problems updating a table

    Hi, i am trying to update a sql table with the next code:

    XDocument.QueryAdapter.Command = "update solicitudesms set autorizado=1";
    XDocument.Query();

    This works fine, but is not updating my table.
    i have permissions on my table.

    Why???
  • 07-12-2006 06:32 AM In reply to

    Re: Problems updating a table

    i try to execute by a stored procedure but i have the same problem, the code is execute but the stored procedure never is executed, and ip neves send me a error message:

    var objADOAdapter;
    objADOAdapter = XDocument.DataObjects("CatServicios").QueryAdapter;
    XDocument.UI.Alert("SQL command text: " + objADOAdapter.Command);
    try
    {
    objADOAdapter.Command='execute "sp_authorize" ' + 30;
    XDocument.UI.Alert("SQL command text: " + objADOAdapter.Command);
    objADOAdapter.Command.Execute;
    }
    catch(ex)
    {
    XDocument.UI.Alert(ex.description);
    }

    what is the problem?
  • 07-12-2006 08:51 AM In reply to

    Re: Problems updating a table

    I got a solution:

    var cn = new ActiveXObject("ADODB.Connection");
    var sqlSP = "EXEC sp_authorize " + idsolicitud;
    cn.ConnectionString = XDocument.DataObjects("CatServicios").QueryAdapter.Connection;
    cn.ConnectionTimeout = XDocument.DataObjects("CatServicios").QueryAdapter.Timeout;

    cn.Open();
    cn.Execute(sqlSP);
    cn.Close();

    this work fine and change data on my table.
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.