The approach shown above is just one (probably the simplest) way of accessing database information. There are some other techniques that can be used, and some additional information that may be useful in some situations.
Storing the connection and table information in variables is generally the most convenient way to work with them, but isn't strictly necessary. Here is an alternative version of the first example script that compresses it down to two lines of code by eliminating the variables:
put the record of table "Members" of (type:"odbc", DSN:"ClubData", user:"root", password:"") where memberNumber is 12345 into member
put "Name: " & member's firstName && member's lastName
This version is shorter, but less readable. And unless this is the only operation to be performed with that database and table, storing those values in variables will be much more convenient.