INF: dbwritetext Sample Code Documentation IncorrectLast reviewed: April 28, 1997Article ID: Q95125 |
The information in this article applies to:
SUMMARYThe dbwritetext documentation on page 246 and 247 of the "Programmer's Reference for C" contains incorrect sample code.
MORE INFORMATIONOn page 246, replace the last part of the code in the example, from the following lines to the end
while (dbnextrow(q_dbproc) != NO_MORE_ROWS);to read as follows:
while (dbnextrow(q_dbproc) != NO_MORE_ROWS) { /* Change the value of "abstract_var". */ strcpy(abstract_var, "A brand new value."); /* Update the text column. */ dbwritetext(u_dbproc, "articles.abstract", dbtxptr(q_dbproc, 1), DBTXPLEN, dbtxtimestamp(q_dbproc, 1), TRUE, (DBINT)strlen(abstract_var), abstract_var); } /* Done. */ dbexit();On page 247, replace the last part of the code in the example, from the following lines to the end
while (dbnextrow(q_dbproc) != NO_MORE_ROWS);to read as follows:
while (dbnextrow(q_dbproc) != NO_MORE_ROWS) { /* Change the value of part of the text column. This example */ /* adds a sentence to the end of the existing text.*/ /* Update the text column. */ dbwritetext(u_dbproc, 'articles.abstract", dbtxptr(q_dbproc, 1), DBTXPLEN, dbtxtimestamp(q_dbproc, 1), TRUE, (DBINT)(strlen(part1) + strlen(part2)), NULL); dbsqlok(u_dbproc); dbresults(u_dbproc); /* Send the update value in chunks. */ dbmoretext(u_dbproc, (DBINT)strlen(part1), part1); dbmoretext(u_dbproc, (DBINT)strlen(part2), part2); dbsqlok(u_dbproc); while (dbresults(u_dbproc) != NO_MORE_RESULTS); } dbexit(); |
Additional query words: db-lib dblib
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |