SqlDlg.cpp 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. // SqlDlg.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "LYFZSendMsg.h"
  5. #include "SqlDlg.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. /////////////////////////////////////////////////////////////////////////////
  12. // SqlDlg dialog
  13. SqlDlg::SqlDlg(CWnd* pParent /*=NULL*/)
  14. : CDialog(SqlDlg::IDD, pParent)
  15. {
  16. //{{AFX_DATA_INIT(SqlDlg)
  17. m_sql = _T("");
  18. //}}AFX_DATA_INIT
  19. }
  20. void SqlDlg::DoDataExchange(CDataExchange* pDX)
  21. {
  22. CDialog::DoDataExchange(pDX);
  23. //{{AFX_DATA_MAP(SqlDlg)
  24. DDX_Text(pDX, IDC_EDIT1, m_sql);
  25. //}}AFX_DATA_MAP
  26. }
  27. BEGIN_MESSAGE_MAP(SqlDlg, CDialog)
  28. //{{AFX_MSG_MAP(SqlDlg)
  29. //}}AFX_MSG_MAP
  30. END_MESSAGE_MAP()
  31. /////////////////////////////////////////////////////////////////////////////
  32. // SqlDlg message handlers
  33. extern BOOL CheckBadWords(CString str);
  34. extern BOOL CheckBadWords2(CString str);
  35. void SqlDlg::OnOK()
  36. {
  37. // TODO: Add extra validation here
  38. UpdateData();
  39. CDialog::OnOK ();
  40. /*MyExecuteSQL(&g_db, m_sql);
  41. if(m_sql.GetLength ()<6)return;
  42. if(m_sql.Left (6)!="select")return;
  43. int i;CString temp,str;
  44. int colcount;
  45. CODBCFieldInfo fieldinfo;
  46. CRecordset myset(&g_db);
  47. myset.Open (CRecordset::forwardOnly, m_sql);
  48. while(!myset.IsEOF ())
  49. {
  50. colcount=myset.GetODBCFieldCount ();
  51. for( i=0; i<colcount; i++)
  52. {
  53. myset.GetFieldValue(i, temp);
  54. str+="'"+temp+"',";
  55. }
  56. str.TrimRight (",");
  57. str+="\r\n";
  58. myset.MoveNext ();
  59. }
  60. myset.Close();
  61. AfxMessageBox(str);*/
  62. }
  63. BOOL SqlDlg::OnInitDialog()
  64. {
  65. CDialog::OnInitDialog();
  66. // TODO: Add extra initialization here
  67. GetDlgItem(IDC_EDIT1)->SetFocus();
  68. return false; // return TRUE unless you set the focus to a control
  69. // EXCEPTION: OCX Property Pages should return FALSE
  70. }