1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
* My thanks to Tom Dierickx dierickx@healthyexchanges.com for the following.
* Ray 2001/06/11

The "beauty" in these are, that while they both rely on ODBC, they are DSN-less. 
Well, almost in the first case. Access installs a generic one called "MS Access Database" 
that can be used to connect to any database by modifying the DBQ option).
TOM

********************.
Microsoft Access -> SPSS
********************.
Note: Any valid "MS-Access SQL" SELECT statements will work in the /SQL option below. 
You can pull from Tables and/or Queries. 

GET DATA
 /TYPE = ODBC
 /CONNECT = "DSN=MS Access Database;"
            "DBQ=C:\\Windows\\Desktop\\test.mdb;"
 /SQL = "SELECT * FROM [YOUR_TABLE_NAME]".
CACHE.
EXECUTE.


*******************.
Lotus Notes -> SPSS
********************.
Note: Any valid "NotesSQL" SELECT statements will work in the /SQL option below. 
You can pull from Forms and/or Views.


GET DATA
 /TYPE = ODBC
 /CONNECT = "DRIVER=Lotus NotesSQL Driver (*.nsf);
            "ThreadTimeout=60;MaxVarcharLen=255;"
            "MapSpecialChars=1;ShowImplicitFlds=1;"
            "Server=YOUR_SERVER_NAME;"
            "Database=YOUR_DATABASE_NAME.nsf;"
 /SQL = "SELECT * FROM ViewName".
CACHE.
EXECUTE.

-------

In both cases you could use SQL's "AS" option to ensure variables conform to SPSS standards. 
For example, consider the following Access query which ensure short variable names, illustrates 
joining two tables, and sorts records - all before coming into SPSS at all! 
Again, (almost) any query designed in Access could go into this statement.

/SQL = "SELECT "
       "T1.[Employee ID] AS idnum, "
       "T2.[FullName] AS empname "
       "FROM Table1 as T1 INNER JOIN Table2 AS T2 "
       "ON T1.[Employee ID] = T2.[Employee ID] "
       "ORDER BY T2.[LastName], T2.[FirstName]"