This topic is locked
[SOLVED]

 Event: Insert a record into another table

5/14/2012 2:26:47 PM
ASPRunnerPro General questions
author

I would like to ask a few questions from members that have experience in using the Event: Insert a record into another table feature of ASPRunnerPro. I am trying to learn how to do this item.
Please reply to me at: joehpd@hotmail.com
Thanks,

Joe

Sergey Kornilov admin 5/14/2012

In short - you you need construct your SQL query and execute it via CustomQuery() function.

Example:
CustomQuery("INSERT INTO employee (id, name, dept, age, salary) VALUES (105, 'Srinath', 'Aeronautics', 27, 33000)")
More info:

http://beginner-sql-tutorial.com/sql-insert-statement.htm
It also makes sense to test your queries before pasting them to ASPRunnerPro code. Your favorite SQL Query tool can do that.

1312 5/14/2012

Thank you Sergey in pointing me in the proper direction. I was successful. I also was successful in using the following in the Event:
set dal_table=dal.Table("SearchTable")

dal_table.Name=values("Name")

dal_table.Address=values("Address")

dal_table.Phone=values("Phone")

dal_table.Add()
I used this in the "Before Record Added" area and it was also successful.
My goal was to learn more about the Events functions and with your guidance, I have done just that.
Thank you again,

Joe