Using the Data Shape
Using the Data Shape
Rate Using the Data Shape
(1(1 Vote))
Dim cnn As New ADODB.Connection
Dim rst As New ADODB.Recordset
Dim rstTitleAuthor As New ADODB.Recordset
cnn.Provider = "MSDataShape"
cnn.Open "Data Provider=SQLOLEDB.1;" & _
"Data Source=URServerName;User Id=sa;Password=;Database=Pubs"
' STEP 1
rst.StayInSync = False
rst.Open "SHAPE {select * from authors} " & _
"APPEND ({select * from titleauthor} " & _
"RELATE au_id TO au_id) AS chapTitleAuthor", _
cnn
' STEP 2
While Not rst.EOF
Debug.Print rst("au_fname"), rst("au_lname"), _
rst("state"), rst("au_id")
' STEP 3
Set rstTitleAuthor = rst("chapTitleAuthor").Value
' STEP 4
While Not rstTitleAuthor.EOF
Debug.Print rstTitleAuthor(0), rstTitleAuthor(1), _
rstTitleAuthor(2), rstTitleAuthor(3)
rstTitleAuthor.MoveNext
Wend
rst.MoveNext
Wend
With grdTemp
Set .Recordset = rst
.Refresh
End With
rst.Close
cnn.Close
End Sub
Using the Data Shape Comments
No comments yet — be the first to post one!
Post a Comment