Appendix

And finally, here is the entire first script, as described above.

#Start the search routine
   Go to Layout [ -Entry" (T1.Globals) ] Go to Field [ T1.Globals::Search ] Pause/Resume Script [ Indefinitely ] #Enter search string
   Set Field [ T1.Globals::gSearch; T1.Globals::Search ]
   Clear [ T1.Globals::Search ] [ Select ]

#Then go to find in Friends
   Set Error Capture [ On ]
   Go to Layout [ -Friends" (T2.Friends) ]
   Perform Find [ Specified Find Requests: Find Records; Criteria: T2.Friends::cIfMatchComposite: -1" ] [ Restore ]

#Import these records into the SearchReturn table
   Go to Layout [ -SearchReturn" (T4.SearchReturn) ]
   Import Records [ Source: -file:Builder.fp7"; Target: -T4.SearchReturn"; Method: Add; Character Set: -Windows ANSI"; Field Mapping: Source field 1 import to T4.SearchReturn::iID
   Source field 6 import to T4.SearchReturn::iComp
   Source field 8 import to T4.SearchReturn::iTable ]
   [ No dialog ]

#Next, go to find in Contacts
   Go to Layout [ -Contacts" (T3.Contacts) ]
   Perform Find [ Specified Find Requests: Find Records; Criteria: T3.Contacts::cIfMatchComposite: -=1" ] [ Restore ]
   Pause/Resume Script [ Indefinitely ]

#Import these records into the SearchReturn table
   Go to Layout [ -SearchReturn" (T4.SearchReturn) ]
   Import Records [ Source: -file:Builder.fp7"; Target: -T4.SearchReturn"; Method: Add; Character Set: -Windows ANSI"; Field Mapping: Source field 1 import to T4.SearchReturn::iID
   Source field 7 import to T4.SearchReturn::iComp
   Source field 9 import to T4.SearchReturn::iTable ]
   [ No dialog ]
   Pause/Resume Script [ Indefinitely ] #Then PassSerial Show All Records
   If [ Get(FoundCount)=0 ]
   Go to Layout [ -SearchReturn" (T4.SearchReturn) ]
   Show Custom Dialog [ Title: "Nothing Found"; Message: "No records found"; Buttons: -OK", -Cancel" ]
   Exit Script [ ] 
   End If
   Sort Records [ Specified Sort Order: T4.SearchReturn::iTable; ascending ] [ Restore; No dialog ]

Do you need help with Mac? Gain advice from Builder AU forums

Comments

1

Emile - 13/07/06

OOoooo, this is a great technique. Is there any way you can provide a sample file download to better illustrate how it works? Thanks

» Report offensive content

2

ianj - 03/10/06

One quick comment about the table names. Using a "." character in a table name or a field name has the potential to cause untold grief if you need to web-enable the system or connect via ODBC/JDBC. It's generally a really bad idea.

ian

» Report offensive content

3

Ender - 25/11/06

I'm afraid I don't see the need for techniques like this that search across multiple tables. Tables should really be about different things. If you have two tables with similar types of things, then the tables should probably be combined (especially if they may need to be shown together in a common listing or report).

In this example, "Friends" and "Contacts" should really reside in the same table, with a Contact Type field used to distinguish between them. This structure would make this search and listing quite simple, with no additional tables or import scripts required.

» Report offensive content

4

yusuf alam - 24/01/07

I want to search the record from the existing table from the oracle database using visualbasic programe and it will display the result in to the text box
select * from student where st_roll =" ' text1.text ' "

» Report offensive content

Leave a comment

You must read and type the 6 chars within 0..9 and A..F

* indicates mandatory fields.

4

yusuf alam - 24/01/07

I want to search the record from the existing table from the oracle database using visualbasic programe and it will display ... more

3

Ender - 25/11/06

I'm afraid I don't see the need for techniques like this that search across multiple tables. Tables should really be ... more

2

ianj - 10/03/06

One quick comment about the table names. Using a "." character in a table name or a field name has the ... more

Log in


Sign up | Forgot your password?

What's on?