The ODBC connection to Lotus Notes may not retrieve numeric data from a Lotus Notes database in FoxPro

This article was previously published under Q123006
This article has been archived. It is offered "as is" and will no longer be updated.
Under certain conditions, you may not be able to use ODBC to retrievenumeric data. Null values are returned when you try to bring numeric datainto a FoxPro cursor or table by using the Lotus Notes ODBC driver toconnect to a Lotus Notes database from FoxPro for Windows. Text and datedata, however, are brought in successfully.

NOTE: Lotus Notes is manufactured by a vendor independent of Microsoft; wemake no warranty, implied or otherwise, regarding this product'sperformance or reliability.
A Lotus Notes numeric data type will be mapped to an ODBC SQL SQL_FLOATdata type. This is the same data type the SQL Server FLOAT data types aremapped to and FoxPro is able to successfully bring down FLOAT data from anSQL Server. This would indicate that FoxPro might be able to bring innumeric data successfully from Lotus Notes.

Mapping SQL Tables, Views, and Indexes to and from Notes

When connecting to a Lotus Notes database, it's helpful to know thefollowing information:

  • Each SQL table is derived from a Notes form.
  • Each SQL index is derived from a Notes view. Sorted columns in the Notes view map to fields in a single form. A Notes view selects documents from that single form.
  • Each SQL view is derived from a Notes view that selects documents through a single form.

Steps to Reproduce Problem

  1. Set up the Lotus Notes ODBC driver through ODBC Setup. See the Lotus Notes help file for more information.
  2. Using DBConnect (SQLCONNECT in Visual FoxPro), connect to a Lotus Notes database (.NSF File) that has a form with a numeric field on it. The User identifier and Password may be an empty string (specified by "").
  3. Issue a DBExec from FoxPro(SQLEXEC in Visual FoxPro), passing a simple SQL SELECT command to the database file. Notice that the results from this command indicate that records have been selected even though the command returns an error number of -1. Using DBError (AError in Visual FoxPro) returns neither an error number nor an error message.
The commands for steps 2 and 3 will be similar to this:
   handle = DBCONNECT("<Data Source Name>","","")   && handle = SQLCONNECT("<Data Source Name>","","") in Visual FoxPro   ?DBEXEC(handle,"<Form Name>")   && SQLEXEC((handle,"<Form Name>") in Visual FoxPro				
<Data Source Name> is specified in the Lotus ODBC Setup and <Form Name>is a form that was created inside Lotus Notes. The records will be blankfor the numeric field in the cursor that was returned.
Lotus ODBC Driver help file (NOTESSQL.HLP).
VFoxWin FoxWin 2.50

Article ID: 123006 - Last Review: 02/28/2014 07:55:49 - Revision: 3.1

Microsoft Visual FoxPro 3.0 Standard Edition, Microsoft FoxPro 2.5b, Microsoft FoxPro 2.5a, Microsoft FoxPro 2.5b, Microsoft FoxPro 2.6 Standard Edition

  • kbnosurvey kbarchive kb3rdparty kbprb KB123006