Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Is there a better way to do it?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Is there a better way to do it?

 Post Reply Post Reply
Author
zaboss View Drop Down
Senior Member
Senior Member


Joined: 20 August 2002
Location: Romania
Status: Offline
Points: 454
Post Options Post Options   Thanks (0) Thanks(0)   Quote zaboss Quote  Post ReplyReply Direct Link To This Post Topic: Is there a better way to do it?
    Posted: 13 June 2004 at 12:43pm
I have 2 tables which share a common field. In a view, i must show the fields from the first table and 1 field from the second table, At this moment, I create two recordsets:

Set RS1 = MyConn.Execute ("Select * FROM tblDoctori where UserName="& Session("UserName") &"")
Set RS2 = MyConn.Execute ("Select strLocalitate, strLM FROM tblHospitals where strLM = "& RS1("strLM") &"")
...
' then display it.

My question is, is there a better way to do it?
My impression is that for every item in the first recordset, there is a new trip to db which might be very resource consumming.

PS If this is wrong, the solution has to work for MS SQL, mySQL and Access in the same time.
Cristian Banu
Soft 4 web
Back to Top
Semikolon View Drop Down
Senior Member
Senior Member


Joined: 09 September 2003
Location: Norway
Status: Offline
Points: 1718
Post Options Post Options   Thanks (0) Thanks(0)   Quote Semikolon Quote  Post ReplyReply Direct Link To This Post Posted: 13 June 2004 at 2:22pm
Try
SELECT tblDoctori.*, tblHospitals.strLocalitate, tblHospitals.strLM
  FROM tblDoctori, tblHospitals
 WHERE tblDoctori.UserName = '" & Session("UserName") & "'
   AND tblHospitals = tblDoctori.strLM

Havn't tried it, so not sure if it works though


Edited by Semikolon
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.