(1) is in SHAPE of the query results, is actually two tables, do not go into a MSHFlexGrid together?
(2) a lower bound transfinite what reason be?
(3) when I use the string for the first query only set the header is ok, but more than the first table, the second table, can appear blank lines, again the second table columns, why??
The above is the main reason appeared in the SQL query, please appreciate your guidance, thank you!
'the code below
Option Explicit
'statement ADODB library. The Connection and the ADODB library. You object variables
Dim conn As ADODB. Connection
Dim the rs As New ADODB. You
Private Sub Command1_Click ()
Dim s As String
Dim As SQL String
'the instantiation Connection object
Set the conn=New ADODB. Connection
'set the connection provider name
Conn. The Provider="MSDataShape"
'set the connection string
Conn. The ConnectionString="Provider=MSDataShape; Data Source=D: \ Personal example SQL \ \ Desktop \ \ MSHFlexGrid VB hierarchy \ Nwind MDB. The Data Provider=Microsoft. Jet. The OLEDB. 4.0 "
'open to a data source connection
Conn. Open
'shape instructions
SQL="SHAPE {SELECT distinct orderID FROM the Orders} AS the Orders" + _
"APPEND ({the SELECT * FROM [the Order Details]} AS the detail" + _
"RELATE 'OrderID' TO 'OrderID') AS the detail"
'in the grading you object when the parent line location changes, the basic child records for reference is also changed,
Rs. StayInSync=True
'open the cursor
Rs. The Open SQL, conn
'set the MSHFlexGrid control data
The Set MSHFlexGrid1.
the DataSource=rs
'With MSHFlexGrid1
'TextMatrix (0, 1)="list head 1
"'TextMatrix (0, 5)="list in the first five"' error
'End With
S $="^ | ^ commodity name | | ^ specification unit | ^ ^" 'line will stay free
MSHFlexGrid1. FormatString=s $
Rs. Close
Set the rs=Nothing
Conn. Close
Set the conn=Nothing
End Sub
CodePudding user response:
The simplest method is an alias for each field in the SQL, do not have the column head,CodePudding user response: