有关 Virtual Recordset.

liyang 2000-08-10 04:10:00


各位,有没有能在内存中创建虚拟recordset或table,并且可以进行sql 语句查询的方法。

当然,ado本身有一种 none connection的recordset

即:
dim astTemp as new adodb.recordset

astTemp.CursorLocation = adUseClient
astTemp.Fields.Append "T1", adBSTR
astTemp.Fields.Append "T2", adDouble
astTemp.Fields.Append "T3", adInteger
astTemp.Open
astTemp.AddNew
astTemp(0) = "Test1"
astTemp(1) = 3.14159165
astTemp(2) = 512
astTemp.Update


但是,我要recordset有甚么用呢?

比如,我想求字段和怎么办?

un1 ,tophead,bluewater 和其他高手们请赐教!多谢。
...全文
139 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
Un1 2000-08-11
  • 打赏
  • 举报
回复
Sorry! 这个问题我不会。
killerl 2000-08-11
  • 打赏
  • 举报
回复
为什么要虚拟recordset?能详细说一说吗?
我用SQL语句很复杂的问题都能处理!
huntout 2000-08-11
  • 打赏
  • 举报
回复
可以變通一下,不一定要用表,用數組等方法就不能實現嗎?
liyang 2000-08-11
  • 打赏
  • 举报
回复
不好意思。

建立物理数据是不行的。

因为,这个应用,每5ms就要写一次数据库。如果写在硬盘上,555,可想而知!
liyang 2000-08-11
  • 打赏
  • 举报
回复
这样的。

因为我要根据每一条信息的某一个值进行排序,要根据某一个值对另一个值进行汇总。

即 select f1,sum(f2)/count(*) from table1 where f1=MyValue1 group by f1 order by f1
liyang 2000-08-11
  • 打赏
  • 举报
回复
这样的。

因为我要根据每一条信息的某一个值进行排序,要根据某一个值对另一个值进行汇总。

即 select f1,sum(f2)/count(*) from table1 where f1=MyValue1 group by f1 order by f1

共有1500条纪录
用数据库,只要1s即可。

用数组,4s以上
无言无忌 2000-08-10
  • 打赏
  • 举报
回复
就象当初FoxPro的
Select ... From ... INTO CURSOR (dbfname)... 或
Create Cursor ...
象我刚从FoxPro转到VB平台时,老想这样的方法,但让我失望的是,没有!!!

我的解决方法是:在本地建立一物理数据,但它的作用永远是供暂时存数据用,用完即删并定期对其进行压缩以回收磁盘空间。

