FIX: dbcursor() Fails with 10030 When Updating Character Value
  
PSS ID Number: Q105363
Article last modified on 01-24-1995
 
4.20   | 4.20 | 4.20
 
MS-DOS | OS/2 | WINDOWS
 

----------------------------------------------------------------------
The information in this article applies to:
 
 - Microsoft SQL Server Programmer's Toolkit, version 4.2
----------------------------------------------------------------------
 
BUG# 9516 (4.20.00)
 
SYMPTOMS
========
 
When attempting to update or insert a value into a char or varchar
column using cursors, the dbcursor() function fails with error 10030:
 
   Invalid parameter in DB-Library function reference.
 
CAUSE
=====
 
The function dbcursor() will reject attempts to insert or update columns
in SQL Server with character values that contains the following reserved
SQL keywords:
 
 - update
 
 - where
 
 - insert
 
unless the first character of the reserved keyword is the first
character in the string to be inserted. For example, using the SQLCURS
sample program, the following SET statements will fail:
 
   SET au_lname = "jack where jack"
   SET au_lname = " where jack"
 
However, the au_lname field can be successfully updated with the
following SET statements:
 
   SET au_lname = "jack wh"+"ere jack"
   SET au_lname = "where jack"
 
WORKAROUND
==========
 
If the desired character value contains reserved keywords, it may be
necessary to use two concatenated strings for the value to be inserted,
such that the reserved keyword is split up. If use of string
concatenation is not practical, it may be necessary to use non-cursored
methods to insert the new value, such as dbcmd() and dbsqlexec().
 
STATUS
======
 
Microsoft has confirmed this to be a problem in DB-Library version 4.20.00.
This problem was corrected in DB-Library version 4.21.00. For more
information, contact your primary support provider.
 
Additional reference words: 4.20.00 DB-Lib datatype
KBCategory: kbprg
KBSubCategory: SSrvDB_Lib SSrvProg
 
=============================================================================
 
Copyright Microsoft Corporation 1995.
