M
Matt.
Hi again!
Apparently, I'm not allowed to Append a field to my recordset. I've tried
changing the Cursortype to everything but Forward only. And I receive:
error 3219
Operation not allowed in this context
on the Append line in the code below.
ADO is required as the source will change after debugging.
Any advice greatly appreciated.
cheers,
Matt.
-------------------
Dim connDB As New ADODB.Connection
Dim rsWeeklyScrap As New ADODB.Recordset
Dim strDataPath As String
Dim strConnection As String
Dim strSQL As String
Dim intCurRow As Integer
Dim intCurCol As Integer
strDataPath = "\\hserver01\hworking\pcntrl\FORECAST\xAmcan2003.mdb"
strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source = " &
strDataPath
connDB.Open strConnection
strSQL = "SELECT ProDate, SUM(ScrapQuantity) AS ScrapQuantity " _
& "FROM qryWeeklyStartupScrap " _
& "WHERE [Machine #] <= 14 " _
& "GROUP BY ProDate"
rsWeeklyScrap.CursorType = adOpenStatic
rsWeeklyScrap.CursorLocation = adUseClient
rsWeeklyScrap.Source = strSQL
rsWeeklyScrap.ActiveConnection = connDB
rsWeeklyScrap.Open
rsWeeklyScrap.Fields.Append "WeekNum", adInteger
Apparently, I'm not allowed to Append a field to my recordset. I've tried
changing the Cursortype to everything but Forward only. And I receive:
error 3219
Operation not allowed in this context
on the Append line in the code below.
ADO is required as the source will change after debugging.
Any advice greatly appreciated.
cheers,
Matt.
-------------------
Dim connDB As New ADODB.Connection
Dim rsWeeklyScrap As New ADODB.Recordset
Dim strDataPath As String
Dim strConnection As String
Dim strSQL As String
Dim intCurRow As Integer
Dim intCurCol As Integer
strDataPath = "\\hserver01\hworking\pcntrl\FORECAST\xAmcan2003.mdb"
strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source = " &
strDataPath
connDB.Open strConnection
strSQL = "SELECT ProDate, SUM(ScrapQuantity) AS ScrapQuantity " _
& "FROM qryWeeklyStartupScrap " _
& "WHERE [Machine #] <= 14 " _
& "GROUP BY ProDate"
rsWeeklyScrap.CursorType = adOpenStatic
rsWeeklyScrap.CursorLocation = adUseClient
rsWeeklyScrap.Source = strSQL
rsWeeklyScrap.ActiveConnection = connDB
rsWeeklyScrap.Open
rsWeeklyScrap.Fields.Append "WeekNum", adInteger