LOCAL llContinue, lcSQLstr, lnCount, lcStr, jnX STORE .T. TO llContinue oHSQL = NEWOBJECT("wwHTTPSQL","wwhttpsql.prg") oHSQL.cServerUrl = gcServerUrl oHSQL.nConnectTimeout = 5 oHSQL.cSQLCursor = "cTemp" && Specify the result cursor name llContinue = VARTYPE(oHSQL) = "O" * Update invdetl.dbf records ********************************************************************* IF llContinue jnX = 0 SELECT cInvDetl GO TOP DO WHILE NOT EOF() jnX = jnX + 1 lcSQLstr = [INSERT INTO invdetl ( ] lcSQLstr = lcSQLstr + [dWorkDone,nHours,nMinutes,yRatePerHr,yItemAmt,cSubject,nInvDseq,] lcSQLstr = lcSQLstr + [nID,ninvoiceid,nuserid,cAsnName,nclientid,ntaskid,nrequserid,ncatid,] lcSQLstr = lcSQLstr + [cCategory,nsubcatid,cSubCat,dtinvoice,dateadded,dtlastupdt,username,machine)] lcSQLstr = lcSQLstr + [ VALUES ( ] lcSQLstr = lcSQLstr + DTOSTRICT(dWorkDone) + [,] lcSQLstr = lcSQLstr + ALLTRIM(STR(nHours)) + [,] lcSQLstr = lcSQLstr + ALLTRIM(STR(nMinutes)) + [,] lcSQLstr = lcSQLstr + ALLTRIM(STR(yRatePerHr,12,4)) + [,] lcSQLstr = lcSQLstr + ALLTRIM(STR(yItemAmt,12,4)) + [,] lcSQLstr = lcSQLstr + ['] +ALLTRIM(cSubject) + [',] lcSQLstr = lcSQLstr + ALLTRIM(STR(nInvDseq)) + [,] lcSQLstr = lcSQLstr + ALLTRIM(STR(nID)) + [,] lcSQLstr = lcSQLstr + ALLTRIM(STR(ninvoiceid)) + [,] lcSQLstr = lcSQLstr + ALLTRIM(STR(nuserid)) + [,] lcSQLstr = lcSQLstr + ['] + ALLTRIM(cAsnName) + [',] lcSQLstr = lcSQLstr + ALLTRIM(STR(nClientID)) + [,] lcSQLstr = lcSQLstr + ALLTRIM(STR(nTaskID)) + [,] lcSQLstr = lcSQLstr + ALLTRIM(STR(nReqUserID)) + [,] lcSQLstr = lcSQLstr + ALLTRIM(STR(nCatid)) + [,] lcSQLstr = lcSQLstr + ['] + ALLTRIM(cCategory) + [',] lcSQLstr = lcSQLstr + ALLTRIM(STR(nSubCatid)) + [,] lcSQLstr = lcSQLstr + ['] + ALLTRIM(cSubCat) + [',] lcSQLstr = lcSQLstr + DTOSTRICT(dtInvoice) + [,] lcSQLstr = lcSQLstr + DTOSTRICT(dateAdded) + [,] lcSQLstr = lcSQLstr + DTOSTRICT(dtLastUpdt) + [,] lcSQLstr = lcSQLstr + ['] + ALLTRIM(username) + [',] lcSQLstr = lcSQLstr + ['] + ALLTRIM(machine) + [')] IF llContinue THISFORM.lblStatus.CAPTION = "Saving invoice detail record #" + ALLTRIM(STR(jnX)) lnCount = oHSQL.Execute(lcSQLstr) ENDIF && llContinue IF llContinue IF oHSQL.lError llContinue = .F. MESSAGEBOX(oHSQL.cErrorMsg) ENDIF ENDIF && llContinue IF llContinue lcStr = ALLTRIM(cInvDetl.cDetail) lcSQLstr = oHSQL.AddSqlParameter("parmDescript",lcStr) oHSQL.Execute([UPDATE invdetl SET cDetail=parmDescript where ninvoiceid=] + ALLTRIM(STR(ninvoiceid)) ) ENDIF && llContinue IF llContinue IF oHSQL.lError llContinue = .F. MESSAGEBOX(oHSQL.cErrorMsg) ENDIF ENDIF && llContinue IF llContinue SELECT cInvDetl IF NOT EOF('cInvDetl') SKIP IN cInvDetl ENDIF ENDIF && llContinue ENDDO && while not eof() ENDIF && llContinue ********************************************************************* * Done updating invdetl.dbf RELEASE oHSQL CLEAR CLASS wwhttpsql