Page 24 - Acceso a MySQL desde C++
P. 24
: {
44: CString sql;
45:
46: sql.Format("DELETE FROM empresas WHERE ruc = ’%s’",ruc);
47:
48: if(mysql_real_query(
49: theApp.GetConnection()
50: ,sql
51: ,sql.GetLength()) == 0 )
52: {
53: m_report.DeleteItem(item);
54: }
55: else
56: {
57: CString strText;
58:
59: strText.Format("Error: ’%s’"
60: ,mysql_error(theApp.GetConnection()));
61:
62: MessageBox(strText);
63: }
64: }
65:
66: }
67: else
68: {
69: MessageBox("Debe seleccionar un item de la lista");
70: }
71: }

Finalmente la aplicacio´n correr´a como se ve en la Imagen 10.

Notara´n que los botones tienen un icono, es por que he utilizado la clase
CImageButton del art´ıculo que esta ubicado en:

www.latindevelopers.com/articles/vc/imagebutton/

He modificado la clase CImageButton para que acepte solo una imagen por boton.
Ademas tambien le he agregado un temporizador para hacer la busqueda mas
interactiva.

24

www.detodoprogramacion.com
   19   20   21   22   23   24   25   26