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!
|
|
Failed to parse SQL in managed Form when no SQL script was executed
Posted: 18 Sep 06 12:01 PM
|
fiogf49gjkf0d I'm building a new managed form for the AccountProduct view where I manage 2 additional tables based on the accountproduct table which contains additional fields for the accountproduct table and a history file as audit file. I'm controlling when writing the records within the scripts I have.
If gStrMode = "Add" Then 'DNL strSQLP = "Select * From AccountProduct Where 1=2" 'DNL Else strSQLP = "Select * From AccountProduct Where ACCOUNTPRODUCTID = '" & frmAdd_Edit_nu_AccountProduct.CurrentID & "'" 'DNL End If
' Write / Update AccountProduct Table Set objRSP = objSLXDB.GetNewRecordSet objRSP.Locktype = adLockBatchOptimistic objRSP.Open strSQLP, objSLXDB.Connection
If gStrMode = "Add" Then 'DNL objRSP.AddNew objRSP.Fields("ACCOUNTPRODUCTID").Value = frmAdd_Edit_nu_AccountProduct.CurrentID 'DNL objRSP.Fields("PRODUCTID").Value = txtProductId.Text'DNL objRSP.Fields("CREATEDATE").Value = Now 'DNL objRSP.Fields("CREATEUSER").Value = Application.BasicFunctions.CurrentUserID 'DNL objRsP.Fields("ACCOUNTID").Value = Application.BasicFunctions.CurrentAccountID End If
if IsNumeric(txtQuantity.text) then objRSP.Fields("QUANTITY").Value = txtQuantity.Text 'DNL end if
objRSP.Fields("SERIALNUMBER").Value = txtSerialNumber.Text 'DNL objRSP.Fields("USERFIELD2").Value = plStatus.Text 'DNL objRSP.Fields("USERFIELD3").Value = txtQuantity.Text 'DNL objRSP.Fields("USERFIELD4").Value = dtStartDate.Text 'DNL objRSP.Fields("USERFIELD5").Value = dtEnddate.Text 'DNL objRSP.Fields("USERFIELD8").Value = txtMaintenanceUSD.Text 'DNL
objRSP.Fields("MODIFYUSER").Value = Application.BasicFunctions.CurrentUserID 'DNL objRSP.Fields("MODIFYDATE").Value = Now 'DNL
objRSP.UpdateBatch Set objRSP = Nothing
Set objRS = objSLXDB.GetNewRecordSet objRS.Locktype = adLockBatchOptimistic
If gStrMode = "Add" Then 'DNL strSQL = "Select * From nu_Account_Product Where 1=2" 'DNL Else strSQL = "Select * From nu_Account_Product Where ACCOUNTPRODUCTID = '" & frmAdd_Edit_nu_AccountProduct.CurrentID & "'" 'DNL End If objRS.Open strSQL, objSLXDB.Connection
If gStrMode = "Add" Then 'DNL objRS.AddNew objRS.Fields("ACCOUNTPRODUCTID").Value = frmAdd_Edit_nu_AccountProduct.CurrentID 'DNL objRS.Fields("CREATEDATE").Value = Now 'DNL objRS.Fields("CREATEUSER").Value = Application.BasicFunctions.CurrentUserID 'DNL End If populateOBJRS objRS
objRS.UpdateBatch Set objRS = Nothing
writeauditlog frmAdd_Edit_nu_AccountProduct.ModalResult = mrOK
End Sub
Unfortunately I get when the Form ends (ModalResult = mrOK) a failed to parse SQL but I have no idea where this comes from.
Profiler also only shows this error message and nothing else.
Can someone point me in the right direction?
I tried this with a data from but got a duplicate key when the form tried to write the same record I wrote earlier. I hoped to get arround that with the managed form.
Any help? |
|
|
| |
| |
| |
|