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




How To Display Database Using Flexgrid Control


Hi Guys,

  My question is:How to display database using Flexgrid control in VB?



Rockyram




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
How To Display Flexgrid Data In Report Without Storing In Database
hi

I am developing s/w regarding that how to display flexgrid data in report without storing in database

i tried it with textbox then it is ok with it
but when i try with flexgrid it gives error like subscript is out of range
code is like this

private sub command1_click()
With DataReport1.Sections(1)
 .Controls("txtitemcode").Text = Form1!msflexgrid1.TextMatrix(newrow, 1)
 End With
 DataReport1.Refresh
 DataReport1.Show
end sub

waiting for reply.
thanx in advace

Fast Loading From DataBase To Any Control Like VS Flexgrid
hi

My name is deepak.
VB6.0 Developer

I want to improve my application speed.
Time compare to load from back end to grid is slow.
How can i improve the speed

what are the techs can be used to increase the speed of loading


ADVANCE THANKS FOR REPLY

Database Display Using DataGrid Control
I have made a Table using Access and I use VB to display the content of my Table using ADO and DataGrid Control.

My problem is that one of the field in the Table is a Date Field which I format it in Access as Medium Date but when I displayed it in DataGrid Control it is displayed as "1/2/2005".

How can I displayed it in DataGrid Control as "Dec-01-2005"?

One more thing I want to use the set database password and Is their a possiblity that my VB Appz can change the database password on run-time?

Need your help and suggestion.

Thank u.

FlexGrid Display
May I know if a flexgrid can display

=======
Better
Offer
=======

rather than

==========
Better Offer
==========

Thanks

VBCodes
==============================================
MSF1.Row = 0
MSF1.Col = 1
MSF1.Text = "Better Offer"
==============================================

FlexGrid Display
I would like to display all the record specificy start from

Row = 1
Column = 2

How i can i modify the following Codes? So that it will start display all the records from row = 1 and column =2 to the bottom.

adoRecordset.Open "tb_agent", adoConnection

Do Until adoRecordset.EOF
FlexGrid.AddItem adoRecordset!agentno

adoRecordset.MoveNext
Loop

Can't Display All Records In Flexgrid...help!!!
I'm having ploblems loading an access db of about 4000 records into a flexgrid. For some reason the listings stop at ~700, although the recordset.recordcount = 4093. When I sort the list, records from later in the database show up, but it still won't list more than 700. My flexgrid does not have a maxrecords setting; infact, I set it to 4093, and every row after 700 was blank. It's like the command to set the grid to the recordset is cutting off it's loading process. Access does the same thing to me, by the way: It will open the file to about 700 records, and then it will finish the listing about a second later. Here's the code I'm using, if anyone can help. Thank you very much in advance!

Code:
Private Sub Form_Load()
Dim dbConn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim cMonth As String
Dim cYear As String
Dim fileString As String
If Trim(Dir("c:Program FilesAPPCIMdbLog.txt")) <> "dbLog.txt" Then
cMonth = "august"
cYear = "2002"
Else
Open "c:Program FilesAPPCIMdbLog.inf" For Input As #10
Line Input #10, fileString
cYear = Mid(Trim(fileString), 2, (Len(Trim(fileString)) - 2))
Line Input #10, fileString
cMonth = Mid(Trim(fileString), 2, (Len(Trim(fileString)) - 2))
Close #10
End If
Set dbConn = New ADODB.Connection
dbConn.Open modConnManager.ConnManager((cMonth & ".mdb"), ("clients" & cYear & ""))
Set rs = New ADODB.Recordset
rs.MaxRecords = 5000
rs.Open "SELECT * FROM Clients", dbConn, adOpenKeyset, adLockOptimistic
rs.Update

grdData.Clear
Set grdData.DataSource = rs
frmDebug.txtDebug(4).Text = dbConn.ConnectionString
End Sub

Display Table In VB... Without FLEXgrid...
Hi there!!

I was wondering if anyone could help me with this code...

