Get ready for BLACK FRIDAY shopping starting in

Forums

ASP

This topic is locked

Pulling value from different table

Posted 11 Aug 2004 22:19:28
1
has voted
11 Aug 2004 22:19:28 Charles Beaudry posted:
<i>Mods, you can delete this. I'm surely not getting enough sleep since this is a simply join function...</i> <img src=../images/dmxzone/forum/icon_smile_sleepy.gif border=0 align=middle>

Here's the set-up:

Table 1 has fields called project, clientid, status, startdate

Table 2 has fields called clientid, name, company, email

I have a page that has a recordset that displays all the projects through a repeat region in the displayed table. In that table, however, I want to include the company name from table 2.

There is no filter on the recordset because I want the projects to be displayed no matter what the company is.

I tried setting up a recordset within the repeat region to grab the company name only. The <i>project</i> recordset is opened at the top of the page. The code (which produced errors) was as follows:


Dim client__MMColParam
client__MMColParam = project.Fields.Item("clientid".Value

Dim client
Dim client_numRows

Set curruser = Server.CreateObject("ADODB.Recordset"
client.ActiveConnection = MM_dcon_STRING
client.Source = "SELECT * FROM clients WHERE clientid = '" + Replace(client__MMColParam, "'", "''" + "'"
client.CursorType = 0
client.CursorLocation = 2
client.LockType = 1
client.Open()

client_numRows = 0

Where am I going wrong? Or do I have the completely wrong approach to this?<img src=../images/dmxzone/forum/icon_smile_sleepy.gif border=0 align=middle>

Edited by - cbeaudry on 11 Aug 2004 22:27:32

Edited by - cbeaudry on 11 Aug 2004 22:27:54

Replies

Replied 12 Aug 2004 13:07:42
12 Aug 2004 13:07:42 Rene Bandsma replied:
So you want to have two repeat regions on your page displayed in two different tables? And the recordset is getting data also from two different tables?

Is that the summary to your question? Or do I have to read it again <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>

Reply to this topic