This topic is locked

master table fields how to point to

2/6/2009 10:51:22 AM
ASPRunnerPro General questions
T
totti_60 author

I wish to know how to point to the value of the fields belonging to master table, when working in the events area of the related detail table ???

J
Jane 2/9/2009

Hi,
master key is stored in the Session(strTableName & "_masterkey1") variable.

T
totti_60 author 2/9/2009

Hi,

master key is stored in the Session(strTableName & "_masterkey1") variable.


Dear Jane, thank you for answer, but i was talking about all the others value of fields of the table, and not only for master key.

J
Jane 2/9/2009

Hi,
you can select other fields based on the master key.

Here is a sample:

str = "select Field1,Field2 from MasterTable where Key=" & Session(strTableName & "_masterkey1")

Set rstmp = server.CreateObject("ADODB.Recordset")

rstmp.open str,dbConnection

response.write rstmp("Field1")

response.write rstmp("Field2")

rstmp.close

set rstmp=nothing

T
totti_60 author 2/9/2009

Hi,

you can select other fields based on the master key.

Here is a sample:


I known that solution, it is what i tought to do, but i alway received error "sintax error in FROM clause" i tought maybe becasue record of master table was busy form some process of the software, after i few daies and test i had to give up.

I want to let you know i use much this sort of method because i work with many table, so there is no way that i forgot to write some item, i also copied the rows form another table that working, and changed only table name and fields, but the errors continued to comes up.

At the end i trined with this codes:
strSQL2 = "select customer_code,agent_code from " & dal.order.TableName() & " where pi_number='" & dict("pi_number") & "'"

set data2=CustomQuery(strSQL2)

cst_code = data2("customer_code")

agt_code = data2("agent_code")

data2.close : set data2 = nothing
So strange it is work.

Frankly now i solved my prbm so i wanna write that one for whom has my same prbm.
Anyway i like much this software and i will continue to support it and promote.

Best regards

Antonio