3/17/2026 5:28:26 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 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
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 |
|
|
|
Re: Failed to parse SQL
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? |
|
|
|
Re: Failed to parse SQL
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. |
|
|
|
Re: Failed to parse SQL
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. |
|
|
|
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!
|
|
|
|
|
|
|
|