Kbase P7836: Error 201 When Using the Execute Method to Invoke a SQL Stat
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  27/01/2003 |
|
Status: Unverified
FACT(s) (Environment):
MERANT 3.50 32-BIT Progress SQL-89
SYMPTOM(s):
Running a SQL INSERT statement in Visual Basic to update a Progress database
[MERANT] [ODBC PROGRESS driver[PROGRESS]** unknown field or variable name (201)
CHANGE:
SQL statement was modified to refer to variable names defined in the Visual Basic program
CAUSE:
The Execute() method does no substitutions of variable names with the values stored in those variable names
FIX:
Modify the SQL statement being passed to the Execute() method so that there are no references to variables. All references to variables must be replaced with the actual values of those variables (including quotes around string values).
For Example,
Result = MyDB.Execute("INSERT INTO TABLE1 (FIELD1, FIELD2) VALUES(VARIABLE1, '123').")
should become
Result = MyDB.Execute("INSERT INTO TABLE1 (FIELD1, FIELD2) VALUES('" + VARIABLE1 + "', '123').")