Solved

Use of the Grid

Posted on 2002-03-29
8
253 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
 

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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
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 100 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Now that Expression Web 4.0 (http://www.microsoft.com/expression/products/Upgrade.aspx) is free if you buy or have the full version of Expression Web 3.0, now is the best time to  migrate from FrontPage to Expression Web (http://www.frontpage-to-exp…
When setting up new project requests for our site, one of the most powerful tools our team has available to use is Axure (http://www.axure.com/). It’s a tool for creating software and web prototypes that can function and interact as if it were the a…
The purpose of this video is to demonstrate how to manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be IPage.com Log into your Hosting account. IPage will be used for demonstration : Locat…
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…

759 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now