Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default excel 2000 append field error

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.m db"
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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 459
Default excel 2000 append field error

What will you be doing with this appended rs field? Will this work for you:

SELECT
ProDate,
SUM(ScrapQuantity) AS ScrapQuantity,
1 AS WeekNum
FROM ...

"Matt." wrote in message ...
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.m db"
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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Making a field value append a hyperlink 68jcode Excel Discussion (Misc queries) 4 October 13th 09 09:25 AM
Excel 2000 copy error Jim Excel Discussion (Misc queries) 1 March 25th 09 04:59 PM
Cannot update <field name; field not updatable. (Error 3113) Boo Ray Excel Worksheet Functions 0 November 27th 07 01:39 PM
Removing entry from pivot table field list in Excel 2000 EricK Excel Discussion (Misc queries) 5 May 26th 07 01:05 AM
How do I format currency field in Excel 2000 w/o 2 extra zeroes? slmm Excel Discussion (Misc queries) 2 July 12th 05 03:06 PM


All times are GMT +1. The time now is 09:12 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"