Business Layer Bug


Author
Message
Larry Caylor
Larry Caylor
StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)
Group: Awaiting Activation
Posts: 592, Visits: 3.7K
I'm using a browse dialog with a view. In order to be able to select a record from the results I've defined a primary key on the view that is made up of two character fields in the view; Case# and CaseLastName. This combination gives me a unique key. The issue I'm running into is that CaseLastName may contain a single quote (e.g. O'REILLY). When this happens I get an error message saying "Syntax error: Missing operand after 'REILLY' operator."

I've traced the problem to following line (2845) in BusinessLayer.vb

lcSelect &= Me.PrimaryKeyFields(lnCnt) & "='" & PrimaryKeyValues(lnCnt).ToString & "'"

I'd like to suggest the following fix to take into account that a character primary key may contain single quotes. I've added the fix locally and so far it's solved my problem and doesn't appear to introduce any other issues.

lcSelect &= Me.PrimaryKeyFields(lnCnt) & "='" & CStr(PrimaryKeyValues(lnCnt)).Replace("'", "''") & "'"

 


Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Fixed and in the next build. Thanks for the suggestion. Smile
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search