If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > ADODC Question

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-17-03, 11:27
Bobba Buoy Bobba Buoy is offline
Registered User
 
Join Date: Apr 2003
Posts: 114
ADODC Question

Can you use a sql statement that includes a join for a recordsource in an adodc control? I am having trouble getting a data grid to 'behave' trying to set it's recordsource properties in code. Here is my code:



code:--------------------------------------------------------------------------------

sql = "SELECT * FROM PartData pd INNER JOIN RaceData rd ON pd.RaceID = rd.RaceID "
sql = sql & "WHERE rd.EventID = " & lEventID & " ORDER BY pd.LastName, pd.FirstName"
Set rs = New Recordset
rs.Open sql, conn, adOpenStatic, adLockOptimistic
Set dgPartData.DataSource = rs
dgPartData.Refresh

--------------------------------------------------------------------------------


Could I use this in an adodc as the recordsource?

Thanks!
Reply With Quote
  #2 (permalink)  
Old 08-29-03, 07:31
Marvels Marvels is offline
Registered User
 
Join Date: Jul 2003
Location: Amsterdam, Nederland
Posts: 449
Smile Yep you can

Yes you can.

That is you can do it in code .

First you have to set the propertys of the controle,
odbc connection/db-string ect.

First set the recordsource to 8 (unknown)

in code build your sql string, then set the recordsource property to text and set the text to your sql string and refrsh it
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On