123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- // SqlDlg.cpp : implementation file
- //
- #include "stdafx.h"
- #include "LYFZSendMsg.h"
- #include "SqlDlg.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // SqlDlg dialog
- SqlDlg::SqlDlg(CWnd* pParent /*=NULL*/)
- : CDialog(SqlDlg::IDD, pParent)
- {
- //{{AFX_DATA_INIT(SqlDlg)
- m_sql = _T("");
- //}}AFX_DATA_INIT
- }
- void SqlDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(SqlDlg)
- DDX_Text(pDX, IDC_EDIT1, m_sql);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(SqlDlg, CDialog)
- //{{AFX_MSG_MAP(SqlDlg)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // SqlDlg message handlers
-
- extern BOOL CheckBadWords(CString str);
- extern BOOL CheckBadWords2(CString str);
- void SqlDlg::OnOK()
- {
- // TODO: Add extra validation here
- UpdateData();
-
- CDialog::OnOK ();
- /*MyExecuteSQL(&g_db, m_sql);
- if(m_sql.GetLength ()<6)return;
- if(m_sql.Left (6)!="select")return;
- int i;CString temp,str;
- int colcount;
- CODBCFieldInfo fieldinfo;
- CRecordset myset(&g_db);
- myset.Open (CRecordset::forwardOnly, m_sql);
- while(!myset.IsEOF ())
- {
- colcount=myset.GetODBCFieldCount ();
- for( i=0; i<colcount; i++)
- {
- myset.GetFieldValue(i, temp);
- str+="'"+temp+"',";
- }
- str.TrimRight (",");
- str+="\r\n";
- myset.MoveNext ();
- }
- myset.Close();
- AfxMessageBox(str);*/
- }
- BOOL SqlDlg::OnInitDialog()
- {
- CDialog::OnInitDialog();
-
- // TODO: Add extra initialization here
- GetDlgItem(IDC_EDIT1)->SetFocus();
- return false; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }
|