如何使用ADO将数据插入/更新/选择到具有子表单的表单(数据表) [英] How to use ADO to insert/update/select data into a form with subform(Datasheet)

查看:76
本文介绍了如何使用ADO将数据插入/更新/选择到具有子表单的表单(数据表)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的,

我对子窗体中的ADO有疑问。我知道如何使用ADO将数据插入/更新/选择到sigin表单,但是我尝试用子表单((数据表)的形式来做。我不知道如何插入/更新/选择将记录集数据导入子表单(数据表),特别是插入/更新。有人可以给我一个想法或示例代码给我吗?感谢你的帮助。



操作系统: Windows XP + SP2 + Access 2003 + SP2

数据库:MS SQL Server 2000 + SP4

解决方案

mainform的属性如recordsource可以引用Me.recordsource引用

对于这种主形式上的子表单,您需要:Me!< subformname> .Form.recordsource


Nic; o)


嗨Nico,


我把它放在一起很麻烦。

这就是我所拥有的:

展开 | 选择 | Wrap | 行号


嗯,请确保str包含一个有效的SQL Select字符串,并验证子表单的名称(参见属性窗口中的Other选项卡下面)是我之后使用的名称!


Nic; o )

Dear all,
I have a question about ADO in the subform. I know how to use ADO to insert/update/select data into the sigin form, but wehn I try to do it in the form with subform((Datasheet). I don''t have any idea how to insert/update/select the recordset data into the subform(Datasheet), especially insert/update. Would someone can give me a idea or sample code to me? Appreciate your help.


OS: windows XP +SP2+ Access 2003+SP2
Database: MS SQL Server 2000+SP4

解决方案

The mainform''s properties like recordsource can be referenced with the "Me.recordsource"
For the subform on such a mainform you need: "Me!<subformname>.Form.recordsource"

Nic;o)


Hi Nico,

I''m having trouble putting this together.

This is what I''ve got:

Expand|Select|Wrap|Line Numbers


Hmm, make sure that "str" contains a valid SQL Select string and also verify that the name of the subform (See under "Other" tab in properties window) is the name used after the Me!

Nic;o)


这篇关于如何使用ADO将数据插入/更新/选择到具有子表单的表单(数据表)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