我的代码:
GetDlgItem(IDC_EDIT1)->GetWindowText(m_bt);
CString str;
str.Format("insert into wz (title) values(%s)",m_bt);
m_pConnection->Execute((_bstr_t)str,NULL,adCmdText);
现在已经可以把IDC_EDIT1控件里的数据写入数据库记录里了,可是我有好几个类似控件,要一起写入同一条记录里,这怎么弄?
GetDlgItem(IDC_EDIT1)->GetWindowText(m_bt);
CString str;
str.Format("insert into wz (title) values(%s)",m_bt);
m_pConnection->Execute((_bstr_t)str,NULL,adCmdText);
现在已经可以把IDC_EDIT1控件里的数据写入数据库记录里了,可是我有好几个类似控件,要一起写入同一条记录里,这怎么弄?
解决方案 »
- com(executable类型)中调用dll后,不能创建com对象。怎么办?
- 多线程中,线程函数如何访问CListBox资源呢?帮忙看看吧
- 连接smtp服务器失败
- VC怎么样实现DOS命令行??
- UDP是非连接的协议,可是我看到一个UDP的socket照样可以象TCP一样连接发送,那么请问这有什么效果?
- 一个关于树控件和右键菜单的问题
- macromedia公司的player source code sdk谁有?
- 宏COM_INTERFACE_ENTRY_CHAIN的使用?
- 在for循环中定义的变量
- 关 于 NETMEETING SDK 的 问 题
- 关于两机之间的通讯能力的问题
- 请教一个关于“事件对象”的问题
GetDlgItem(IDC_EDIT2)->GetWindowText(m_bt1);
CString str;
str.Format("insert into wz (title,xxx...) values(%s,%s...)",m_bt,m_bt1...);
m_pConnection->Execute((_bstr_t)str,NULL,adCmdText);
m_pConnection->Execute((_bstr_t)str,NULL,adCmdText);这句调试完就出现显示unhandled exception in 0.exe
不知道问什么?是不是因为IDC_COMBO1
CString strTemp;
GetDlgItem(IDC_EDIT1)->GetWindowText(m_bt);
GetDlgItem(IDC_COMBO1)->GetWindowText(strTemp);
CString str;
str.Format("insert into wz (title,class) values(%s,%s)",m_bt,strTemp);
m_pConnection->Execute((_bstr_t)str,NULL,adCmdText);
GetDlgItem(IDC_EDIT1)->GetWindowText(m_bt);
GetDlgItem(IDC_EDIT2)->GetWindowText(m_bt1);
CString str;
str.Format("insert into wz (title,xxx...) values(%s,%s...)",m_bt,m_bt1...);
m_pConnection->Execute((_bstr_t)str,NULL,adCmdText);
这样编译没问题,运行出错。
m_pConnection->Execute((_bstr_t)str,NULL,adCmdText);这句调试完就出现显示unhandled exception in 0.exe
不知道问什么?是不是因为IDC_COMBO1
CString strTemp;
GetDlgItem(IDC_EDIT1)->GetWindowText(m_bt);
GetDlgItem(IDC_COMBO1)->GetWindowText(strTemp);
CString str;
str.Format("insert into wz (title,class) values(%s,%s)",m_bt,strTemp);
m_pConnection->Execute((_bstr_t)str,NULL,adCmdText);
[/Quote]
str.Format("insert into wz (title,class) values(‘%s’,‘%s’)",m_bt,strTemp);
m_pConnection->Execute((_bstr_t)str,NULL,adCmdText);
m_combo.GetLBText(0,str);
我这么写了,结果编译错误error C2228: left of '.GetLBText' must have class/struct/union type
Error executing cl.exe.
可我已经定义了这个成员变量了啊