DBVALUE(Str1, Str2, Str3, Str4)

Numeric Expression or String Expression (determined by type of field to be returned)

Looks up values from a preexisting database and returns the value of a specified field. The returned value is stored in a QDS Automatic Variable and becomes part of QDS Data File.

  • Str1: Full name of database file
  • Str2: Name of Table
  • Str3: Selection criteria (specifies name of matching identifiers)
  • Str4: Name of field whose value is wanted

Example:

DBVALUE("c:\lookup.mdb", "TblLocations", CONCAT("ID=", SUBJECT), "StreetAddress")

  • "c:\lookup.mdb": Name and full path (location) of Access file
  • "TblLocations": Name of the Access Table to be used for lookup
  • "ID=": Name of MS Access match field; must include equal sign
  • SUBJECT: Name of QDS match field (Note: only argument not in quotes)
  • "StreetAddress" : Name of the ACCESS field to return and store

This function looks in the TblLocations Table of the MS Access database lookup.mdb for a record where ID matches the value of the QDS Variable SUBJECT. If a match is found, the value of the MS Access field StreetAddress will be returned to QDS. If no match is found an empty string is returned.

MS Access data types that can be retrieved with DBValue using a String Expression:

  • Single character
  • Real Integer
  • Boolean (Yes/No type field)
  • Date
  • Currency
  • Text

MS Access data types that can be retrieved with DBValue using a Numeric Expression:

  • Real Integer
  • Boolean (Yes/No type field).

Note: Not supported by the Web Module.