[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


Add an editable column to a bound query

Posted on 2014-09-02
Medium Priority
Last Modified: 2014-09-02
I am pulling up the following query to my datagrid in a vb6 form.  The resulting query results cannot be edited,  However, I would like to add a temporary column at the end of the results which will enable me to add temporary data.  Is this possible?

select g.Agency,g.Goal,o.Objective,p.PI,P.Method,a.[ActivityName],P.[ProjectedHours],a.Data, s.ProgressSetback
from tblOrgGoals G 
LEFT Join tblOrgObjectives O on G.GoalID = O.GoalID and g.agencyid=o.agencyid
LEFT Join tblOrgActivities A on O.ObjectiveID = A.ObjectiveID and g.agencyid=a.agencyid
LEFT Join tblOrgPI P on P.ActivityID = A.ActivityID and g.agencyid=p.agencyid
LEFT Join tblOrgMonthlyProgressSetbacks S on p.PIID = s.piid and g.agencyid=s.agencyid
Where s.AgencyID = 74 And s.monthlyid = 3 And s.piid = 1  order by G.Agency,G.Goal

Open in new window

Question by:al4629740
  • 2
  • 2

Author Comment

ID: 40299788
This question asks how to add an additional column at the end of a table in a datagrid.  Different question, but delete if you deem it to be so.
LVL 34

Accepted Solution

Brian Crowe earned 2000 total points
ID: 40299792
There are several ways to do this including adding a column to your ADO Datatable or just adding an empty column to your SELECT.

select g.Agency,g.Goal,o.Objective,p.PI,P.Method,a.[ActivityName],P.[ProjectedHours],a.Data, s.ProgressSetback, '' AS TempColumn --Casting would be a good idea here to get the type and size you need

Open in new window


Author Comment

ID: 40299832
Thank you.  That's exactly what I was looking for.  Is there a way to edit the column directly with the mouse?  Either Datagrid or msflexgrid?
LVL 34

Expert Comment

by:Brian Crowe
ID: 40300127
Unfortunately that's more of a VB question and I haven't done any VB programming in years.

I would suggest posting another question or googling it.

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Suggested Courses

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question