如果是单纯的求和可用单纯的sql语句进行
Select Sum(...),Count(...) From ... Where ...
它会自动建立虚拟的表,用完自动删除,详细说明可参阅相关HELP或MSDN!
1,01.zipCalling Stored Procedures调用存储过程(8KB)2,02.zipCreate Access data source name dynamically动态创建Access的数据源名(5KB)3,03.zipUsing DAO to read data sources other than MS Access使用DAO读MS Access以外的数据源(6KB)4,04.zipHow to use RecordSets without using the AppWizard at the creation of your project不用AppWizard如何使用RecordSets(11KB)5,05.zipDetermine if DAO Jet engine version 3.5 is installed检测DAO Jet引擎3.5版是否安装(5KB)6,06.zipClasses for direct SQL calls with ODBC在direct SQL类中调用ODBC(5KB)7,07.zipUsefull addons to CDaoTableDef关于CDaoTableDef的话题(4KB)8,08.zipThe Generic Recordset普通的数据集(Recordset)(5KB)09,09.zipPrint Mailing Labels打印邮件标签(8KB)10,10.zipRFX_Date alternative关于RFX_Date(4KB)11,11.zipRFX_Date using COleDateTime使用COleDateTime(6KB)12,12.zipSample Database Program Using Dialog Interface基于对话框的数据库编程(11KB)13,13.zipStoring "Paint Brush" images in a Access DB在Access DB中存储画笔图象(5KB)14,14.zipA class to call stored procedures that do not return records一个调用存储过程的类(6KB)15,15.zipTips: ODBC & Access databaseODBC和Access数据库的使用技巧(5KB)16,16.zipUsing DBGrid in unbound mode在unbound模式下使用DBGrid(6KB)17,ADORsWizard.zipADO Data Bound Class Wizard(39KB)18,ISQLADO.zipA tool that allows you to query OLE DB sources(612KB)19,oledb-1.zipADO seems to be the ideal way to expose tabular data from your own COM objects and the ATL OLE DB Provider templates can help! (41KB)20,oledb-2-1.zipThe ATL OLE DB Provider templates appear to rely on the fact that your data is kept in a simple array, but that's not really the case at all! (42KB)21,oledb-3.zipAdding bookmark functionality is relatively easy and it enables our ADO recordset to be used with a greater number of data bound controls. (52KB)
<% if request.cookies("username")="" then response.redirect "login.asp" end if function htmlencode(str) htmlencode=replace(replace(str,chr(13),"
"),"'","''") end function dim rs,sql set rs=server.createobject("adodb.recordset") if request.querystring="add" then if request("title")="" then response.write "
没有填写完必须的内容!新闻没有保存...
" else sql="select * from news where id is null" rs.open sql,conn,1,3 rs.addnew rs("cataid")=request("cataid") rs("title")=request("title") rs("adddate")=date() rs("content")=htmlencode(request("content")) rs("hits")=1 rs.update rs.close response.write "
新闻已经成功保存了...
" end if end if %> 添加新闻
新闻类别:
新闻标题:
新闻内容:
[返回主页]
本方案用提供Delphi7与.NET程序的协同开发, .NET程序开发服务端, Delphi7客户端。客户端只需实现界面、用户输入操作 及错误显示(提示),其他操作(包括对客户端数据集或者单条记录的校验都是发回到服务端进行的)都在服务端完成。服务端 支持部署在Web服务器(IIS, Webservice)或者独立服务器(可作为Windows程序独立运行或者Windows服务运行,TCP协议)。 "友一分销管理系统"是基于该框架实现的,详见"POS管理用户手册.doc",初始设置见"Readme.doc"。 一 .NET(C#)服务组件说明 .NET(C#)服务组件开发基于DotNetFrame4.0, 服务端集成Castle实现对AOP的支持。只要在项目中引用BuleCommon.dll程序集, 类(Class)继承于BuleCommon.BuEntity.BuEntityObj, 并且在类和方法前指定[BuleCommon.BuEntity.BuEntityAttribute()] 特性, 实现Bule_EntityRegClass : IBule_EntityRegClass注册类完成服务组件注册即可。 服务组件类框架: using BuleCommon; using BuleCommon.BuEntity; namespace BuJxcData { [BuEntity()] //使客户端能获取该服务组件(class) public class BuIOBillValidate : BuEntityObj { [BuEntity(BuEntityMethod.bemValidate)] //使客户端能获取该服务组件单记录校验方法 public virtual bool Buf_CallCalcFields(ref BuleEntityCall EntityData, ref BuRecordSet RecordSet) { } [BuEntity(BuEntityMethod.bemValidates)]//使客户端能获取该服务组件多记录校验方法 public virtual bool Buf_RefreshPriceList(ref BuleEntityCall EntityData, ref DataSet ds) { } } [BuEntity()] //使客户端能获取该服务组件(class) public class BuCustomers : BuEntityObj { [BuEntity(BuEntityMethod.bemGetName)]//使客户端能获取该服务组件根据代码获取信息方法 public BuRecordSet Buf_GetCustData(ref BuleEntityCall EntityData) { } } [BuEntity()]//使客户端能获取该服务组件(class) public class BuStockCgInBill : BuEntityObj { [BuEntity(BuEntityMethod.bemOpen)]//使客户端能获取该服务组件打开方法 public virtual DataSet Buf_OpenBillData(ref BuleEntityCall EntityData) { } [BuEntity(BuEntityMethod.bemSave)]//使客户端能获取该服务组件保存方法 override public bool Buf_SaveBillData(ref BuleEntityCall EntityData, ref DataSet ds) { } [BuEntity(BuEntityMethod.bemAudit)]//使客户端能获取该服务组件审核方法 public bool Buf_SaveCgInAuditBill(ref BuleEntityCall EntityData, ref DataSet ds) { } } } 二. Bule VCL组件说明 1.Bu_ClientObj 用于提供模块注册信息(模块名称,子系统编号,模块编号等)及访问服务器的方法(通
Contents Chapter 1: The Microsoft Developer Studio The Microsoft Developer Studio The Project Workspace Project Workspace Window Project Configurations Managing Complex Projects Project Settings Converting Projects Source Code Files Resource Scripts ResourceView Creating New Resources Identifying Resources Dialog Boxes String Tables Accelerator Tables Menus Icons, Bitmaps and Cursors Version Resources Custom Resources The Visual C++ Compiler Compiling on the Command Line The Foundation Classes MFC Source Code Header Files MFC Libraries Summary Chapter 2: The Wizards and The Gallery AppWizard Starting AppWizard Choosing Your Application's User Interface Selecting Database Support Adding Compound Document Support Embellishing Your User Interface Adding Advanced Features Miscellaneous Options Class Names One More Step Other Application Interfaces Choose Carefully! Compiling Your Application Precompiled Header Files ClassWizard Creating a New Class The .clw File The Browser Browser Files Browsing Shortcuts Components and Controls Gallery Summary Chapter 3: The Application Architecture Hierarchy The Application Framework Generating an Application with AppWizard Understanding the Generated Code CDocument and CView CWinApp CWinThread Locating Threads CCmdTarget Commands for Classes About Message Maps How are Message Maps Created? The BEGIN_MESSAGE_MAP() Macro Inside the Message Map Filling the Holes The END_MESSAGE_MAP() Macro Unfolding the Map There's No Sense of Obligation CObject Memory Management Debugging Support Serialization Run-time Type Information Your Own Classes and CObject The Big Picture: A New Life The WinMain() Function MFC's Message Pump Application Termination Summary Chapter 4: The Document/View Architecture Documents and Views Document/View Designs The Different Views Types of Document Document/View Consciousness What are Document Templates? CSingleDocTemplate S

7,762

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