Results 1 to 2 of 2

Thread: [RESOLVED] How to relate between two tables?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2007
    Location
    Malaysia
    Posts
    1,370

    Resolved [RESOLVED] How to relate between two tables?

    I have table "Pemilik" and "Tanah" . How I can relate both tables using "PLOT" As common field?

    Code:
    Dim pConn As New ADODB.Connection
    pConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\DBMS.mdb" & ";Jet OLEDB:Database Password=macres"
    pConn.Open
    Dim pCommand As New ADODB.Command
    pCommand.ActiveConnection = pConn
    pCommand.CommandType = adCmdText
    pCommand.CommandText = "SELECT Plot,BLOCK,PEMILIK1,PEMILIK2 FROM pemilik"
    Dim relTable As New MapObjects2.Table
    Set relTable.Command = pCommand

  2. #2
    Hyperactive Member yousufkhan's Avatar
    Join Date
    Jan 2002
    Location
    India
    Posts
    492

    Re: How to relate between two tables?

    jone the table on common field "PLOT"

    pCommand.CommandText = "SELECT Plot,BLOCK,PEMILIK1,PEMILIK2 FROM pemilik"


    pCommand.CommandText = "SELECT tablename.Plot,tablename.BLOCK,tablename.PEMILIK1,tablename.PEMILIK2 FROM pemilik, tanah where pemilik.plot=tanah.plot"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width