Geregistreerd: di dec 20 2005, 11:03 Woonplaats: Republic of Texas, USA berichten: 5
Albert,
Long time, no communicate!
Just when I thought you had become perfect my update statements startd failing after I upgraded to Win 7 and reinstalled Delphi 7 with your latest(?) package release: ASqlite3NullFTS200902A.zip.
I tried every way possible to blame it on the "Evil Empire" (Mickeysoft) and their latest "virus" release (Win 7.), But alas I was unsuccessful. I finally admitted when all else fails, Debug.
Seems strange to me I am the only one to report this one. I unzipped (the file that is) and reinstalled twice just to make sure.
Using the SQL update statement: "update "tableName" * Where RID = :RID" for the "ASQLite3Update" component property "UpdateSQL.", the update was failing with the error message: 'Syntax error: "where" expected'.
Stepping through the code I found the following (Highlighted in red.)
[pre] if TheWord = '*' then begin for i := 0 to FieldList.Count - 1 do SQLStr := SQLStr +FieldList[i].FieldName+'='+':'+ FieldList[i].FieldName+','; System.Delete(SQLStr, Length(SQLStr), 1);
SQLStr := SQLStr + Copy(MySQL, startpos, 9999); end else begin if not SyntaxCheck(TheWord, 'set') then raise AsgError.Create('Syntax error: "set" expected');
I subsequently modified the highlighted code to the following: (Highlighted in blue.)
<pre> if TheWord = '*' then begin for i := 0 to FieldList.Count - 1 do SQLStr := SQLStr +FieldList[i].FieldName+'='+':'+ FieldList[i].FieldName+','; System.Delete(SQLStr, Length(SQLStr), 1);
SQLStr := SQLStr + Copy(MySQL, startpos, 9999); end else begin if not SyntaxCheck(TheWord, 'set') then raise AsgError.Create('Syntax error: "set" expected');
TheWord := GetWord(MySQL, startpos, vartype); // '=' if not SyntaxCheck(TheWord, '=') then raise AsgError.Create('Syntax error: "=" expected') else SQLStr := SQLStr + '=';
TheWord := GetWord(MySQL, startpos, vartype); // 2004-14-09 (rps) ':' or 'where' ---> if vartype = vtcDelimiter then // <--- TheWord := GetWord(MySQL, startpos, vartype); // fieldvalue if TheWord = '*' then SQLStr := SQLStr +':' + FieldId else SQLStr := SQLStr +':' + TheWord;
TheWord := GetWord(MySQL, startpos, vartype); // , or 'where' until AnsiCompareText(TheWord, 'where') = 0; if not SyntaxCheck(TheWord, 'where') then raise AsgError.Create('Syntax error: "where" expected') else SQLStr := SQLStr + ' where '; SQLStr := SQLStr + Copy(MySQL, startpos, 9999); end; Connection.SQLite3_ExecSQL(SQLStr, Fields); inherited InternalPost; // rework internals end </pre>
After about thirty seconds if intensive testing, it would appear my problem is solved. Thought I would pass this along for your consideration.
Sorry I could not get the "preformated" tags to work in this message. If you can't decipher what I've done, drop me an email, and I'll send an attachment in reply.