Wrox Programmer Forums
|
Pro VB Databases Advanced-level VB coding questions specific to using VB with databases. Beginning-level questions or issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 27th, 2006, 05:08 AM
Authorized User
 
Join Date: Mar 2006
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default two tables connect....

hi,
i have 2 tables.this are kayitt and hprogram.i want connect to that tables.but i have rows not in kayit tables and in hprogram table rows.so just not both of hprogram and kayit rocors + hprogram recors.

exp:Set rs22 = db22.OpenRecordset("select hprogram.giris,hprogram.cikis,kayit.adisoyadi,kayi t.tarih,kayit.gun,kayit.girissaati,kayit.cikissaat i from hprogram,kayit where (kayit.kartno = hprogram.kartno) and (kayit.gun = hprogram.gun) and (kayit.tarih = '" & Label4.Caption & "') order by bolumu,kayit.adisoyadi ")

this codes run only have in two tables same rocords.but i know there are relations records in hprogram table.

please help
thank for helps

 
Old October 27th, 2006, 08:55 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

hi there...

first of all i'm trying to figure this out ;)

anyway.. are you sure you have related records?? can we see an example?? most probably that if you take out this clause (kayit.tarih = '" & Label4.Caption & "') it will work...

HTH

Gonzalo
 
Old April 3rd, 2007, 04:11 AM
Registered User
 
Join Date: Apr 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to zizo2120
Default

thanks for help him gbianchi
 
Old April 3rd, 2007, 12:37 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

I think this is:

I have 2 tables, "kayitt" and "hprogram."

I want to open a recordset containing data from both of these tables at the same time, but I have rows in hprogram with no matching records in kayit.

¿so just not both of hprogram and kayit rocors + hprogram recors.?

example:
Code:
    Set rs22 = db22.OpenRecordset("SELECT hprogram.giris,  hprogram.cikis,           " & _
                                  "       kayit.adisoyadi, kayit.tarih,              " & _
                                  "       kayit.gun,       kayit.girissaati,         " & _
                                  "       kayit.cikissaati                           " & _
                                  "FROM   hprogram, kayit                            " & _
                                  "WHERE  (kayit.kartno = hprogram.kartno)           " & _
                                  "  AND  (kayit.gun    = hprogram.gun)              " & _
                                  "  AND  (kayit.tarih   = '" & Label4.Caption & "') " & _
                                  "ORDER BY bolumu, kayit.adisoyadi                  ")
                                  This code runs successfully only when I have matching records in both tables.

But there are cases where I know there relationed records in hprogram, though the relationship is not one to one.

Selamiduvar: What is the database management system (Oracle, SQL Server, Access)?
 
Old April 3rd, 2007, 12:40 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

this thread is 6 moths old!!! :p

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========





Similar Threads
Thread Thread Starter Forum Replies Last Post
connect to access paul20091968 Excel VBA 1 January 16th, 2007 04:07 AM
creating tables within tables in access??? carswelljr Access 3 August 23rd, 2006 01:21 PM
Fixed tables and/or fixed bkgrnd in tables slg111875 Dreamweaver (all versions) 1 June 22nd, 2006 02:31 PM
Cant Connect hansalas PHP Databases 2 April 16th, 2005 03:25 PM
can't connect to database asprookie Classic ASP Databases 1 July 22nd, 2003 10:11 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.