Solved

Use of the Grid

Posted on 2002-03-29
8
257 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
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.

 

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

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…
This guide will walk you through the essential considerations and tech stack for building scalable websites. Know how to grow your business the smart way!
The purpose of this video is to demonstrate how to insert an Iframe into WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Open Page or Post…
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…

726 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