Message 1 of 8
MSHFlexGrid

Not applicable
10-25-2001
10:09 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Has anybody here ever used the MSHFlexGrid on a heirarchical recordset? I
am having a heck of a time with it. The MS documentation says to use SHAPE
to create the heirarchy, but this gives me an "Invalid SQL statement" error
message. Normally I would just use INNER JOIN, but that does not create a
heirarchy.
The example in the documentation uses SQL server, and I am using an MDB
file. I didn't think that should make a difference, but I can't figure out
what I am doing wrong. My code was just clipped right out of the MS docs
and modified for my program...
Dim strConnect As String
strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dbFileName &
";Persist Security Info=False"
' Create a Shape command.
Dim strSh As String
strSh = "SHAPE {SELECT * FROM `dt_field_sample`} AS Samples APPEND ({SELECT
* FROM `dt_results`} AS Results RELATE sys_loc_code TO sys_loc_code) AS
Results"
MyForm.Adodc1.ConnectionString = strConnect
MyForm.Adodc1.RecordSource = strSh
Set MyForm.MSHFlexGrid1.DataSource = MyForm.Adodc1
MyForm.Show
Any suggestions? Please help!
Jon Rizzo
Langan Engineering and Environmental Services, Inc.
am having a heck of a time with it. The MS documentation says to use SHAPE
to create the heirarchy, but this gives me an "Invalid SQL statement" error
message. Normally I would just use INNER JOIN, but that does not create a
heirarchy.
The example in the documentation uses SQL server, and I am using an MDB
file. I didn't think that should make a difference, but I can't figure out
what I am doing wrong. My code was just clipped right out of the MS docs
and modified for my program...
Dim strConnect As String
strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dbFileName &
";Persist Security Info=False"
' Create a Shape command.
Dim strSh As String
strSh = "SHAPE {SELECT * FROM `dt_field_sample`} AS Samples APPEND ({SELECT
* FROM `dt_results`} AS Results RELATE sys_loc_code TO sys_loc_code) AS
Results"
MyForm.Adodc1.ConnectionString = strConnect
MyForm.Adodc1.RecordSource = strSh
Set MyForm.MSHFlexGrid1.DataSource = MyForm.Adodc1
MyForm.Show
Any suggestions? Please help!
Jon Rizzo
Langan Engineering and Environmental Services, Inc.