Code:
'zet properties for db-control
dtaOrder.DatabaseName = App.Path & "orders.mdb"
dtaOrder.RecordSource = "SELECT positie,beschrijving,prijs,levdatum FROM orders WHERE ordernr = " & ordernr & " ORDER BY positie"
dtaOrder.Refresh

'create table
With dtaOrder.Recordset
For i = 1 To .EOF
Load lblPositie(i)
Load lblBeschrijving(i)
Load lblPrijs(i)
Load lblLevdatum(i)

lblPositie(i).Top = lblPositie(i - 1).Top + lblPositie(i - 1).Height + 50
lblBeschrijving(i).Top = lblBeschrijving(i - 1).Top + lblBeschrijving(i - 1).Height + 50
lblPrijs(i).Top = lblPrijs(i - 1).Top + lblPrijs(i - 1).Height + 50
lblLevdatum(i).Top = lblLevdatum(i - 1).Top + lblLevdatum(i - 1).Height + 50

lblPositie(i).Caption = .Fields("positie").Value
lblBeschrijving(i).Caption = .Fields("beschrijving").Value
lblPrijs(i).Caption = .Fields("prijs").Value
lblLevdatum(i).Caption = .Fields("prijs").Value

lblPositie(i).Visible = True
lblBeschrijving(i).Visible = True
lblPrijs(i).Visible = True
lblLevdatum(i).Visible = True

.MoveNext
Next i
End With
It doesnt ouput the labels... but it doesnt give an error too.... can anyone HELP???

few details: the table DOES exist in the db... WITH some values in it...
AND... I already created the first labels with INDEX set to "0".... AND... de variable "ordernr" contains the CORRECT value... so something is wrong/incomplete in the code...

How To Display Records In Flexgrid And When ...
Hi evryone

I have developing s/w.I want records to be displayed in flexgrid and when i double click on flexgrid the selected records must be displayed in related textbox.


Please help me


Waiting for positive reply.

Thnax in advance

Display An Icon In Flexgrid
I have a flexgrid that contains details of files, name, size, type. I would like to replace the type eg "Microsoft Excel" with the MS Excel Icon. Can this be done at all ?

thanks

Methods Of Display In Flexgrid
Hi, Im required to allow a user to select from a combo box containing different departments before displaying the employees from the selected department in the flexgrid. (my rows for the flexgrid would change base on no. of emp in the dept) Q1. How do i set my flexgrid to do the above?

The employees take up one of the columns and Im also required to calculated their years of service base on the year they join/leave the company and display it in one of the column.

====================
employee ::: Yrs of service:::
=====================
mary ::: 0 yrs 6 mths :::
=====================
john ::: 1 yrs 8 mths :::

My Q2. is if my employee column keeps changing whenever the user picks a different department. How am I going to set the yrs of service column to calculate ? Thanks

Display Records In Flexgrid
hi,
i m new to vb.i wanted to know how to display records in a flexigrid.just a sample code.plz help me


regards

Display 2 Tables In One Flexgrid
Is this possible? If so can someone give me an example of how to do it? I can read 1 table in my database and display it in the flexgrid, but am not sure about 2 different tables. I am assuming I will need to use a join?

Display ToolTip In Flexgrid
Display ToolTip in Flexgrid ...?

I Want To Display Records In Flexgrid And When I......
Hi evryone

I have developing s/w.I want records to be displayed in flexgrid and when i double click on flexgrid the selected records must be displayed in related textbox.


Please help me


Waiting for positive reply.

Thnax in advance

Trying To Display SQLserver Table In Flexgrid
connDB = "Provider=SQLOLEDB.1;Persist Security Info=False;Initial Catalog=Dinamiks;Server=(local);UID=" & sname & ";PWD="

rs.Open sSql, connDB, adOpenForwardOnly, adLockReadOnly

Set mshfGridOne.DataSource = rs
The above statement is giving me an error 300023 "unable to acces data - data source settings may be incorrect etc." I have opened the recordset and tested for eof already so know it's an ok sql - any ideas?i

How To Display Flexgrid Data In Report
Hi Everyone

