Discussion Locked

Undefined Function Error

0 helpful
7 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
In a VB program I am working on, I am getting the following error on a Windows ME machine when I attempt to save data from a grid to a record set: Error No: -2147217900, Undefined function 'round' in expression. Any suggestions?

7 replies

by sl-campbell

How is the data being save?
Are you using a parameter query?

Are you writing the Sql statement? Is so, do a debug and show me what the sql statement looks like.

If not, tell me exactly how the data is being saved - through the grid's edit/new record method or by using the Update method on a record set.

by sl-campbell

By the way, if you are using the round function in a sql select statement and are using DAO 3.50, (ver. 3.50.3602.0) then DAO will return this exact error message.

The solution would be to change the DAO to 3.51 - I am using 3.51.1608.0.
When I change reference to the 3.50 then this error comes up, but when I change to the 3.51 version the error doesn't happen and the function works properly.

If you are not using the round function in a sql statement, then maybe another component is.In any case I would change to DAO 3.51 or higher.

by maxwell edison

Visual Basic does not recognized these as Visual Basic functions because they were incorrectly referenced in the financial DLL file (MSAFINX.DLL) that ships with Visual Basic.

To workaround the problem, declare the NPVC, IRRC, and MIRRC functionslocated in MSAFINX.DLL and alias them as NPV, IRR, and MIRR respectively. The code provided in the More Information section below demonstrates how to declare and call these functions.

See this Microsoft article:

http://support.microsoft.com/default.aspx?scid=kb;en-us;Q101245

(REMOVE SPACES from the pasted URL.)

Maxwell

This discussion is closed to new replies.