473,486 Members | 2,427 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

how to store data from msflexgrid in to database access

27 New Member
hi,I got few question here. Hope some one can me. plz help me i running out of time
1. how to make my msflexgrid to display data for every 5 min(especially the
number car and average speed.

2. Can the data from msflexgrid store in the database if yes how?



Private Sub Form_Load()
FillFlex

End Sub

Private Sub FillFlex()
On Error Resume Next
Dim lAvg As Long, iCOunt As Integer
Dim intTime As Date

strSql = "SELECT CarID, TimeIn, TimeOut, TimeDuration, Speed" & _
" FROM Car_Details"

iCOunt = 0
FlxRs.Open strSql, DE.Conn, adOpenForwardOnly, adLockReadOnly
Flex.Rows = 1
If FlxRs.RecordCount > 0 Then

For i = 1 To FlxRs.RecordCount
Flex.Rows = Flex.Rows + 1
Flex.TextMatrix(i, 0) = FlxRs(0)
Flex.TextMatrix(i, 1) = FlxRs(1)
Flex.TextMatrix(i, 2) = FlxRs(2)
Flex.TextMatrix(i, 3) = FlxRs(3)
If FlxRs(2).Value <> "" Then
iCOunt = iCOunt + 1
End If
Flex.TextMatrix(i, 4) = FlxRs(4)

FlxRs.MoveNext

lAvg = lAvg + Flex.TextMatrix(i, 4) '= FlxRs(3)
lAvg = Math.Round(lAvg, 2)
Next i
lblNum.Caption = iCOunt
lblAverage.Caption = lAvg / lblNum
lblAverage.Caption = Math.Round(lblAverage.Caption, 2)
Else
lblNum.Caption = ""
End If
FlxRs.Close

End Sub
Apr 19 '08 #1
2 3672
Tenneyson
17 New Member
hi,I got few question here. Hope some one can me. plz help me i running out of time
1. how to make my msflexgrid to display data for every 5 min(especially the
number car and average speed.

2. Can the data from msflexgrid store in the database if yes how?



Private Sub Form_Load()
FillFlex

End Sub

Private Sub FillFlex()
On Error Resume Next
Dim lAvg As Long, iCOunt As Integer
Dim intTime As Date

strSql = "SELECT CarID, TimeIn, TimeOut, TimeDuration, Speed" & _
" FROM Car_Details"

iCOunt = 0
FlxRs.Open strSql, DE.Conn, adOpenForwardOnly, adLockReadOnly
Flex.Rows = 1
If FlxRs.RecordCount > 0 Then

For i = 1 To FlxRs.RecordCount
Flex.Rows = Flex.Rows + 1
Flex.TextMatrix(i, 0) = FlxRs(0)
Flex.TextMatrix(i, 1) = FlxRs(1)
Flex.TextMatrix(i, 2) = FlxRs(2)
Flex.TextMatrix(i, 3) = FlxRs(3)
If FlxRs(2).Value <> "" Then
iCOunt = iCOunt + 1
End If
Flex.TextMatrix(i, 4) = FlxRs(4)

FlxRs.MoveNext

lAvg = lAvg + Flex.TextMatrix(i, 4) '= FlxRs(3)
lAvg = Math.Round(lAvg, 2)
Next i
lblNum.Caption = iCOunt
lblAverage.Caption = lAvg / lblNum
lblAverage.Caption = Math.Round(lblAverage.Caption, 2)
Else
lblNum.Caption = ""
End If
FlxRs.Close

End Sub
hi

pliz Use CODE tags around your code:
Expand|Select|Wrap|Line Numbers
  1. ..code goes here..
and try to resend your question or better, why not ues datagrid

Expand|Select|Wrap|Line Numbers
  1. recordset![Fieldname]=datagrid.columns("columnName")
  2.  
Apr 24 '08 #2
CyberSoftHari
487 Recognized Expert Contributor
hi,I got few question here. Hope some one can me. plz help me i running out of time
1. how to make my msflexgrid to display data for every 5 min(especially the
number car and average speed.
2. Can the data from msflexgrid store in the database if yes how? ...
1. You can use timer control to display data between intervals.
2. Yes,

Expand|Select|Wrap|Line Numbers
  1. strVariable = msfGrid.TextMatrix(1, 1)
Point the reason for you code here?
Apr 24 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
1800
by: clwoods | last post by:
I would like to ask is thier a better way to store data other than access tables, I would still like to keep access as the front end. My main quest I suppose is for more speed and maybe security....
1
6056
by: Joey Liang via DotNetMonster.com | last post by:
Hi all, I am new to ASP.NET, i have met some problems in binding data from a table of database to a dropdown list control. Anyone knows how to do it?if possible can rougly write the codes or any...
1
1464
by: amy | last post by:
*** Sent via Developersdex http://www.developersdex.com ***
0
1318
by: swas | last post by:
Hi, I want to use the MSFlexGrid in Access. For someone who doesn't know VB6 much at all (and just coping with Access...), a couple of questions: 1. Can the MSFlexGrid be bound to an Access form...
2
6469
by: wish | last post by:
Let say i want the data store at array but not only one record but is many records.. in db i use the for loop and while loop to retrieve the data then i want the data store at the array...then how...
0
817
jasjas
by: jasjas | last post by:
my Q is like this, i let user to enter a number, then i wanna checking this number from database . for eg: user enter "12" then i wanna pass to validate which in my database, in my database table...
1
2527
by: tamoochin | last post by:
I have a form that registers the user with my website, the form is in farsi language and must use utf-8 standard. I can store data in MS Access and also read it back with any problems. the...
2
7854
by: diarehman | last post by:
hi all plz help me. i have to store images in database(access at backend) through vb.net. if u have any information plz reply as soon as possible. thanks
0
7100
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6964
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7126
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7330
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5434
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4865
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4559
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1378
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
598
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.