Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Visual Basic

See Related Forum Messages: Follow the Links Below to View Complete Thread

Help With Grid Drawing Algorithm
I'm on the very last stage of my app, and it's "the very devil" to sort out!
Basically, I want to draw essentially a latitude/longitude reticule, within limits set by the user. I know what I want (two arrays, one for the North-South lines and one for the East-West lines) and a nested loop.
Say the user wants to draw the sky - this is a star-charting program - between declination (the sky equivalent of latitude) 8 degrees and 32 degrees; and RA (the sky equivalent of longitude) 13 degrees and 42 degrees.
We need lines drawn at 15d multiples in RA (longitude) and 10d multiples in Dec (latitude) so the reticle will consist of these lines: (RA, Dec values as "x,y" pairs)



These are for the "longitude" lines. Obviously, a similar algorithm will draw the "latitude" lines.
I have written functions to size the arrays, and also to ensure the lines converge towards the poles; that isn't the problem. The only problem is to get the line-drawing algorithm written correctly!
I know what I want, just not exactly how to get it. Can anyone help?

Grid Size Algorithm?
I've thought about it, and its killing me. I can't think of a reasonable algorithm, which would determine the max size needed for a crossword.

The only method I could think of is add up the lenght of the words, then make the grid LEN x LEN. Surely you can guess that this is not very good, especially as the number (and length) of words gets larger.

Thanks to everyone who attemps to help me.

Kriging Interpolation
hi everyone,
i have several x,y,z coordinate and i want to interpolte the points into raster using kriging method.can anyone help me with the code.
thank you very2 much

Displaying Data In A (data Grid / Flex Grid)
hi i would like to know how to connect to a Access database and display all records in a flex grid in VB

also i would like to know how to achive the above task from a SQL dadabse using ADO.. in VB

Plz help me...


MSHFlexGrid 2 Things I Want To Edit Data In Grid And 2 I Want To Re Populate Grid
  Ok First I want to Edit the Data in the Grid... Note this is partially setup.

  I have it so that I can Edit each cell however, I havent the slightest idea of how to go about saving the edited row after its edited.

  Ok, I have 3 option buttons.... I want to select an option button and it re populate the grid with a new MDB file. I figure I will need to Close the current open MDB so I can repopulate the grid... but How to accomplish this is the question.


Please Help.. I Cant Make A Algorithm To Tell If All Data Has Been Received W/winsock
I just learned the hard way that winsock decides to send data when it wants and not neccessarily how I ask it to.

Winsock.SendData "a"
Winsock.SendData "b"
I thought would cause 2 data arrival events on the receiving machine, but it often causes just one. ("ab" received).

Similarly, Winsock.SendData "some_really_really_really_really_long_string" causes more than one (usually) data arrival event.

So I guess its my programming inexpertise, but I have no idea how to accurately tell when data has been received or not, and if it hasnt, when to append that data to the next data received, etc.

Basically my program sends a lot of commands back and forth thru winsock.
Each command looks like <m>Some_Command</m>, but because of the winsock senddata/dataarrival mishap the command doesnt always go through like that. Sometimes "<m" appears in the data arrival, sometimes "Some_Comm" appears, sometimes more than 2 commands appear at once, etc etc etc.

Is there an easy way to tell if a full command is received and if it is, send that command to another sub that will handle the command? This seems simple but it is incredibly complex and I cant get my head around it.. especially if there is an error in transmission or something

Generic Algorithm For Reading Data From HTML (VB, DHTML/DOM)
Hi there,

I'm working on a VB-based search tool which I hope to use to search several sites at once. I'm trying to develop an algorithm that will read through the source of a results page such as google, find the search results, and return them as an object, an instance of which would hold information such as URL, Description, and it's ranking in the results (ie - the highest ranking search result should be the first one in the list, etc)

For Instance, a sample page from google:

This is a search for 'Programming'

I'm trying to break down these search results into objects with attributes (each having URL, Description, Rank). If you take a look at the page you should have a good idea what I'm talking about.

I've been told that using the DHTML DOM would be one way of designing an algorithm to solve this problem. Unfortunately, my background is more in Systems analysis and design rather than Software Development, and I would very much appreciate it if you could get me kick started on this. I've already developed code to send search strings to search engines and acquire the results page as HTML source, so all I need is to find some way of extracting this information.

Thanks very much!

About Data Grid Flex Grid And Other Family
1. what is the best control with the latest updatable fetures in this family
2. right know (until someone tell me that thire is a better control) i am using data grid, now i want to send data during my program to the data grid and i want that the data grid will show this data, now i dont want to send this data to the data base but directly to the grid, is that possible if yes how does it done .
thanks you all


