11/26/2024 3:25:15 AM
|
|
slxdeveloper.com Community Forums |
|
|
|
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 ADO specific questions for use with SalesLogix. View the code of conduct for posting guidelines.
|
|
|
|
failed to parse sql
Posted: 22 Mar 07 1:15 PM
|
fiogf49gjkf0d The bane of my existance I am doing a simple page with some pagination, vbscript asp classic, but we are using the SLXOLE SQL2005, SLX 7.0.1
This is the statement SELECT SoftwareID, PIN, SN, EndingDate, IP, Users, FirstName, LastName, Account, Email FROM v_ContractInfo WHERE accountid = 'blah'
this view works in SLX
now it parses fine, when i remove the cursor specifications when i open the recordset rs.Open sql,cnn
but if i specify curosr type and lock type, which i need to make it page, i get the failure to parse.
Any help would be appreciated |
|
|
|
Re: failed to parse sql
Posted: 22 Mar 07 1:27 PM
|
fiogf49gjkf0d SOLVED rs.CursorType=adOpenDynamic rs.CursorLocation = adUseClient
|
|
|
|
Re: failed to parse sql
Posted: 22 Mar 07 1:31 PM
|
fiogf49gjkf0d Originally posted by tj
rs.CursorLocation = adUseClient |
|
Yes, must be a client side cursor with the SLX provider, I suspect that was the main problem. |
|
|
| |
|
Re: failed to parse sql
Posted: 30 Jan 08 8:02 AM
|
I am new to SLX dev and new to VBScript. I am upgrading from SLX5 to SLX7. I am getting this same error but do not understand enough to emplement this fix. If anyone could elaberate on this I would be grateful. I am trying to set a field called tempOpp in a table called contact_Extended to use in a Contact Mailmerge that follws a button press. Here is the code: This code works in 5 but fails in 7.
Global Const IDYES = 6 Global Const IDNO = 7 Global Const Debug = 0 Global Const LoopSafetyLimit = 200 Global Const ProcName = "Opportunity:MailMergeCurrentOpportunity"
sub main
dim a as integer dim b as integer dim iTabs as Integer dim sComment as string dim sSQL as string dim sTitle as string dim sValue as string dim vTemp as variant
On error goto ErrorHandler
If Debug then Open "c:\program files\saleslogix\Debug_" & CurrentUserId & ".txt" for Append as #1 If Debug then Print #1, ProcName & ":Start " & Now
if CurrentOpportunityId <> "" then if CurrentContactId <> "" then 'Set Current Contact Record with CurrentOpportunityId sSQL = "UPDATE CONTACT_EXTENDED SET TEMPOPPORTUNITYID = '" & CurrentOpportunityId & "'" _ & " WHERE CONTACTID = '" & CurrentContactId & "'" if debug then print #1, " sSQL: " & sSQL dbExecuteSQL sSQL
......
Here I get a parse error. Any input would be apreaciated as well as resorce tips for a new SLX developer. I am a C# developer. Thanks in advance.
|
|
|
|
Re: failed to parse sql
Posted: 30 Jan 08 3:46 PM
|
This does not look like VBScript to me - for example, VBScript variables are untyped, so
Dim a as integer would simply be Dim a
etc etc
Also, what does dbExecuteSQL do? This is not a standard SLX sub AFAIK.
If you could post the contents of sSQL that cause the error, that would also be useful.
Resources for a new developer? One thing I often do is check existing code - you will find that most things that you want to do have been done before - you just need to track down the form/script and work out how.
You'll also find MS documentation here: http://msdn2.microsoft.com/en-us/library/d1wf56tt.aspx
Finally, DevLogix is specific to SLX development and will definitely be an asset to you, see link: http://www.cafepress.com/DevLogixShop
Phil |
|
|
|
Re: failed to parse sql
Posted: 31 Jan 08 7:17 AM
|
Yea this is not VBScript, it is slotted as basic legacy in architect. It appears that I now need a new line added at certain points in the sql. & Char(13) &. I have gotten the first slq sting to pars but not the second. I think I will try to rewrite this in VBScript. This script is fired when a button is pressed in the menu bar. It is designed to tie a contact to an opportunity for a mail merge to follow.
It appears that dbExecuteSQL sSQL runs the sequel statement against the database.
I will defiantly check out DevLogix.
sSQL failed = UPDATE CONTACT_EXTENDED SET TEMPOPPORTUNITYID = 'OQA26A0000N7' WHERE CONTACTID = 'CHZ2KA0000QY'
sSQL worked = UPDATE CONTACT_EXTENDED SET TEMPOPPORTUNITYID = 'OQA26A0000N7' WHERE CONTACTID = 'CHZ2KA0000QY'
Thank you for your reply.
|
|
|
|
Re: failed to parse sql
Posted: 31 Jan 08 11:06 AM
|
I re-wrote the code in VBScript but I am still getting a parse error. Here is the code.
sub main
dim sComment
if Application.BasicFunctions.CurrentOpportunityID <> "" then if Application.BasicFunctions.CurrentContactID <> "" then
'Set Current Contact Record with CurrentOpportunityId Set rs = CreateObject("ADODB.Recordset") With rs Set .ActiveConnection = Application.GetNewConnection .CursorLocation = adUseClient .CursorType = adOpenStatic .LockType = adLockOptimistic .Open "SELECT * FROM CONTACT_EXTENDED WHERE CONTACTID = '" & Application.BasicFunctions.CurrentContactID & "'"
If .RecordCount = 0 Then .AddNew .Fields("CONTACTID").Value = Application.BasicFunctions.CurrentContactID .Fields("createuser").Value = Application.BasicFunctions.CurrentUserID .Fields("createdate").Value = Now End If
.Fields("modifyuser").Value = Application.BasicFunctions.CurrentUserID .Fields("modifydate").Value = Now .Fields("TEMPOPPORTUNITYID").Value = Application.BasicFunctions.CurrentOpportunityID
.Update
.Close End With Set rs = Nothing
Set rs = CreateObject("ADODB.Recordset") With rs Set .ActiveConnection = Application.GetNewConnection .CursorLocation = adUseClient .CursorType = adOpenStatic .LockType = adLockOptimistic .Open "Select OPP.DESCRIPTION, POL.POLNONEW, POL.EFFDATE FROM OPPORTUNITY OPP LEFT JOIN POLICIES POL ON OPP.OPPORTUNITYID = POL.OPPORTUNITYID WHERE OPP.OPPORTUNITYID = '" & Application.BasicFunctions.CurrentOpportunityID & "'"
If .RecordCount = 1 Then sComment = .Fields("EFFDATE").Value & ")" sComment = sComment & ": " & .Fields("POLNONEW").Value sComment = sComment & " (" & .Fields("EFFDATE").Value & ")" End If
.Close End With Set rs = Nothing 'Now fire the standard mail merge form with these defaults Application.BasicFunctions.CreateDocument "PRINTER", Application.BasicFunctions.CurrentContactID, "CONTACT", "", sComment, 1
else msgbox "You must first select a contact before using this feature.", 0, "No Current Contact" end if else msgbox "You must first select an opportunity before using this feature.", 0, "No Current Opportunity!" end if
end sub
-------------------------------------
There are two queries here. I can comment out either one but I still get a parse error. I am using recordset sttings I have seen in example code but I dont fully understand thier impact. Any help would be apreciated. |
|
|
|
Re: failed to parse sql
Posted: 31 Jan 08 11:18 AM
|
After commenting out most of the code I found that my issue with with the CreateDocument call. Im not sure why I am getting a parse error with this. The Dev Ref does not go in to much detail regarding the parameters. Has anyone run in to this issue before? |
|
|
|
Re: failed to parse sql
Posted: 31 Jan 08 2:05 PM
|
For anyone with a similar issue. I changed "CONTACT" to "CONTACTID" in the call to create document. This made the parse error go away. SLX documentation does not reflect this change in parameters for CreateDocument from 5.2 to 7.2. The parameter name is EntityIDType.
|
|
|
|
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!
|
|
|
|
|
|
|
|