The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
|
|
|
|
Failed to Parse SQL errors
Posted: 17 Aug 06 11:35 AM
|
fiogf49gjkf0d We have recently upgraded from 5.2 to 6.2 and now are receiving a lot of Failed to Parse SQL errors. Here's a sample insert that's giving us the error:
strInsertHistorySQL = "Insert into History(HISTORYID, ACTIVITYID, TYPE, ACCOUNTID, CONTACTID, OPPORTUNITYID, ACCOUNTNAME, CONTACTNAME, " & _ "OPPORTUNITYNAME, PRIORITY, CATEGORY, STARTDATE, DURATION, DESCRIPTION, PROCESSID, PROCESSNODE, TIMELESS, " & _ "RECURRING, ACTIVITYBASEDON, USERID, USERNAME, ORIGINALDATE, RESULT, RESULTCODE, " & _ "CREATEDATE, CREATEUSER, MODIFYDATE, MODIFYUSER, COMPLETEDDATE, COMPLETEDUSER, NOTES, LONGNOTES, ATTACHMENT) Values( " & _ StringQuote(strHistoryID) & ", NULL, '262148', " & _ StringQuote(GetPropertyOf("txtAccountID", "Text")) & ", " & _ StringQuote(strContactID) & ", " & _ StringQuote("") & ", " & _ StringQuote(strAccount) & ", " & _ StringQuote(GetContactName(strContactID)) & ", " & _ StringQuote("") & ", " & _ StringQuote("NONE") & ", " & _ StringQuote(GetPropertyOf("txtFamily", "Text")) & ", GetDate(), " & _ StringQuote("15") & ", 'Information', '', '', 'T', NULL, NULL, " & _ StringQuote(currentuserid) & ", " & _ StringQuote(GetUserName(currentuserid)) & ", GetDate(), " & _ "'', '', GetDate(), " & _ StringQuote(currentuserid) & ", GetDate(), " & _ StringQuote(currentuserid) & ", GetDate(), " & _ StringQuote(currentuserid) & ", " & _ StringQuote(strHistoryNoteShort) & ", " & _ StringQuote(strHistoryNote) & ", NULL)" |
|
|
| |
| |
| |
|
Re: Failed to Parse SQL errors
Posted: 17 Aug 06 12:14 PM
|
fiogf49gjkf0d The Source is: SLXSyncService
The event is: Unable to retrieve ServiceFilePath from database. |
|
|
|
Re: Failed to Parse SQL errors
Posted: 17 Aug 06 12:33 PM
|
fiogf49gjkf0d those look unrelated to me...
is your original script an outside process with the SLx library added to the project?
c |
|
|
| |
|
Re: Failed to Parse SQL errors
Posted: 17 Aug 06 1:21 PM
|
fiogf49gjkf0d Ah, I missed this event:
Attempting to read ServiceFilePath from database connection: Provider=;Initial Catalog=;Data Source= ERROR: Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another |
|
|
|
Re: Failed to Parse SQL errors
Posted: 18 Aug 06 1:31 AM
|
fiogf49gjkf0d the service file path has absolutely nothing to do with the issue you are having. It's unrelated and simply means that it can't find the location of your sync service file. Therefore, the service for SyncServer may as well be stopped (as it's automatic). There won't be anything in the log re: your failed to parse error. You have the error already - it failed to parse the SQL. The SQL you have (a direct insert using strings etc) is just bad - as you will run into date issues. You should look at using DBEdit/DBInsert (as this is legacy) or, preferably, move to Active Script and use ADO/Paramaterised queries. To find the issue - use SLXProfiler (found in the program filesf\saleslogix folder) to "watch" this query and you will be able to capture what it's doing. But, anyway, you will still need to alter your code.
|
|
|
|
Re: Failed to Parse SQL errors
Posted: 18 Aug 06 1:36 AM
|
fiogf49gjkf0d Here's the fix for this:
This means that the sync service failed to find a required key in the registry. If you look in:
HKEY_LOCAL_MACHINE\SOFTWARE\SalesLogix\Synchronization\Services
create a new string value called "SrvcFilePath" and put the location to your SyncServices.cfg in this key then it should work. |
|
|
|
Re: Failed to Parse SQL errors
Posted: 18 Aug 06 9:51 AM
|
fiogf49gjkf0d If you don't want to use the profile, you could add a MsgBox statement to dispaly the SQL statement. You should be able to see the syntax problem. It is usually a date, or an embedded single-quote. |
|
|
|
Re: Failed to Parse SQL errors
Posted: 21 Aug 06 4:03 PM
|
fiogf49gjkf0d Being the originator of the post there, the issue only affected a clean 6.1 install. I don't upgrade SLX: I uninstall, clean out registry and file locations and start from scratch. I did the same process for our 6.2 install on the same machine the error originated and it did not come back. This suggested to me that the issue was only affecting 6.1 installs but it's possible that it could affect later versions.
Insert statements choke on most memo fields and is more likely the problem unless they're always NULL. Usually the problem is when users enter special characters which introduce an escape in your command. Debugging that is fun because you may be typing perfectly okay text but your users probably won't. |
|
|
|
Re: Failed to Parse SQL errors
Posted: 23 Aug 06 6:28 AM
|
fiogf49gjkf0d Single quotes are the most common problem. You might want to make a function to search every value for single quotes and replace them with 2 single quotes. For example if you have a last name O'Brien you need to write it in the query as O''Brien. |
|
|
| |
| |
|
Re: Failed to Parse SQL errors
Posted: 25 Jan 11 5:44 PM
|
fiogf49gjkf0d FYI on Windows server 2008 systems(64-bit) the registry key location has changed to HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\SalesLogix\Synchronization\Services |
|
|
|
You can
subscribe to receive a daily forum digest in your
user profile. View the site code
of conduct for posting guidelines.
Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
|
|
|
|
|