Diffrence Between Flex Grid And Data Grid????

I want to know what is the difference between Ms flex grid and MS data grid?

pls tell me

thank u

sowmya s

Selected Row In A Data Grid Or A Msh Flex Grid
The user has to select a row from a data grid of a mshflex grid. The information seen in the data grid or the msh flex grid depends on a selection in an other combo box, this works fine. Now the goal is to copy one single column of the selected row in the data grid or msh flex grid to a ordinary listbox.
I've tried all methods but nothing works!


Help With MSFlex Grid Or Data Grid
Can anyone direct me to a user-friendly discussion on either MSFlex Grid and data grid controls. Iím trying to mimic the appearance of an excel spreadsheet in a VB form and was told one of those grids would do it. However I have never used either before and cannot find any posts/lessons/pages on MSDN that clearly explain how to do what I want.

Which, in case it helps is this: Currently have an excel spreadsheet with dates across the column headings and room numbers for row headings, cells are filled with patients names for each room and the respective dates they are staying (which is taken from our db).
This is mainly used by our volunteers to quickly see if beds are available for additional patients, however, as the info is entered once in the database and again in the spreadsheet there have been numerous discrepancies. As many of the volunteers are older we donít want to change the appearance too much.
If the info is in the db I figured there must be some way to mimic the spreadsheet in VB, which Iíve been informed is the aforementioned grids. But I have no idea how to set this up and cannot find a clear explanation.
ANY assistance is greatly appreciated on this one!

Data Grid & Flex Grid
I want a Data/Flex Grid to design the Sales Invoice Form; where a Combo Box(es) should be attached to Part ID: and Item/Part Name, the Editing should be done in the Grid itself...
Grid Cols.
SL. Part ID. Part Name Qty. Rate Disc. Amount
(Combo (Combo to
List IDs) List Part Name(s))

-> Edit/Data Entry should be done in the Grid...

Copy Grid Data From One Grid To Another.
I need some help here. I have two grid Parent and child. I have a column in Parent grid called total Qty. What I want to do is on the form load event and Parent grid click event, i want to populate the child grid from the values of parent grid. I need to keep in mind totlal QTY, and divide that Qty by a standard number and show multiple rows in child.
So for one parent I will have coulple of child.
Here is example.
Parent has Total Qty = 60
My standard# = 12
So Total Child Rows = 60/12 = 5 rows in child grid

I need to copy same data 5 times with qty Row like 12,12,12,12,12..
Can someone please help.

ADO With Flex Grid Or Data Grid
hai friends,

   i find the solution to connect the Excel file using ADO in the website;EN-US;257819#Connect

when i include a flex grid or data grid & changed the record source of .xls file, its not displaying.

where is the problem

rectify this


Need Help In Data Grid Or Flex Grid
I need a Example copy of Data Grid or Flex Grid... which will communicate with database, ID entering in text box multiple record should display in Data Grid.... Add, Edit, Delete and Save need to done using own code....

data grid without using ADODC Control..

please any one can help me??

I appreciate ur help..


Data Grid / Flex Grid
hi how do i display data in record set on to a flex grid ????

How Do I Search Typed Data In Textbox In Data Grid Column
How do I Search typed data in Textbox in Data Grid Column

on Form load Data From Access TAbles loads into Datagrid

am having Textbox When i Typed Certain Name it should search on Selected Column


Printing The Contents Of A Data Grid - Data Report? Can Be Packaged?
Dear Friends,

I wish to provide a function to print the content of a data grid like that in Excel, including grid lines and column headers. But I don't want to use the capture image method of the grid and send to the Printer object because this is not applicable if the list is longer then the grid height.

So do I need to use data report? I just notice its existenece in the Designers in the Project Explorer of VB IDE. Can the project using DataReport be packaegd up as a standard standalone exe for installing on a new machine?

If special skills or tips are there, please kindly let me know.

Thank you very much for your help

How To Insert Temporary Data In Access(table) Using Data Grid
How to insert data into a table using a data grid.
A little background,i am using SS TAB in my forms i need to hold data temporarly im my data grid
and then finaly at click it should be inserted in the table.The SS TAB is linked to ADOC,which is inturn
linked to the table in access.

How To Insert Temporary Data In Access(table) Using Data Grid
How to insert data into a table using a data grid.
A little background,i am using SS TAB in my forms i need to hold data temporarly im my data grid
and then finaly at click it should be inserted in the table.The SS TAB is linked to ADOC,which is inturn
linked to table.

