On Fri, 26 Oct 2012 01:25:24 +0000, YAN HONG YE <yanhong...@mpsa.com> wrote:
>char bh1[320]; >memset(bh1,0,320); >strcpy(bh1,"sqlite3 -html -header t9_engine.db \"select >id,partnumber,substr(\'<img src=\"\'||pic||\'\" height=220/>\',1,180) as >img,pcs from engine where id>7;\" >> n.html"); >system(bh1); //here couldn't work > >error: >sqlite3 -html -header t9_engine.db "select id,partnumber,substr('<img >src="'||pi >c||'" height=220/>',1,180) as img,pcs from engine where id>7;" >> n.htmlError: >n >ear "'<img src='": syntax error >'pic' is not recognized as an internal or external command, >operable program or batch file. >The system cannot find the path specified. >char bh1[320]; >memset(bh1,0,320); >strcpy(bh1,"sqlite3 -html -header t9_engine.db \"select >id,partnumber,substr(\'<img src=\"\'||pic||\'\" height=220/>\',1,180) as >img,pcs from engine where id>7;\" >> n.html"); >strcpy(bh1,"sqlite3 -html -header t9_engine.db \"select id,partnumber,'<img >src='||pic||' height=220/>' as img,pcs from engine where id>7;\" >> n.html"); >system(bh1); //here could work >the result is: ><TR><TD>8</TD> ><TD>AA34841687 000 INSONO-SOUS-MOTEUR--</TD> ><TD><img src=C:\t9\images\INSONO-SOUS-MOTEUR.jpg height=220/></TD> >//here I wanna add " char between 'C:\t9\images\INSONO-SOUS-MOTEUR.jpg' ><TD>1</TD> ></TR> > >and the best way is change >< to < >> to > You will never get that right. Quoting will always stay a problem. Forking out from C to a shell is bad practice. Forking out to a DOS shell is a headache. It's not SQLite related and off topic in this list. Nevertheless, Michael Black did provide a working solution on Wed, 24 Oct 2012 15:09:24 +0000, did you read it? Please have a look at the sample C code I linked to before. There are more examples there. http://icculus.org/~chunky/stuff/sqlite3_example/ Good luck! -- Groet, Cordialement, Pozdrawiam, Regards, Kees Nuyt _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users