I am trying to debug a VB Code but i am stuck to find table name ds. This is the table (debtudf) which i find it in the Adaptive Server when program is pulling data from there but no idea where in the program it define the table ds. Any idea or suggesstion where i look and debug the ds in the program would highly appreciate.

Thanks.


Private Function DebtUDFSelectString(Optional DebtIdNoTable As String = "ds") As String
' "(select min(item_no) from dbtraddr where debtor_id=ds.debt_id) as MIN_ADDR_ITEM,(select ADDR1 from dbtraddr where

debtor_id=ds.debt_id and item_no=MIN_ADDR_ITEM),(select ADDR2 from dbtraddr where debtor_id=ds.debt_id and

item_no=MIN_ADDR_ITEM),(select CITY from dbtraddr where debtor_id=ds.debt_id and item_no=MIN_ADDR_ITEM),(select STATE from

dbtraddr where debtor_id=ds.debt_id and item_no=MIN_ADDR_ITEM),(select ZIP from dbtraddr where debtor_id=ds.debt_id and

item_no=MIN_ADDR_ITEM),"
DebtUDFSelectString = Replace( _
"(select AMT from debtudf where debt_id=ds.debt_id and debt_no=ds.debt_no and label='AMT1') as UDFaaaaAMT1," _
& "(select AMT from debtudf where debt_id=ds.debt_id and debt_no=ds.debt_no and label='AMT2') as UDFaaaaAMT2," _
& "(select DATE1 from debtudf where debt_id=ds.debt_id and debt_no=ds.debt_no and label='DATE1') as UDFaaaaDATE1," _
& "(select DATE1 from debtudf where debt_id=ds.debt_id and debt_no=ds.debt_no and label='DATE2') as UDFaaaaDATE2," _
& "(select LONGSTR from debtudf where debt_id=ds.debt_id and debt_no=ds.debt_no and label='LONG1') as UDFaaaaLONG1," _
& "(select LONGSTR from debtudf where debt_id=ds.debt_id and debt_no=ds.debt_no and label='LONG2') as UDFaaaaLONG2," _
& "(select LONGSTR from debtudf where debt_id=ds.debt_id and debt_no=ds.debt_no and label='LONG3') as UDFaaaaLONG3," _
& "(select LONGSTR from debtudf where debt_id=ds.debt_id and debt_no=ds.debt_no and label='SHORT1') as UDFaaaaSHORT1,"

_
& "(select LONGSTR from debtudf where debt_id=ds.debt_id and debt_no=ds.debt_no and label='SHORT2') as UDFaaaaSHORT2,"

_
& "(select LONGSTR from debtudf where debt_id=ds.debt_id and debt_no=ds.debt_no and label='SHORT3') as UDFaaaaSHORT3,"

_
& "(select LONGSTR from debtudf where debt_id=ds.debt_id and debt_no=ds.debt_no and label='Store') as UDFchkStore," _
& "(select LONGSTR from debtudf where debt_id=ds.debt_id and debt_no=ds.debt_no and label='AccountNumber') as

UDFchkAccountNumber," _
& "(select LONGSTR from debtudf where debt_id=ds.debt_id and debt_no=ds.debt_no and label='Bank') as UDFchkBank," _
& "(select DATE1 from debtudf where debt_id=ds.debt_id and debt_no=ds.debt_no and label='CheckDate') as

UDFchkCheckDate," _
& "(select LONGSTR from debtudf where debt_id=ds.debt_id and debt_no=ds.debt_no and label='CheckNumber') as

UDFchkCheckNumber," _
& "(select DATE1 from debtudf where debt_id=ds.debt_id and debt_no=ds.debt_no and label='CheckRtnDate') as

UDFchkCheckRtnDate," _
& "(select LONGSTR from debtudf where debt_id=ds.debt_id and debt_no=ds.debt_no and label='ReturnReason') as

UDFchkReturnReason," _
& "(select AMT from debtudf where debt_id=ds.debt_id and debt_no=ds.debt_no and label='SettlementPercent') as

UDFchkSettlementPercent," _
& "(select LONGSTR from debtudf where debt_id=ds.debt_id and debt_no=ds.debt_no and label='CaseNumber') as

UDFchkCaseNumber" _
, "ds.", DebtIdNoTable & ".")
End Function