ADO Shape method and saving to Access table

T

Tom

Windows 2000
Office 2000
ADO 2.6

I am working with Data Shaping. My goal is to select a column and field to a
recordset, then APPEND other columns with their field value to the Parent
recordset object, then save this as a table within the Access CurrentProject
so I can report off of it. There are many reasons not worth getting into for
why I've chosen this approach.

Persisting the recordset as XML or ADTG format is described in
documentation, however persisting as a table within the database is not. Is
there a method for this?

A sample of my code follows. In ADO 2.6 help several references are
mentioned, however it's not clear what references should be set in Access
VBA in order to make this code run.

Thanks in advance

----------------------------------------------------------------------------
------
Public Function ShapeAppend(sPoint As Long, sDate As Date, sHour As String)

Dim cnn As New ADODB.Connection
cnn.Provider = "MSDataShape"
cnn.Open Access.Application.CurrentProject.Connection

rst.StayInSync = False
rst.Open "SHAPE {SELECT MyTable_Values.Value FROM MyTable_Values
WHERE (((MyTable_Values.Date)=#" & sDate & "#) AND ((MyTable_Values.HrEnd)=
'" & sHour & "') AND ((MyTable_Values.PointID)= 1006));} AS Column1 " & _
"APPEND ({SELECT MyTable_Values.Value FROM MyTable_Values
WHERE (((MyTable_Values.Date)=#" & sDate & "#) AND ((MyTable_Values.HrEnd)=
'" & sHour & "') AND ((MyTable_Values.PointID)= 1007));} AS Column2 " & _
"RELATE (Date TO Date) AS DateAssociation", cnn

rst.Save "tblReport"

End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

ADO Shape valid with Jet? 0

Top