I want to be displayed data of flexgrid row in datareport without storing in data base
i tried it with textbox it is ok
i tried like given below
private sub command1_click()
but with fleWith DataReport1.Sections(1)
.Controls("txtitemcode").Text = Form1!msflexgrid1.TextMatrix(newrow, 1)
End With
DataReport1.Refresh
DataReport1.Showxgrid
end sub

it gives error likw subscript is out of range

Please help me

Waiting for reply

Auto Display Variables In Flexgrid???
This will take me hours. Doubt there is but i'm hoping maybe.
I have A LOT of global variables that I want to display in a flex grid.

They vary from boolean values to 2d arrays. Reckon I got about four or five more painful hours at the rate i'm going.

Any suggestions?

VB Code:
i = i + 1MSHFlexGrid1.TextMatrix(i, 0) = "Ezx"MSHFlexGrid1.TextMatrix(i, 1) = Ezxi = i + 1MSHFlexGrid1.TextMatrix(i, 0) = "Ezy"MSHFlexGrid1.TextMatrix(i, 1) = Ezyi = i + 1MSHFlexGrid1.TextMatrix(i, 0) = "Check"i = i + 1MSHFlexGrid1.TextMatrix(i, 0) = "VoidA (4)"For j = 1 To 4MSHFlexGrid1.TextMatrix(i, j) = VoidA(j)Next ji = i + 1MSHFlexGrid1.TextMatrix(i, 0) = "VoidB (4)"For j = 1 To 4MSHFlexGrid1.TextMatrix(i, j) = VoidB(j)Next j

How To Display Tab Char In A FlexGrid Cell
Dear All Friends,

Greetings,
If my string contains Tab characters like:

05/03/19990001CHEUNG KONG70.5071.069.2570.253246600


but I wish to display the string within one column only, how can I achieve this because FlexGrid can automatically detects a Tab char and sepearate the next item into a new column?

Thanks

Flexgrid Click And Display In Textboxes
Hi,

I have a flexgrid on a form when i select one of the items in it been displayed from a access database i want for it to display other itmes in textboxes.

Example: i have a flexgrid1 and it displays all the items from a database field. So it displays : john, Carlos, and Pepe then if i click on john it displays in the textboxes john sex, age, hobbies etc... How can i do this please help....

So in other word flexgrid click then display textbox.

Help me....

Flexgrid Does Not Display Integer Values
MSFlexGrid1.AddItem CStr(myRecordset.Fields("OrgName").Value)

The above line of code does not do what i thought it will do.
Following is what i am trying to solve.
on my Form i have a MSFlexgrid which gets its values from the Access database. This grid shows a blank row if the value in the row begins with integer or varchar that starts with an integer. could someone please tell me how i can make something like following appear in the flexgrid row. thanks.
123 Durham St

If the value is "Durham St 123 Apt 1" it is displayed in the flexgrid. But if the value is "123 Durham St Apt 1" it is NOT displayed in the flexgrid.
I have been trying to figure this out for past few days and an really frustrated now as i am approaching my deadline. could someone please help me fix this. thanks alot...Please help.

Display Data From 2 Tables Into 1 Flexgrid
Is this possible? Could someone show me an example of how to display it into a flexgrid. I am assuming I need to use a join on the 2 tables, but how then do I get the data to a flex grid. I am able to display one table in a flexgrid by reading the data into a recordset and then populating the flexgrid, but am not sure about two?
Thanks

