T
Tom
I'm working with ADO Shape commands. Are these valid with Jet? The engine
can't seem to parse them. More specifics of what I am doing are below from a
post I put up yesterday.
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
can't seem to parse them. More specifics of what I am doing are below from a
post I put up yesterday.
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