?
Solved

Use of the Grid

Posted on 2002-03-29
8
Medium Priority
?
265 Views
Last Modified: 2013-12-24
Hi,
   Can the grid be programmed to a recordset rather than from a data control ??

I would like to retrieve the data manually and then programatically add it to the grid.

Regards...

Peter.
0
Comment
Question by:annandap
  • 4
  • 3
8 Comments
 
LVL 9

Expert Comment

by:msdixon
ID: 6905801
a better way might be to modify your query so it only returns the rows you need. the approach above would take twice as long because you're going through the recordset once to remove unwanted items, then going through it again to display the data.

i don't use the DTC's in VI, and i don't recall how to do that, but i'll look into it.
0
 

Author Comment

by:annandap
ID: 6906257
Sorry I should have put the reason why I wanted to do this. The data I am returning comes from 3 different databases. One database is a program database that holds queries, forms etc the second is a reference or lookup database that holds full description of items and the data database holds the data and uses the reference database to provide description of codes stored in the data database.  Therefore I scan the data database to return records required and add them to an array, next I reference the lookup database to supply the description of the codes and update the array.

For example the data returned for an employee from the data database would have a location code of TAF01, lookinhg up the refence database would provide me with an address for that location which I would then replace in the array with the location address rather than the location code.
0
 
LVL 9

Expert Comment

by:msdixon
ID: 6907346
i would suggest writing the code to iterate through the three recordsets without using a grid control. your code will be a lot cleaner than the generated code.

i'll try and get some time to look into this over the weekend...
0
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 

Author Comment

by:annandap
ID: 6908373
The reason I wanted to use the grid is I'm not to happy with a plain table, I originally loaded all the data into arrays and then produced the table, also I like the look of the grid rather than the borders on the table.

Regards..

Peter.
0
 
LVL 9

Expert Comment

by:msdixon
ID: 6910179
i couldn't find a way to do this. there is no way to set the grid control to pull from more than one recordset, and the one recordset it can pull from needs to be designated through DTC's, not the code itself.

as far as appearance goes, the grid is just html. view the source, and that should give you an idea of what to change to make it look the same.
0
 

Author Comment

by:annandap
ID: 6911181
I have found another way to do this, there is a product called VbsDb (free) which is a series of ASP pages that load and format data from recordsets.

I will close off the question tomorrow.

Regards....

Peter.
0
 
LVL 20

Accepted Solution

by:
hes earned 400 total points
ID: 6915480
You can also use the MsFlexGrid

<OBJECT classid=clsid:6262D3A0-531B-11CF-91F6-C2863C385E30
codeBase=http://activex.microsoft.com/controls/vb6/MSFlxGrd.cab id=MSFlexGrid1
style="HEIGHT: 133px; TOP: 0px; VISIBILITY: visible; WIDTH: 709px"><PARAM NAME="_ExtentX" VALUE="15007"><PARAM NAME="_ExtentY" VALUE="2815"><PARAM NAME="_Version" VALUE="393216"><PARAM NAME="Rows" VALUE="5000"><PARAM NAME="Cols" VALUE="6"><PARAM NAME="FixedRows" VALUE="1"><PARAM NAME="FixedCols" VALUE="5</OBJECT>

Then just insert the data example here for the column headers

GridRow = 0
 MSFlexGrid1.rows = GridRow + 1
 MSFlexGrid1.Row = GridRow
 MSFlexGrid1.Col = 0
 MSFlexGrid1.ColWidth(0) = 1500
 MSFlexGrid1.Text = "Item Code"
 MSFlexGrid1.Col = 1
 MSFlexGrid1.ColWidth(1) = 600
 MSFlexGrid1.Text = "Qty"
 MSFlexGrid1.Col = 2
 MSFlexGrid1.ColWidth(2) = 1500
 MSFlexGrid1.Text = "Price"
 MSFlexGrid1.Col = 3
 MSFlexGrid1.ColWidth(3) = 2000
 MSFlexGrid1.Text = "Start Date"
 MSFlexGrid1.Col = 4
 MSFlexGrid1.ColWidth(4) = 2000
 MSFlexGrid1.Text = "End Date"
 MSFlexGrid1.Col = 5
 MSFlexGrid1.ColWidth(5) = 675
 MSFlexGrid1.Text = "Delete"
0
 

Author Comment

by:annandap
ID: 6916578
Thanks, never even thought of trying that approach.

Regards
Peter..
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Objective of This Article In 1990’s, when I was a budding software professional, I had a lot of confusion about which stream or technology, I had to choose to build my career. In those days, I had lot of confusion like whether to choose System so…
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
The purpose of this video is to demonstrate how to exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…
Suggested Courses

864 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