Home > Software engineering >  How to write the MFC SQL statements
How to write the MFC SQL statements

Time:09-22

 cstrings mid=2; 
_bstr_t STRSQL="SELECT * FROM [name] WHERE [id]='" + mid +"' ";


The mid yes here in the form of an integer variables, but in the table field [id] is integer, run after prompt "data type mismatch", should be how to rewrite,
In addition, if behind "[id]=" stitching Numbers, how should write expression, thank you

CodePudding user response:

 
Int mid=2;
Cstrings SQL;
SQL. The format (" SELECT * FROM [name] WHERE [id]=% d ", mid);

CodePudding user response:

String formatting sprintf
  • Related