|
-
August 27th, 2001, 11:49 AM
#1
Data Shaping problem
Hi,
im trying to create a hierachical flex grid with 2 related tables. but the catch is that i want 1 fabricated field in the first table. i cant seem to find any example for working with data from tables alongwith fabricated fields.
if anyone can gimme an example of shape command for it.
thanks,
Moez.
-
August 27th, 2001, 12:20 PM
#2
Re: Data Shaping problem
'Ref only ActiveX 2.x lib
Option Explicit
Private cn As ADODB.Connection
Private rs As ADODB.Recordset
Private Sub Form_Resize()
objGrid.Move 0, 0, Me.ScaleWidth, Me.ScaleHeight
End Sub
Private Sub Form_Load()
Dim strSQL As String
Set cn = New ADODB.Connection
Set rs = New ADODB.Recordset
cn.Provider = "MSDataShape"
cn.ConnectionString = "Data Provider=Microsoft.Jet.OLEDB.4.0;Data Source=f:\vb6\prqnew\prq.MDB"
cn.Open
rs.Open "SHAPE {select ProducerID, Name, State from ProducerMSTR} " & _
"APPEND ({select producerid,tanknumber from TankMSTR} " & _
"RELATE producerid TO producerid) AS tanks", cn
Set objGrid.DataSource = rs
End Sub
'====================
Parameterized Commands
Shape commands may be parameterized. For example, you can specify the following:
"SHAPE {SELECT * FROM customer}
APPEND {SELECT * FROM orders WHERE cust_id = ?}
RELATE (cust_id TO PARAMETER 0)"
In this case, parent and child tables happen to have a column name in common, cust_id. The child-command
has a placeholder (that is, "?"), to which the RELATE clause refers (that is, "...PARAMETER 0". In effect, the
relation is between the explicitly identified parent-column, and the child-column implicitly identified by the
placeholder).
Iouri Boutchkine
[email protected]
-
August 27th, 2001, 12:30 PM
#3
Re: Data Shaping problem
is there a way i can also fabricate a column which is not in the database alongwith the columns already present in the db.
like the columns would be
Confirm OrderId Desc
the column confirm is not present in DB. only the other 2 are...so i want to fabricate this so it looks like a column from db in Hflexgrid
thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|