Consultor Eletrônico



Kbase P91909: ** Unbalanced " or ' characters or incomplete \ in parm list. (1249)
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   8/24/2004
Status: Unverified

SYMPTOM(s):

** Unbalanced " or ' characters or incomplete \ in parm list. (1249)

This error usually occurs when you use the parmfile (-pf) startup parameter to read PROGRESS parameters from a file. One line of the file contains a " or a ' without a matching " or ', or there is a ~ or \ character that is not followed by one of t, r, n, E, b, f, or a 3-digit octal number.

Unable to execute CONNECT statement. (325)

An error occurred while trying to connect to a database. This message is usually preceded by one that describes the error in more detail.

Executing code that includes:

v-constr = '-pf ' + pfname + '-U "' + puserid + '"' + '-P "' + ppaswrd + '"'.
connect value(v-constr) no-error.

where the password field ppaswrd contains a double quote " at the end of it:
123"

CAUSE:

Wrong syntax. Single quotes need to be used properly to enclose the character values of the variables in the connect statement if one of the fields contain a double quote character.

FIX:

/*
This procedure connects to the sports2000 demo database using a .pf file and a user password that ends with the double quote character.

The .pf file in this sample has the following single line naming the database:
-db C:\WRK91D\sports2000.

The code assumes that the database is already running in multi-user mode.

note:
CHR(32) is the space character ' '.
CHR(34) is the double quote character: ".
CHR(39) is the single quote character: '.
*/

DEFINE VARIABLE pfFileName AS CHARACTER NO-UNDO.
DEFINE VARIABLE cUserid AS CHARACTER NO-UNDO.
DEFINE VARIABLE cUserPassword AS CHARACTER NO-UNDO.
DEFINE VARIABLE cConnectionString AS CHARACTER NO-UNDO.

ASSIGN
pfFileName = "myfile.pf"
cUserid = "new"
cUserPassword = '123"'
cConnectionString =
'-pf' + CHR(32) + pfFileName + CHR(32) +
'-U' + CHR(32) +
CHR(39) + cUserid + CHR(32) + CHR(39) +
'-P' + CHR(32) + CHR(39) + cUserPassword + CHR(39).

MESSAGE cConnectionString
VIEW-AS ALERT-BOX INFO BUTTONS OK.

CONNECT VALUE(cConnectionString).