Edited by - manav74 on 10/29/2003 1:01:07 AM

SHeridan Data Widgets 2 Data Grid Problem
I have a form VB Tab control on it with three tabs, one each for "Query Setup", "SQL Display", and "Query Results". Tab # 3 (Query Results) has a Sheridan Data Widgets 2 datagrid on it attached to a standard data control. When the form initially loads the grid is automatically filled with the fields of the entire database. So far so good, that's what I want by default.

However, if the creates an SQL on tab #1 (Query Setup) and the statement uses less fieldnames (columns, ie only First, Middle and Last names instead of all fields) than it had on the initial load the grid only dislays the first field. The SQL statements are correct.

I have even tried replacing the Sheridan grid with the VB5 data grid and it works fine so I must be missing something here, perhaps a setting or something.

My supporvisor wants (likes) the alternate row colors of the Sheridan grid and wants it to be databounnd so I need to use thia grid.

Any ideas?

Rev. Michael L. Burns

Transfering Data Form A Data Grid To Excel
Hi guys.

I have a program in VB6 which load data from an access table into a data grid, now I need to trasfer that data in the grid to an excel sheet. How can I do this?.

Thanks in advance

Updating Data Directly In The Cell Of Data Grid
hi, i m wondering whether it is possible to update, insert or delete data directly in the cell of a data grid? i normally will let d user to click at d data grid and do these updates on a displaying text box. my user who is a microsoft excel user make a request that he hope d program will be as similar to excel as possible. i have look through d forum and didnt find a topic that can solve my problem. by d way, can we set different background colour or font colour for different columns? thanks~

Inserting Data In Access Using Do While Loop From A Data Grid
how to insert data in access using do while loop from a data grid

Edited by - manav74 on 10/30/2003 11:09:33 PM

Help On Viewing The Searched Data Inside The Data Grid
Can somebody teach me how to view only the searched data within the Data Grid, removing the other items inside the Data Grid that are not included in the search that I wrote insde the inputbox....Please add it to my code here:

Dim rsClone As ADODB.Recordset
Dim findpodealername As String
Dim strFind As String

findpodealername = InputBox("Enter DEALER'S NAME:", "FIND DEALER'S NAME")

strFind = "Name = '" & findpodealername & "'"

'create a "copy" of the recordset, used so the current record pointer doesn't change..
Set rsClone = prodorderrs.Clone

With rsClone
'Move to the first record
    'find the particular string
    .find strFind
    If Not .EOF Then
    'Record has been found...
        prodorderrs.Bookmark = .Bookmark 'moves to the found record in the source r/set
        txt_pomonth = .Fields("MONTH")
        txt_poday = .Fields("DAY")
        txt_poyear = .Fields("YEAR")
        txt_podealerID = .Fields("DEALER ID")
        txt_poName = .Fields("NAME")
        txt_poprodid = .Fields("PRODUCT ID")
        txt_pocategory = .Fields("CATEGORY")
        txt_poqty = .Fields("QUANTITY")
        txt_pocolor = .Fields("COLOR")
        txt_posize = .Fields("SIZE")
        txt_pocash = .Fields("CASH")
        txt_pocredit = .Fields("CREDIT")
        txt_poamount = .Fields("AMOUNT")
        txt_pobalance = .Fields("BALANCE")
        MsgBox "Invalid Dealer Name Entered Or New Order of products"
    End If
End With
Set rsClone = Nothing

End Sub

i need to print the contents of my data grid to data report without using data environment.. pls help me.. tnx!

Edited by - wildflower_myn on 2/9/2004 9:03:25 PM

Show Data In Data Grid Using Adodb
I want to display data in Data Grid using Adodb

Private Sub Command1_Click()
Dim oRs As new ADODB.Recordset

con = "Provider = Microsoft.Jet.OLEDB.4.0; Data Source = " + App.Path + "/Northwind.mdb"

oRs.Open "select * from customers", con, adOpenKeyset, adLockOptimistic

Set DataGrid1.DataSource = oRs


End Sub

No error when it is run , but the Data Grid is still empty... still no data displayed.

What's wrong with my code ?

Adding Data To The Data Grid Using A Txtbox
I have a form named frmclient that has a datagrid in it which is already connected to a MS sql server through ADO. My problem is I want to add data in the data grid using a txt box.

is there a way to do this using only the "adodc.recordsource.addnew" source codes or do i really have to use stored procedures???

