R
Robert Mark Bram
Hi All!
I have the following two methods in an asp/jscript page - my problem is that
without the update statement there is no error, but with the update
statement I get the following error:
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement.
/polyprint/dataEntry.asp, line 158
I fail to understand why there is a syntax error - I am pretty sure all of
the parameters to the Open method are ok..
Any advice would be most welcome!
Rob
function modifyNewsletter()
{
var _newsletter = getParameter ("edition");
var _language = getParameter ("language");
var sql = "SELECT * " +
"FROM newsletterText " +
"WHERE (((newsletterText.pageName)='" + _newsletter + "') " +
"AND ((newsletterText.language)='" + _language + "')) " +
"order by newsletterText.paragraph asc";
var newsletterText = getRecordSetForModifyingRecords (sql);
while (!newsletterText.EOF)
{
Response.Write (newsletterText ("text") + " --- " +
newsletterText ("style") + "<br>");
newsletterText ("text") = "changed...";
// problem statement
newsletterText.Update;
Response.Write (newsletterText ("text") + " --- " +
newsletterText ("style") + "<br>");
newsletterText.MoveNext();
} // end while
// Gets a recordset for modifying records.
// Uses the adLockOptimistic lock and accepts an sql statement.
function getRecordSetForModifyingRecords (sql)
{
var rs = Server.CreateObject ("ADODB.Recordset");
rs.Open (sql, // Source
polyprintConnection, // ActiveConnection
adOpenForwardOnly, // CursorType
adLockOptimistic); // LockType
return rs;
} // end getRecordSetForModifyingRecords function
I have the following two methods in an asp/jscript page - my problem is that
without the update statement there is no error, but with the update
statement I get the following error:
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement.
/polyprint/dataEntry.asp, line 158
I fail to understand why there is a syntax error - I am pretty sure all of
the parameters to the Open method are ok..
Any advice would be most welcome!
Rob
function modifyNewsletter()
{
var _newsletter = getParameter ("edition");
var _language = getParameter ("language");
var sql = "SELECT * " +
"FROM newsletterText " +
"WHERE (((newsletterText.pageName)='" + _newsletter + "') " +
"AND ((newsletterText.language)='" + _language + "')) " +
"order by newsletterText.paragraph asc";
var newsletterText = getRecordSetForModifyingRecords (sql);
while (!newsletterText.EOF)
{
Response.Write (newsletterText ("text") + " --- " +
newsletterText ("style") + "<br>");
newsletterText ("text") = "changed...";
// problem statement
newsletterText.Update;
Response.Write (newsletterText ("text") + " --- " +
newsletterText ("style") + "<br>");
newsletterText.MoveNext();
} // end while
// Gets a recordset for modifying records.
// Uses the adLockOptimistic lock and accepts an sql statement.
function getRecordSetForModifyingRecords (sql)
{
var rs = Server.CreateObject ("ADODB.Recordset");
rs.Open (sql, // Source
polyprintConnection, // ActiveConnection
adOpenForwardOnly, // CursorType
adLockOptimistic); // LockType
return rs;
} // end getRecordSetForModifyingRecords function