BUG: CKSAMPLE.APP Error: Invalid Function Argument Value ...

ID: Q112080

The information in this article applies to:

SYMPTOMS

When CKSAMPLE.APP starts, it asks for information about how to connect to the data source. If an invalid data source is provided, a WAIT WINDOW with the message "Attempting to connect..." displays, then a system alert window with the following message appears:

   Invalid function argument value, type, or count.

The button choices in the window are Cancel, Suspend, and Ignore.

CAUSE

When the data connection fails, an error parameter of numeric type is passed to CKSAMPLE.APP's error-handling routine (in REPOERRO.SCX), which expects a parameter of character type.

RESOLUTION

Modify the REPOERRO.SCX screen to accept numeric parameters.

Steps to Modify REPOERRO.SCX

 1. In the Command window, type "MODIFY PROJECT CKSAMPLE.PJX" (without the
    quotation marks).

 2. Select the REPOERRO Screen Set from the list in the CKSAMPLE.PJX
    window, and then choose the Edit button.

 3. Choose the Edit button again in the next screen, and then choose OK.
    This opens the Screen Design window.

 4. From the Screen menu, choose Open All Snippets. This opens the
    Setup snippet.

 5. Locate the last line in the Setup snippet, which contains the
    following code:

       errMesg = ALLTRIM(errMesg)

 6. Change the last line to the following, which incorporates an IIF()
    function to handle both character and numeric error parameters:

       errMesg = IIF(TYPE('errMesg')="C",ALLTRIM(errMesg),errMesg)

 7. Close the REPOERRO.SCX Screen Design window.

 8. In the CKSAMPLE.PJX window, choose Build.

 9. In the Select Build Option window, choose the Build Application
    option, and then choose OK.

10. In the Enter Application Filename window, type "CKSAMPLE.APP"
    (without the quotation marks), and then choose Build.

STATUS

Microsoft has confirmed this to be a problem in FoxPro Connectivity Kit versions 2.5, 2.5a, and 2.5b for MS-DOS. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

Additional query words: FoxDos CK errmsg err msg sql server

Keywords          : kberrmsg
Version           : 2.50 2.50a 2.50b
Platform          : MS-DOS

Last Reviewed: December 10, 1998