|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now! |
|
#1
|
|||
|
|||
|
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! |
|
#2
|
|||
|
|||
|
What do you mean by "behave"? Are you getting an error?
|
|
#3
|
|||
|
|||
|
No, I am not getting an error. The form that contains the grid is an MDI CHild and it kind of gives me this 'quivering' action and when I (for instance) try to leave the program, the YesNo message box that confirms this action doesn't show up. I think it is behind the child form because if I hit the enter key, the program terminates as expected.
It has really got me puzzled. I changed my code to what I think is a more direct approach: 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"
Adodc1.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=VIRA;Data Source=BOB"
Adodc1.RecordSource = sql
Set dgPartData.DataSource = Adodc1
but it still has the same issues. It shows up ok but the issues arise when I update it. Maybe what I really need is to know how to refresh the grid? Any ideas? Does it have to do with the command text? I have the command type set at Command Unknown (since it's not a table). Any help would be much appreciated!!!! |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > ADODC Question |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|