Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

create dynamically resolved statements in C++

Status
Not open for further replies.

Riverman1111

Programmer
Feb 11, 2009
15
0
0
US
Hello,

I need to dynamically resolve statements in C++. Not sure if that makes literal sense so the example is what I need to do:

read from cursor
Statement 1
edtP1EstLaser1->Text = SQLStoredProc1->FieldByName("est_mins")->AsAnsiString;

read next row
Statement 2
edtP1EstLaser2->Text = SQLStoredProc1->FieldByName("est_mins")->AsAnsiString;

read next row
Statement 3
edtP1EstLaser3->Text = SQLStoredProc1->FieldByName("est_mins")->AsAnsiString;

The fields are all being valued from the same stored procedure,and the fields are all named the same except 1,2,3. I would prefer to loop and value the fields, rather than have each coded separately. The fields on the screen will not always have a value in the cursor. ie: on form lines 1,5,7 etc not always rows 1,2,3 etc.

I imagine a grid might be useful,rather than individual fields, but i don't know grids yet.

Any suggestions?

I have attached a doc, the fields i'm loading are in the scrollable box.


Thanks

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top