Refer to MSDN CSIDL listing and use the SHGetFolderPath() function.
Map the CSIDL CSIDL_COMMON_APPDATA to a physical directory.
From MSDN:
The file system directory that contains application data for all users. A typical path is C:\Documents and Settings\All Users\Application Data. This folder is used for application data that is not user specific. For example, an application can store a spell-check dictionary, a database of clip art, or a log file in the CSIDL_COMMON_APPDATA folder. This information will not roam and is available to anyone using the computer.
Beneath this directory, create a directory named after the vendor (your company), and beneath that, a directory for your application. Then put your database in there.
Note: Don't use CSIDL_COMMON_DOCUMENTS/ FOLDERID_PublicDocuments. This is for document-like files that can be shared across different applications. For proprietary data, like databases, use CSIDL_COMMON_APPDATA . Also files in CSIDL_COMMON_DOCUMENTS may be 'roamed' by the operating system - something you definitely don't want for a temporary database.
Note: For Vista onwards use SHGetKnownFolderPath(), but for XP or cross-version, use SHGetFolderPath().