Pass Data From Data Grid To Text Box
Can can i pass Data from data grid to text box while the record in the data grid is highlighted.

Pass Data From Text Box To Data Grid
Can someone tell me how to pass the data from the text box to the data grid. After the user press the tab key after the text.
Pls help me

Import Data From Array To Data Grid
is there any way i can use to import data from an array into the data grid? So that i can use the data grid as input for my ms chart....

I Want To Display Data With Data Grid Object
hi evrry one
i am new in vb programming
and i want to display data from a database by the use of the datagrid object

i am able to get the data and display it in a combobox
but not with the data grid

to be more clear

in combo box
it was like this
Dim i
i = 0
While Not rs.EOF
Combo1.AddItem rs("ad_id"), i

i = i + 1
how can i get the same data but in the datagrid

thanx in advance[color=blue][color=blue][color=blue]

Unable To Change Data In The Data Grid
Dear sir/madam;

I have a form with a data grid written with VB version 8176. The project is working fine with my computer using this version 8176 but when I run the same project at school. The data grid is not allowing me to change any data in any column in the grid at all. The version of VB in school is 9899 and have SP5 as well. Could you please help me resolve this problem. My school project is due in one more week and I have to get this data grid working. Please help, please!

Thank you for your attention.


Grids And Data Can I Edit Data In A Grid??????
i would like to load data from my sql7 server in to a grid control then click into a cell and edit the data then save that data back to my sql 7 server can this be done????

Data Grid: How To Enter And Change Data?
Hi, folks!

I've added a Datagrid control to my form and have set its properties like this:
AllowAddNew = false
AllowDelete = false
AllowUpdate = false, on the form load event

