Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
This Document is not yet Rated  Rate this Document

Error -2146824580 When Running Parameterized Query

Primary Software: LabVIEW Toolkits>>Database Connectivity Toolset
Primary Software Version: N/A
Primary Software Fixed Version: N/A
Secondary Software: N/A

Problem:
I use parameterized queries when communicating with my database, but have run into this error code.  It states "Exception occurred in ADODB.Recordset, Parameter object is improperly defined.  Inconsistent or incomplete information was provided."  What is causing this error?

Solution:
This error message is coming from the ADO layer, and is in relation to a limitation of the definition of the ADO layer.  This limitation is that you must specify all parameter values when doing a parameterized query.  If you leave any of them empty, it results in ADO trapping errors rather than using a default (or NULL) value.  Since this is defined by ADO as an error, LabVIEW cannot do anything to avoid it.

To avoid this error message, there are two choices:
  1. Use SQL statements rather than parameterized queries if empty values have to be sent.
  2. Check the string length to make sure none of the entries are null, or append a known character (such as a space or a tab) to all string inputs.


Related Links:
LabVIEW Discussion forum post:  Can't write a zero-length string to a database using parameterized query

Attachments:





Report Date: 07/27/2007
Last Updated: 07/27/2007
Document ID: 4BQHI12F

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit