Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Newsgroup Archive
Excel Newsgroups
Excel Programming
excel 2000 append field error
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="onedaywhen, post: 3370829"] I don't think you can directly append a field to a recordset in this kind of scenario. I have no real idea of the internal workings of a recordset but I know it needs to maintain the 'schema' of the datasource to be able to update it. Therefore, I'm not surprised you can't mess with the schema by adding a field. My example of adding a column in the query does create a field but it is read only, again for reasons of schema integrity I assume. So do you really need to append a field? You could instead use the UDF to update your Excel worksheet, if that's the ultimate destination of the data, rather than add it to the recordset first. But if you really want the extra field, you could use data shaping. Change your connection string to use the MSDataShape provider e.g. strConnection = "Provider=MSDataShape;" & _ "Data Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source = " & strDataPath" Use the APPEND NEW syntax in your query e.g. strSQL = "SHAPE {" & _ "SELECT ProDate, SUM(ScrapQuantity) AS ScrapQuantity " & _ "FROM qryWeeklyStartupScrap " & _ "WHERE [Machine #] <= 14 " & _ "GROUP BY ProDate" & _ "} APPEND NEW adDouble AS WeekNum" The appended column should be read/write. [/QUOTE]
Verification
Post reply
Forums
Archive
Newsgroup Archive
Excel Newsgroups
Excel Programming
excel 2000 append field error
Top