There's a button called "Add New", with the following module:
MyDatagrid.AllowAddNew = True
But when I click this button, this error message appears:
Invalid use of property (regarding the 2nd line, property .AddNewMode

There's another button called "Changes", with the module:
MyDataGrid.AllowUpdate = True
And the same error message appears for the .EditActive property.

What I am doing wrong?
I'd like to allow the user to change or add new records only after clicking the proper buttons. I've done with another forms, but that's the 1rst. time I work with the DataGrid Control.

Please, help!
Thanks in advance for any ideas,


Data Grid And Moving Inserted Data
Hi all,

I have a data grid that is used for input. When a user enters in a new row and updates it, I would like to put that information in another control. What event can I use to do this? I tried afterInsert and that gets fired at the wrong time (when the user goes to the new row).



How To Retrieve Data From Data Grid To Another Form
i'm making a database that uses a data grid to find and display the contents of my database... how can i retrieve a record from my datagrid to textfields in another form... ??? hehe

How To Edit Data On A Data Grid Control?
Hello! I have a program that display a list of schedules on a data grid control and I'm trying to edit these data in the data grid? How to do this? thanks

Data Environment With Data Grid And Using Query
Ok, very new at this, and only education I have is with Microsoft books I have read.

So here is what I am trying to do.. I am using Data Environment to connect to my database in ACCESS.  I am also using a datagid to view the table.  What I wan to do is be able to run a query on the database table and show the results in the datagrid.

I am not sure if I am even making any sense here, but hoping someone will have a answer for me


Data Grid And ADODC's Data Source

I have 4 SQL tables and 4 ADODC's (one for each table) and also have 1 DataGrid
How do I change the datagrid's DataSource without adding a data grid for each sql table ?

If I change the DataSource, DataGrid's column caption, data Field, col width, col visible or not, will also
change..... how do I do that?

this is what I have for ONE Sql table:
Private Sub Text4_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

    If IsNumeric(Text4.Text) = False Then
         MsgBox "Week number?"
             Adodc1.RecordSource = "select * from " & pSqlTbl & " where DATE > 0 AND weeknum = " & Text4.Text & " and year = " & Text3.Text & ""
                If Not Adodc1.Recordset.EOF Then
                    DataGrid1.Visible = True
                End If
    End If

End If

Any ideas

Thank you


Data Grid Control Is Not Filled With Data
I hope someone can help me with this:
I made a class module to allow data grid control to get information from the class module.
Inside the class module I created I made a connection and recordset to trying to fill the datagrid control.
Can someone tell me what I did was wrong that my datagrid control is not filled with data?

Thank you very much!


The code within the form where the data grid control is:

' Bind the DataGrid to the new DataSource datNames
Dim datNames As NamesData ' Class variable
' Set datNames = New NamesData
Set GrReport.DataSource = datNames


Below is the class module

Option Explicit
Const DB_CONNECT = "Provider=SQLOLEDB; Data Source=BSQL; " & _
"Initial Catalog=TestField; User Id=flduser;Password=flduser;AutoTranslate=No"
Private WithEvents rsNames As ADODB.Recordset

Private Sub Class_Initialize()
' Add the names of the new datamember to the DataMember collection
' This allows other objects to see the available DataMembers
Dim dbField As ADODB.Connection

Set dbField = New ADODB.Connection
Dim strSQL As String
Dim rsNames As Recordset
Set rsNames = New ADODB.Recordset

dbField.Open (DB_CONNECT)
strSQL = "select * " & _
" from dbo.Daily_PPR"

rsNames.Open strSQL, dbField, adOpenDynamic, adLockOptimistic

End Sub

Private Sub Class_GetDataMember(ByVal DataMember As String, _
Data As Object)
Set Data = rsNames
End Sub

Data Grid, Etc./Data Shape Recordset
Is it possible to bind the datagrid, the old flexgrid, etc. to a "DataShape" language recordset? I was able to bind them to regular recordsets, but not with the data shape. I know I could use the Hierarchical flex grid for this, but I don't like the way that control lays out all of the data horizontally. I'd like to have the initial data grid show the "Parent" side of the recordset, and then allow the user to click on an item and have the child/detail information pop up. Thanks in advance.

Change The Data Field In Data Grid
Hi all,

I have an ADODC control, namely Adodc1, having the sql statement as below :

sqlstr = "select to_char(IN_DATETIME,'dd-mm-yyyy hh24:mi:ss'),
, other_field from table1"

and the Adodc1 is bind to DataGrid1.
Upon clicking the IN_DATETIME column header, i wish to sort the recordset by IN_DATETIME. I use the following codes in the DataGrid1_HeadClick(ByVal ColIndex As Integer) function:
strColName = DataGrid1.Columns(ColIndex).DataField
Adodc1.Recordset.Sort = strColName & " DESC"

However, it gave me error as below whenever i click on the IN_DATETIME column :
run-time error '3265': Ado could not find the object in the collection corresponding to the name or ordinal reference requested by the application.

I believe it is because of the sql i used in Adodc1 as the data field name in Adodc1 is recognised as :
to_char(IN_DATETIME,'dd-mm-yyyy hh24:mi:ss')

Is there anyway i can set the ADODC recordset field name manually in the code? I tried :
Adodc.Recordset.Fields(ColIndex) = strColName

but it gave me the following error :
run-time error '91':
Object variable or With block variable not set
Due to some reasons, i must use to_char(IN_DATETIME,'dd-mm-yyyy hh24:mi:ss') in my sql instead of IN_DATETIME.

Can anyone give me some hints how should i go about it? Thanks in advance.

Data Grid And DB Grid
what is the basic difference
b/w datagrid and dbgrid

DB Grid & Data Grid
What is the difference between DB Grid and Data Grid. Both look to have the same features. When do you choose them in a application

Data Environment & Data Grid
I've gotten so much help from everyone, and here's a new one.

I have DE to an Access database with numerous tables. This is what I want to happen...

I have a form where users can enter in a name (first or last name) in two separate text boxes. On clicking a button, the system then searches and then bring up a datagrid of possible matches. Then the user selects a record from the data grid, it brings ups the actual record with 50 or so fields.

Problem. How do I get the datagrid to refresh/filter every time a new search is performed? I tried to filter and get the error

One of the filters strings are:
DE1.rsNameData.Filter = ("LastName LIKE '" & LastName.Text & "%' AND FirstName LIKE '" & FirstName.Text & "%'")

Any suggestions? I really have come to like the DE and not multiple ADODCs since I have several tables to work with

Data Grid Data Entry
I am currently creating "cash register" for my school project.
I never see find VB books that imply in using "data grid" as means of data entry. But when I went to a departemnt sote, I saw the cashier used datagrid (or maybe something that looks like it) as a way to enter the item code. Now, I started to get confused, since I couldnt find any resource to lead me in using DataGrid as a way to entry my data then stored into the database. thank you

Add Data From The Database To Data Grid
How can i add data from the database to the data grid?

Data Environment To ADO In Data Grid
Private Sub Form_Load()
DataGrid1.DataMember = "searcbookcode"
End Sub

does anyone know how to convert this code into ADO code in vb6?I used Data Enviroment (DE) in the code above.I want even a li'l idea how to connect this using ADO.

thanks a lot

Copyright © 2005-08, All rights reserved