This topic is locked

Using IF condition insert a record into another table

8/26/2010 2:21:19 AM
ASPRunnerPro General questions
S
solig author

Hi,
I am new to ASPRunnerPro and also to ASP programming, i am trying to do a simple thing which should work but i get no errors or anything and i have no idea whats wrong, i have tried looking in the forum also for some answers but no luck yet.
What i am trying to do is to query data from one table (tbl1) which has 1 picklist field, i.e. Approved = Yes or No, based on the condition it should insert the data into either twdq_approved_users_w_role or twdq_not_approved_users_w_role.
here is the code what i wrote:

IF values("Approved") = "No" THEN

set dal_table=dal.Table("twdq_not_approved_users_w_role")

dal_table.Role="Role"

dal_table.Accdom="Accdom"

dal_table.Approved="Approved"

dal_table.Add()

END IF
after executing the above code i get the following message:

There is a problem with the resource you are looking for, and it cannot be displayed.
although the source table gets updated with the selection i made but no changes in the target table.
Below if the original code, where i should change values for;

TableName = Table name without schema name? or should it have it with schema name? i have tried both ways but no luck.

Field1/2 = Is this the field name of the source table or target table? i guess target?

Value1 = Field name of the source table?
'** Insert a record into another table ****

set dal_table=dal.Table("TableName")

dal_table.Field1="Value1"

dal_table.Field2="Value2"

dal_table.Add()
Thanks!

A
ann 8/26/2010

Solig,
all field values are in the 'values' array.

Here is the correct code:

IF values("Approved") = "No" THEN

set dal_table=dal.Table("twdq_not_approved_users_w_role")

dal_table.Role=values("Role")

...
S
solig author 8/26/2010



Solig,
all field values are in the 'values' array.

Here is the correct code:

IF values("Approved") = "No" THEN

set dal_table=dal.Table("twdq_not_approved_users_w_role")

dal_table.Role=values("Role")

...



Thanks Ann! But still the same issue... if the change the value to Yes for the Approved field in the form, then i get no error but when i change it to No, its still the same issue...
Solig

Sergey Kornilov admin 8/26/2010

Solig,
I recommend to post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program.