Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Monday, August 25, 2025 
 
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!
 Architect Forums - SalesLogix Scripting & Customization
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.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Scripting & Customization | New ThreadView:  Search:  
 Author  Thread: Failed to parse SQL
Marc Johnson
Posts: 252
 
Failed to parse SQLYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 04 Sep 08 2:57 PM
I'm not sure why this is failing. I've put msgboxes on all the values and everything looks good but I still get a failure to parse:
======================
sub InsertUpdateData
dim rs, strSQL
Set rs = CreateObject("ADODB.Recordset")
strDCFeeID = Application.BasicFunctions.GetIDFor("DCFEES")
strSQL = "Select * from DCFEES where DCFEESID = '" & strDCFeeID & "'"

With rs
Set .ActiveConnection = Application.GetNewConnection
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.LockType = adLockOptimistic
.Open strSQL

if .RecordCount = 0 then
.AddNew
.Fields("DCFEESID").Value = strDCFeeID
.Fields("ACCOUNTPRODUCTID").Value = txtAccountProductID.Text
.Fields("CreateUser").Value = Application.BasicFunctions.CurrentUserID
.Fields("CreateDate").Value = NOW()
End If

.Fields("ModifyUser").Value = Application.BasicFunctions.CurrentUserID
.Fields("ModifyDate").Value = NOW()
.Fields("FeeType").Value = pklDCFees.Text
.Fields("FeeAmount").Value = txtFeeAmount.Text
.Fields("FeeDate").Value = dateFeeDate.Text
.Update

.Close
End With
Set rs = nothing
End Sub
[Reply][Quote]
RJ Samp
Posts: 973
Top 10 forum poster: 973 posts
 
Re: Failed to parse SQLYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 04 Sep 08 3:12 PM
Personally I open up a Connection. Open up a RecordSet for that Connection, and then populate the recordset.
You are setting the connection for a RecordSet.....I've always set it the other way around.

DIM CN, RS
create the CN, Application.GetNewConnection
Create the RS,
RS.OPEN SQLstatement ,CONNECTION

I use .BOF, .EOF instead of RecordCount = 0....

.Fields("FeeDate").Value = dateFeeDate.DATETIME ?????

What happens in SLX Profiler?

What version of SLX?

is txtFeeAmount a legitimate number or does it have '$' and ',' in it?
[Reply][Quote]
Marc Johnson
Posts: 252
 
Re: Failed to parse SQLYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 04 Sep 08 3:30 PM
I've used this code before (thanks to of Ryan) without problems. Using the Profiler is a great idea though. Everything looks good but maybe the profiler will give me some clues.
[Reply][Quote]
Marc Johnson
Posts: 252
 
Re: Failed to parse SQLYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 04 Sep 08 3:46 PM
Fixed it.

I recycled code on the main form that launched my view. The datamode was being set there and fouling up my ADO. As soon as I removed that line it worked without error.
[Reply][Quote]
 Page 1 of 1 
  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!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 8/25/2025 8:56:02 AM