Home > Software engineering >  MFC jmail mail to the access error
MFC jmail mail to the access error

Time:10-01

To save the mail access, email is still in front of, can save. Suddenly an error. See code:
 _bstr_t bstrBody=pMessage - & gt; HTMLBody.//here to get the mail text/HTML content 
COleDateTime oleDate=pMessage - & gt; The Date;
////////////////////////here will get email to access the database///////////////////
_variant_t RecordsAffected;
M_pRecordset. CreateInstance (" ADODB. You ");
Cstrings SQLSTR;
Cstrings date=oleDate. The Format (" % % Y - m - H: % d % % m: % S ");//COleDateTime - & gt; Cstrings
SQLSTR="INSERT INTO [email] ([owner], [postter], [subject], [body], [date]) VALUES (' parent" + + "', '" + (LPCTSTR) bstrFrom +"', '" + (LPCTSTR) bstrSubject + "', '" + (LPCTSTR) bstrBody + "', '" + date + ") ";//
M_pConnection - & gt; Execute (_bstr_t (SQLSTR), & amp; RecordsAffected adCmdText);

Have saved a few letters wrong try.. Catch the error message is
Open access [email] see, really only saved up in front of a few emails. I don't know why to this error and it is at fault: syntax errors (operator lost) in the query expression XXXX.. The contents of this XXX's email.. How come I can't read it to the wrong... What is the relationship between email. Ask ace to solve. Eating for a while

CodePudding user response:

Put the error message in baidu search box to search it,

CodePudding user response:

Plus "YongFu"?

CodePudding user response:

During a visit to ACCESS database using ADO, appear IDispatch error # 3092 error
One reason is that the SQL statement using the reserved keywords,
For example, if a table name for the User will appear the error,

Reference:
http://blog.csdn.net/qq276592716/article/details/6580438
http://blog.csdn.net/donglynn/article/details/5525214

CodePudding user response:

Content is beyond the field length?

CodePudding user response:

Or your data itself contains "

CodePudding user response:

Mainly is encoded string processing, etc., may have a character with SQL keyword conflict

CodePudding user response:

Oh don't know how to deal with the

CodePudding user response:

anthracene anthracene?
  • Related