⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 11004.html

📁 VB技巧问答10000例 VB技巧问答10000例
💻 HTML
字号:
<html>
  <head>
    <title>Re: 如何在一个DBGRID使用两个资料表(具关联性的)</title>
  </head>
  <body bgcolor="#FFFFFF" vlink="#808080">
    <center>
      <h1>Re: 如何在一个DBGRID使用两个资料表(具关联性的)</h1>
    </center>
<hr size=7 width=75%>

<hr size=7 width=75%><p>
Posted by <a href="mailto:XZDAI@HOTMAIL.COM">KEVIN</a> on March 16, 1999 at 14:58:27:<p>
In Reply to: <a href="10889.html">Re: 如何在一个DBGRID使用两个资料表(具关联性的)</a> posted by AndyLin on March 12, 1999 at 09:28:36:<p>
: : 请问一下,如何在一个DBGRID使用两个资料表(具关联性的),谢谢您的指导<p>: 如果你在 dbgrid 中只浏览而不修改,则只要在 select 叙述中 join 其他 table 就可以了.<p>I had same qusetion ,but I need to add ,delete and edit<br>and search two table and I need use adodc componment for vb6 and access.<p>I can not creat relation for two table with sql<br>because I add some information in one table <br>I can not sent relation information for other table .<p>could you give me some informaiton <br>thanks a lot <p>source code is <br>Option Explicit<br>Dim sn As String<p>Private Sub Command1_Click()<p>sn = Adodc1.Recordset.Fields(0).Value<br>Text2.Text = sn<p>Adodc2.RecordSource = "select * from   spouse  where FLECSCID ='sn'"<p>Set Text2.DataSource = Adodc2<br>Text2.DataField = "FLECSCID"<br>Text3.Text = sn<p>End Sub<p>Private Sub Form_Load()<p><br>With Adodc1<p>.ConnectionString = " Provider = Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=C:\My Documents\job\sucess\ver002\membership.mdb;Mode=Read|Write"<p>.RecordSource = "select * from membership  where FLECSCNO='33333333'"<br>End With<br>Set Text1.DataSource = Adodc1<br>Text1.DataField = "FLECSCNO"<p>With Adodc2<p>.ConnectionString = " Provider = Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=C:\My Documents\job\sucess\ver002\membership.mdb;Mode=Read|Write"<br>Adodc1.Recordset.MoveFirst<p><br>sn = Adodc1.Recordset.Fields(0).Value<br>Text2.Text = Trim(sn)<p><br>.RecordSource = "select * from   spouse  where FLECSCID ='sn'"<br>End With<p>Set Text2.DataSource = Adodc2<br>Text2.DataField = "FLECSCID"<br>Text3.Text = sn<p><br>End Sub<p>Private Sub Text3_Change()<br>Text3.Text = sn<br>End Sub<p><p>
<br>
<br><hr size=7 width=75%><p>
<a name="followups">Follow Ups:</a><br>
<ul><!--insert: 11004-->
</ul><!--end: 11004-->
<br><hr size=7 width=75%><p>

</body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -