I have a button that performs and ajax callback to a function in my XBASIC FUNCTION DECLARATIONS in a UX form:
Using the debug statement, I find that the cn.Execute(sqlINSERT, args) FAILS but do not know why? Also, the alert window to indicate "RECORD NOT ENTERD" does not come up either? Ive checked my columns in the database to make sure I didn't misspell anything, Ive checked my column types and all looks good to me.
Is there anything else I can check to figure out why this isnt working?
Code:
'Add CONTRACTOR to look-up Table function AddContractor as c (e as p) debug(1) dim cn as sql::Connection dim args as sql::Arguments dim sqlINSERT as c args.set("arg1", e.dataSubmitted.LicenseNumber) args.set("arg2", e.dataSubmitted.ContName) args.set("arg3", e.dataSubmitted.ContAddress) args.set("arg4", e.dataSubmitted.ContCity) args.set("arg5", e.dataSubmitted.ContState) args.set("arg6", e.dataSubmitted.ContZip) args.set("arg7", e.dataSubmitted.ContPhone) args.set("arg8", e.dataSubmitted.ContFax) args.set("arg9", e.dataSubmitted.ContRepFName) args.set("arg10", e.dataSubmitted.ContRepMName) args.set("arg11", e.dataSubmitted.ContRepLName) args.set("arg12", e.dataSubmitted.ContRepTitle) args.set("arg13", e.dataSubmitted.CreatedOn) args.set("arg14", a5ws_getcurrentuser()) args.set("arg15", Now()) args.set("arg16", a5ws_getcurrentuser()) flag = cn.open("::Name::DAS140") If flag = .f. then e.javascript = "alert('Could Not Establish Connection');" end if sqlINSERT = "INSERT INTO contractors (CONT_LICENSE, CONTRACTOR, CONT_ADDRESS, CONT_CITY, CONT_STATE, CONT_ZIP, CONT_PHONE, CONT_FAX, CONT_REP_FNAME, CONT_REP_MI, CONT_REP_LNAME, CONT_REP_TITLE, CREATEDON, CREATEDBY, MODIFIEDON, MODIFIEDBY) VALUES (:arg1, :arg2, :arg3, :arg4, :arg5, :arg6, :arg7, :arg8, :arg9, :arg10, :arg11, :arg12, :arg13, :arg14, :arg15, :arg16)" flag = cn.Execute(sqlINSERT, args) If flag = .f. then e.javascript = "alert('Record Not Entered');" else e.javascript = "{dialog.object}.runAction('updateCONTRACTOR_LUID');" end if flag = cn.Close() end function
Is there anything else I can check to figure out why this isnt working?
Comment