Announcement

Collapse
No announcement yet.

Inserting records into table on Grid: on applicationinit

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Inserting records into table on Grid: on applicationinit

    Dear All,

    I have the below code at applicationinit for a Grid. It compiles fine, but no records are inserted or displayed in the grid.

    Any thoughts much appreciated.

    Thank you.

    Lyle

    -----

    $sql="INSERT INTO customers (firstname,lastname)
    VALUES
    ('John','Smith');
    ('Gayle','Jones')";

  • #2
    If this is the only line then yes, itwill not work because there's no sqlexec here.

    sc_exec_sql(sql);

    On the other hand, to be able to use these macro's there needs to be a connection set. I'm not quite sure but afaik there's no such connection already available in the onapplicationinit. You must move the code to the onscriptinit. But be aware that this onscriptinit is ran on each refresh. The onapplicationinit is run only once.
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development
    www.scriptcase.eu / www.scriptcase.nl

    Comment


    • #3
      Hi Albert,

      sc_exec_sql worked fine. Must be that a connection existed due to being a grid app.

      Thank you!!

      Comment

      Working...
      X