FUNCTION RunSQL LPARAMETERS tcSql, tcHoldCursor, tcIntoClause LOCAL lcErrorMsg IF VARTYPE(m.tcSql) != "C" = MESSAGEBOX("Error in executing RunSQL! " + ; "The first parameter must be character type",0,; "Error from RunSQL procedure") RETURN .F. ENDIF LOCAL llRtnVal, loEx llRtnVal = .T. IF PCOUNT() < 2 tcHoldCursor = 'cDelme' ENDIF IF EMPTY(m.tcHoldCursor) tcHoldCursor= 'cDelme' ENDIF tcSql = CHRTRAN(m.tcSql, CHR(9) + CRLF + ";"," ") IF EMPTY(m.tcIntoClause) tcSql = m.tcSql + " INTO CURSOR " + m.tcHoldCursor + " READWRITE " ELSE tcSql = m.tcSql + " INTO " + m.tcIntoClause ENDIF TRY &tcSql CATCH TO loEx _CLIPTEXT = m.tcSql lcErrorMsg = "Error in executing SQL!" + CRLF + ; Log_Error(m.loEx) + CRLF + ; "The SQL is: " + m.tcSql + CRLF + ; GetStackInfo() llRtnVal = .F. ENDTRY RETURN m.llRtnVal ENDFUNC