one of methods of query table a and table b
来源:互联网 发布:java躲避子弹素材 编辑:程序博客网 时间:2024/05/18 09:16
多表查询不需要建立CRecordset的派生类,直接用CRecordset就好了 CDatabase db; db.OpenEx("Driver={Microsoft Access Driver(*.mdb)};DBQ=C:\\temp\\onega.mdb;"); CRecordset rs(&db); rs.Open(AFX_DB_USE_DEFAULT_TYPE,"select id,name From table1, table2where table1.uid = table2.uid"); int nfieldcount=rs.GetODBCFieldCount(); CString msg; msg.Format("There are %d fields in table1",nfieldcount); AfxMessageBox(msg); //field 0 is int field,name "intfield",retrieve by field index CDBVariant dbvar; rs.GetFieldValue((short)0,dbvar); //field 1 is string field,name "strfield",retrieve by field name CString dbstrvar; rs.GetFieldValue("strfield",dbstrvar); msg.Format("field 0 value:%d,field name strfieldvalue=%s",dbvar.m_iVal,dbstrvar); AfxMessageBox(msg); rs.Close(); db.Close();如果你习惯于通过wizard建立派生类,在选择表的时候可以选择多个表!然后修改派生类的GetDefaultSQL() 让他使用你需要的sql
- one of methods of query table a and table b
- PLSQL Tools for query primary key and foreign key of a table
- The PK of a table
- a sample of pc table
- ORA-01754: a table may contain only one column of type LONG
- View the structure of the table and Alter table
- Reading table information for completion of table and column names
- Table of Notes and Domino known limits
- Select a table of certain webpage
- Oracle: check the structure of a table
- apache openoffice Creating a table of contents
- 22.You need to create a table for a banking application. One of the columns in the table has the fol
- Query index for a table
- hive 使用oralce 存储元数据报错a table may contain only one column of type LONG
- Table of Contents 目录
- Table of ASCII Characters
- Table of ASCII Characters
- Table of Contents
- do…while(0)的妙用
- 2013 又一个365
- zip,obfuscate,war的ant脚本
- js中文乱码怎么解决?
- java虚拟机类加载器介绍
- one of methods of query table a and table b
- 关于字符串左移的解法
- 从flv文件中提取音频并存储为mp3格式
- 如何学好C语言
- IE系列下z-index失效问题
- Fedora17 的U盘安装方法
- overload
- Fedora 安装附加字体
- grep与正则表达式