Display Records Into A Datagrid Or FlexGrid
Hello everybody,
I have a MS Access database and i want to see some entries from a table into a datagrid or FlexGrid from a form.
The records are not the same everytime because they depend from a SQL statement wich gets 2 variables.
When i use the datamember and datasource from the properties window i can`t see anything, but if i use an SQL statement wich doesn`t get any variables i can see the records just fine,
Does anybody knows how can i show the records into the Datagrid or the flexGrid???
I tryed the Refresh property but it doesn`t work...
When i open the SQL statement into the Form_Initialize() sub then it works just fine....

How To Display The Selected FlexGrid Cell.
Hi,
I have written an ActiveX component that uses a FlexGrid to display all my fonts.
When a font is selected by code, (and NOT by clicking on the FlexGrid) I set the .Row value to point to the FlexGrid cell.
My problem is when I select a item by code, if the cell is above or below
the displayed area in the FlexGrid it's not scrolled to show it.
So I need some code to scroll the FlexGrid to the selected row and column.
I've tryed MSFlexGrid1.ScrollTrack=True with out any luck.

I have attached a simple program (ShowSelectedCell.zip) to show what I mean.

Mark.

How To Display Selected FlexGrid Data In A Label
Attempting to make a graphical input for form data. So I populate a 132x60 grid with data from the form. When I select/highlight I want to be able to display what I selected in a label.

So If

12345678901234567890
ABC Company

So If select cols 3 through 13. I want the label to display "ABC company" is this possible?

Display Sql Data To Flexgrid Via Stored Procedure
Hi there I am struggling with this stored procedure in vb6. I have written all the code but it gives me a subscript out of range error. I have attached the code in the app and then the sp afterwards. What I am trying to do is to select data from tblTargetSpendPerHead from sql via a stored procedure, and then display it in a flexgrid. I would appreciate any help.


Code:

Private Sub cmdList_Click()
    On Error GoTo ErrHand
   
    Set conSQL = New ADODB.Connection
    Set Cmd = New ADODB.Command
           
    conSQL.Open sDBsrc
   
    Cmd.ActiveConnection = conSQL
    Cmd.CommandText = "dbo.prcTargetLoad"
    Cmd.CommandType = adCmdStoredProc
   
    ' First Parameter
    With oParam(0)
        .Name = "@FltNo"
        .Direction = adParamInput
        .Type = adVarNumeric
        .Size = 7
    End With
     Cmd.Parameters.Append oParam(0)
   
    ' Second Parameter
    With oParam(1)
        .Name = "@LegNo"
        .Direction = adParamInput
        .Type = adInteger
        .Size = 4
    End With
     Cmd.Parameters.Append oParam(1)
     
     ' Third Parameter
     With oParam(2)
        .Name = "@EffTargetDate"
        .Direction = adParamInput
        .Type = adDate
        .Size = 4
    End With
     Cmd.Parameters.Append oParam(2)
     
     ' Fourth Parameter
     With oParam(3)
        .Name = "@EndTargetDate"
        .Direction = adParamInput
        .Type = adDate
        .Size = 7
    End With
     Cmd.Parameters.Append oParam(3)
   
    ' Fifth Parameter
    With oParam(4)
        .Name = "@SpendPerHead"
        .Direction = adParamInput
        .Type = adCurrency
        .Size = 8
    End With
     Cmd.Parameters.Append oParam(4)
   
    For k = 1 To flxgrid.Rows - 1
    flxgrid.TextMatrix(k, 1) = Cmd.Parameters(0).Value
    flxgrid.TextMatrix(k, 2) = Cmd.Parameters(1).Value
    flxgrid.TextMatrix(k, 3) = Cmd.Parameters(2).Value
    flxgrid.TextMatrix(k, 4) = Cmd.Parameters(3).Value
    flxgrid.TextMatrix(k, 5) = Cmd.Parameters(4).Value
    Cmd.Execute
    Next

    Set Cmd = Nothing
    Set conSQL = Nothing
     
Exit Sub
ErrHand:
    MsgBox (Err.Description)

End Sub



Stored Procedure:

CREATE PROCEDURE dbo.prcTargetLoad

@FltNo Varchar,
@LegNo Integer,
@EffTargetDate Datetime,
@EndTargetDate Datetime,
@SpendPerHead Float

AS



select FltNo From tblTargetSpendPerHead where FltNo = @FltNo
GO




thanks

MSH FlexGrid Doesn't Display When Data Ordered!
I have a MSHFlexGrid control on my form.

It gets its data from a command in the DataEnvironment.

When this command ran originally it populated the MSHflexgrid with the following:

Machine ProductCode
A1 UKS44444
A2 UKS44445
A3 UKS44446

I have now reordered my data using the command as follows:

ORDER BY Machine DESC

However, what happens the datgrid only shows the following:

A1 UKS44441

Whereas I want it to display:

A3 ......
A2 ......
A1 ......

Any Ideas!

LJ

How To Display The Flexgrid Columns Values According To The Text
Hai friends,

   In my project, i am using Flex grid. I am adding, display(Form load, search) the description Text in the Flex grid.

    What i am in need of is, when the user searches the particular record, i want to show the whole description text in the flex grid. My description is in Column 2. I want to view all the text in that column 2. how to manipulate that.

   So far, when the user searches a record, its display in the flex grid looks( see the attachment "SearchDisplay.jpg")

  how to increase the width of the flexgrid according to the text dynamically

help needed    

Regards

Geetha

Flexgrid ToolTipText To Display Info In Containter Mouse Is Over.
Is it possible to have the ToolTipText display the data in the container directly under the mouse? For example, if I put my mouse on row 6, column 18, it will show the data in that container. I want to do this because I occassionaly have data that greatly extends the defined width of the column. The user can always manually change this, but I want to be able to move-over to see it as well. If this isn't an option, then I can either create my own ToolTipText (though I don't want to) or I'll just create a label for the Click event.

Can't Display Saved CheckBox Values Upon Clicking A Row In FlexGrid!!Help
I have this problem where my program can't show the saved CheckBoxes when I click a row in the MSFlexGrid. I've included an image below:



You can see that, no 'checked' are being displayed in the chkbox section, although i've 'checked' some of it and save the record. No problems with the textfields. only the checkboxes. Anyone who knows how to retrieve the checked values from the MSAccess file, and upon clicking a row in FlexGrid, it will display which are checked and unchecked boxes for each row in FlexGrid?? thanks in advance to those who are wiling to help me.

Flexgrid - Select One/multiple Row(s) And Display Record On New Form In Textboxes
I have a form that uses a FlexGrid...
and also a form that has simply got textboxes and buttons.


What I would like is...
That when the user selects one row in the Flexgrid

that they can press a command button and it will take them to the same record on another form (the other form only displays one record at it time, but not on a flexgrid) - so it would be something like...

newform.Open record WHERE newform.txtUserID = flexgrid.UserID

I know that is not the correct syntax but that is the general idea of what I am after.

(NOTE:The "New Form" does not have a flexgrid, all it contains are textboxes and buttons, which is why it can only display one record at a time.
Each textbox is for each field in the recordset.)


The only problem with this is that it seems a user can select/highlight more than 1 row at a time... (ie. this means more than one record at a time :S) ... for example I can highlight 5 rows...

This creates difficulties as what happens if the user highlights 5 rows and clicks the command button - surely the system can do nothing but throw up an error because it cannot know which record to visit?


How do I overcome this ?


Or maybe instead of overcoming, I could benefit from its use?

I could pass the USERID (keyfield in the Table which is displayed on the Flexgrid) of all 5 highlighted rows to another Recordset or Listbox and let the user view them on the new form, by cycling one by one through the recordset/items in the listbox, and displaying each in turn on the new form?

Only problem is, I don't know how to code this and have no idea if I was to do it the other way (to only select one at a time).


Can anyone please help with this?

Thanks

Flexgrid - Select One/multiple Row(s) And Display Record On New Form In Textboxes
I have a form that uses a FlexGrid...
and also a form that has simply got textboxes and buttons.


What I would like is...
That when the user selects one row in the Flexgrid

that they can press a command button and it will take them to the same record on another form (the other form only displays one record at it time, but not on a flexgrid) - so it would be something like...

newform.Open record WHERE newform.txtUserID = flexgrid.UserID

I know that is not the correct syntax but that is the general idea of what I am after.

(NOTE:The "New Form" does not have a flexgrid, all it contains are textboxes and buttons, which is why it can only display one record at a time.
Each textbox is for each field in the recordset.)


The only problem with this is that it seems a user can select/highlight more than 1 row at a time... (ie. this means more than one record at a time :S) ... for example I can highlight 5 rows...

This creates difficulties as what happens if the user highlights 5 rows and clicks the command button - surely the system can do nothing but throw up an error because it cannot know which record to visit?


How do I overcome this ?


Or maybe instead of overcoming, I could benefit from its use?

I could pass the USERID (keyfield in the Table which is displayed on the Flexgrid) of all 5 highlighted rows to another Recordset or Listbox and let the user view them on the new form, by cycling one by one through the recordset/items in the listbox, and displaying each in turn on the new form?

Only problem is, I don't know how to code this and have no idea if I was to do it the other way (to only select one at a time).


Can anyone please help with this?

Thanks



Edited by - VBKid04 on 4/5/2004 6:50:04 PM

Microsoft FlexGrid Control" - Using Control, Licencing
I want to put "Microsoft FlexGrid Control" on my Outlook form.

I can't do it because the message box is shown:
"The control could not be created because it is not properly licensed."

Display A Form Control's Text/caption To A Data Report Control
Hi to all!!!

Any idea on how to display a form control's text property/caption to a data report control?

Say, I have a form(frmProcessCustomer) that accepts a customer name in a textbox.Then I would like to display the customer name from the textbox(.text property) to my data report using rpttextbox/rptlabel when I view the report...

Database And Flexgrid
i have a table called "artigos"

i want to display for inventory some fields of this table in a flexgrig.
but i want the last column of the flexgrid to be the sum of two columns of the same flexgrid.

is this possible ?
how do i do it ?

EX: column 3 is the stock
column 4 is the unit price
column 5 = should be (column 3 * column 4)

from emidio braga.

Database And Flexgrid
i use a flexgrid to display the records of a table.
i chose the record for update by clicking in the flexgrid's row that represents the record i want to change.

my question is:
After i make a record update and then a data refresh, i lose the flexgrid position where i was before the data refresh, because the flexgrid reads all entire table again.

is there a way to keep the same position in the flexgrig after a make the data refresh ?

hope someone can help me...

Database Using Flexgrid
Hi All,
My flexgrid is populated with product records. i.e.

Product Name | Category | Price | etc
HDD 160GB Storage 053
Compaq 17" Monitor 175


I was wondering whether it is possible to arrange a column into maybe alphabetical order in the product name column (when the product name cell is pressed). Or Maybe arrange the records into price numerical order???

Thanks For Viewing.

Flexgrid And Database
Hi Just after soem help

I have a msflexgrid that i am using to populate data from a recordeset. Some of these fields have dates in them i have written code to sort each of the columns in asc or desc headings however the date field does not work with this it sorts the colum out numerically i have attached the code if someone can help with it it would be greatly appreciated.


Code:


' Hide the FlexGrid.
msflxOrders.Visible = False
msflxOrders.Refresh

' Sort using the clicked column.
msflxOrders.Col = sort_column
msflxOrders.ColSel = sort_column
msflxOrders.Row = 0
msflxOrders.RowSel = 0

' If this is a new sort column, sort ascending.
' Otherwise switch which sort order we use.
If m_SortColumn <> sort_column Then
m_SortOrder = flexSortGenericAscending
ElseIf m_SortOrder = flexSortGenericAscending Then
m_SortOrder = flexSortGenericDescending
Else
m_SortOrder = flexSortGenericAscending
End If
msflxOrders.Sort = m_SortOrder

' Restore the previous sort column's name.
If m_SortColumn >= 0 Then
msflxOrders.TextMatrix(0, m_SortColumn) = Mid$(msflxOrders.TextMatrix(0, m_SortColumn), 3)
End If

' Display the new sort column's name.
m_SortColumn = sort_column
If m_SortOrder = flexSortGenericAscending Then
msflxOrders.TextMatrix(0, m_SortColumn) = "> " & msflxOrders.TextMatrix(0, m_SortColumn)
Else
msflxOrders.TextMatrix(0, m_SortColumn) = "< " & msflxOrders.TextMatrix(0, m_SortColumn)
End If

'Debug.Print sort_column; msflxOrders.Col; m_SortColumn '@

' Display the FlexGrid.
msflxOrders.Visible = True
End Sub

Flexgrid/database Help
Okay, i am making a data importer application where i have where i have a source db and destination db. i have it so fields in a selected source table, go in one list box, and fields in the destination table go into a second list box. then i have it so, i can select differnt fields from the source table and add then to the first column (source column) of a flexgrid, and selected destination fields to the second column(destination) of the flexgrid.

I now need it, so when i click the import button that it selects all the fields from the source column (of flexgrid) and inserts the records into the corresponding fields (that i selcted and put into the dest. column of flexgrid) in the destination table.

So in the end, all the records from the source tables in the fields i selected should be imported to the corrisponding fields in the destination table.

I hope that isnt to confusing.

-Ryan

FlexGrid && Database
Hello
is it possible to make The msflexgrid to act as Database like access or anything?
So you can add new data, reords ,modify,delete,....
How can anyone do That?
Thanks alot for advice



Egyptian Man

Flexgrid And Database
Dear all,

How do i populate the records from database in flexgrid control using ado reference ?
Please show me the code .

Thanks

Flexgrid To Database/spreadsheet
how can i send data from a flex grid on form1 to a spreadsheet/database on form 2. coz i want to gather user scores with it.

FLEXGRID With Access Database
is it possible to display only some fields of the current table in the flexgrid ??

i need to select all the fields but i just want do display some of them in the flexgrid !

thanks for help

emidio braga

Using Flexgrid To Update A Database
Hi there

can any 1 tel me if a flexgrid control be used for updating a database.
like for example with a datagrid u could directly change the values in the rows and columns and the changes are automatically written to the dtabase

Thanks

A Little Help With FlexGrid And Access Database
Can you please tell me how can I show part of a database on a FlexGrid?

I want the program to run through the database making comparisons and if the comparison is true then it will show the data to the flexgrid.

I will give you an example...


Supposing we have an *.mdb file (DB1.mdb) with a table in it named ATBL with 7 fields (N,ID,NAME,GRADE,SF,T,C).

Then the program (in VB6) will take a value (integer) from the user through a textbox, will open the database and then will compare this value with the 4th field of the ATBL table (the GRADE field, which is also integer). Then if the value is >= from the Grade Field it will show all the 7 fields of the same line into a flexgrid.

I want to do something like that. Can you please help me or tell me where can i read something to do that?


Really thank you for your time!

Database && Flexgrid Working Then NOT?
I am having a most confusing time trying to understand how to work with a database and an msflexgrid which displays the data.

I have two forms one of which saves the data to the database (f1) and another which has the msflexgrid and is used to edit / delete / sort and search for the existing data (f2).

The problem I have is that when I add a record to the database in form1 then goto f2 the flexgrid does not always display the current number of records, I mean that it does not display the last record saved to the database. Now if on f2 I click a combox which is coded to refill the flexgrid then all is OK and all of the records are displayed.

But the thing I cannot understand is why this does not happen each time? It sometimes happens and sometimes it does not?

The question I have is that why is this as I have called this click event before displaying f2 therefore it should have happened already if you understand what I mean? (and I accept that you may not).

Now I think the problem maybe how I am using the flexgrid to display the records.

What I am doing is each time I load or activate f2 is creating a recordset and repopulating the flexgrid and then closing the recordset should I always leave it open just like the DB connection.

Problem With Flexgrid And Database
Hi:

I have a problem here very strange.
When I click in the records in the flexgrid I just can see the first recordset.
I don't know why this happens because I have try this subroutine in many programs,but now he not works.Problem in the database?I don't know!!!
I post the project!
Can anybody help me?

Thanks

Flexgrid To Database...help Needed
hi sir

m using vb6 and sql server 7...
got a problem...really hope can get advice or some tip here...:(...
im using flexgrid instead of datagrid because its easier to pu combobox on the grid...
my flexygrid has data derived from database...
i want to make student attendance list for a day and on the lis have (absence) or (not absence) combobox...
so eachrow has a student name and combobox (in a another column on a flexgrid....
this is my current code...

'my combobox stats
Private Sub Combo1_Click()
Me.MSFlexGrid1.TextMatrix(Me.MSFlexGrid1.Ro w Me.MSFlexGrid1.Col) = Me.Combo1.Text
Me.Combo1.Visible = False
Me.Combo1.Clear
End Sub

'my combobox values
Private Sub Combo1_DropDown()
Dim i As Integer

For i = 0 To 1
If i = 0 Then Me.Combo1.AddItem "hadir"
If i = 1 Then Me.Combo1.AddItem "tidak hadir"
Next i
End Sub

'my main form
Private Sub Form_Load()
Dim c As Integer
Dim r As Integer

Me.Combo1.Visible = False
Me.Combo2.Text = "Pilih Bulan Disini"

With Me.MSFlexGrid1
For c = 0 To 2
If c = 0 Then .ColWidth(c) = 2500
If c = 1 Then .ColWidth(c) = 1000
If c = 2 Then .ColWidth(c) = 2000
End With
End Sub

'my flexgrid values
Private Sub MSFlexGrid1_Click()

Me.Combo1.Width = Me.MSFlexGrid1.CellWidth + 15
Me.Combo1.Top = Me.MSFlexGrid1.CellTop + Me.MSFlexGrid1.Top
Me.Combo1.Left = Me.MSFlexGrid1.CellLeft Me.MSFlexGrid1.Left
Me.Combo1.Visible = True

End Sub

the problem is i just cant find a way to insert those value (combobox values on the datagrid) into my database table, iv used some method but it just wont do...can we store informatio from the felxygrid or not?....so i get quite stuck here so hop anyone could give me tips or advice here....im using adod connect to the flexgrid...i m really need help badly...:(...

Flexgrid To Database Problem..please Help Me...
hi everyone...

im in need of advice or any tips...
im using mssql7 and vb6...
do anyone know how to insert data from combobox(column) in flexgrid into database....
this is my current code...

'my combobox values when on click...
Private Sub Combo1_Click()
Me.MSFlexGrid1.TextMatrix(Me.MSFlexGrid1.Row, Me.MSFlexGrid1.Col) = Me.Combo1.Text
Me.Combo1.Visible = False
Me.Combo1.Clear
End Sub

'my combobox values
Private Sub Combo1_DropDown()
Dim i As Integer

For i = 0 To 1
If i = 0 Then Me.Combo1.AddItem "hadir"
If i = 1 Then Me.Combo1.AddItem "tidak hadir"


Next i
End Sub

'my main form coding contain a msflexgrid values
Private Sub Form_Load()
Dim c As Integer
Dim r As Integer

Me.Combo1.Visible = False
Me.Combo2.Text = "Pilih Bulan Disini"

With Me.MSFlexGrid1
For c = 0 To 2
If c = 0 Then .ColWidth(c) = 2500
If c = 1 Then .ColWidth(c) = 1000
If c = 2 Then .ColWidth(c) = 2000
Next c
End With
End Sub

'my flexgrid
Private Sub MSFlexGrid1_Click()

Me.Combo1.Width = Me.MSFlexGrid1.CellWidth + 15
Me.Combo1.Top = Me.MSFlexGrid1.CellTop + Me.MSFlexGrid1.Top
Me.Combo1.Left = Me.MSFlexGrid1.CellLeft + Me.MSFlexGrid1.Left

Me.Combo1.Visible = True

End Sub

my current situation...
-my flexgrid (derived some data from database table),will show up a combobox when we click on a coloumn
-so the empty column will have a value
-i want to insert the values using insert statement into database table

and there is the problem begin...how to insert the values that we put on flexgrid into database...im using some method and but it wont do...
i have try using datagrid...but it doesnt work well with my codes and the idea so ive to choose using the flexgrid...

plz...can someone has the answers or tip or some advice to solve this problem...:(...really in need...

Copyright 2005-08 www.BigResource.com, All rights reserved