If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > display history data in MSHFlexGrid

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-19-04, 05:30
azifa7980 azifa7980 is offline
Registered User
 
Join Date: Aug 2004
Posts: 15
display history data in MSHFlexGrid

hi,
i have a problem where 3 text box that will receive a serial no., location and pin no. .all the data that i key-in will display in the MSHFlexgrid. But i want to show all the history information of the serial no. example: if i key-in serial no.=123456 so in the MSHFlexgrid, it will dispaly all the history data of the serial no. can you tell me how to do it? if possible show me the coding..
thank you.
Reply With Quote
  #2 (permalink)  
Old 08-24-04, 18:34
loquin loquin is offline
Super Moderator
 
Join Date: Jun 2004
Location: Arizona, USA
Posts: 1,797
It would be difficult to discuss this without knowing how the history data is stored.

Essentially, you need to

a) Declare an ADO connection to the database and an ADO recordset
b) Build an SQL Query to retrieve the data needed
c) Execute the query to populate the recordset
d) Copy the data from the recordset to the mshFlexgrid.
e) close the recordset and connection and release their resources.


Here's a good beginners VB/ADO Tutorial. In addition, here is a good set of flexgrid functions that can be easily adapted to your needs.
__________________
Lou
使大吃一惊
"Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
"I have my standards. They may be low, but I have them!" - Bette Middler
"It's a book about a Spanish guy named Manual. You should read it." - Dilbert

Reply With Quote
  #3 (permalink)  
Old 08-26-04, 05:55
azifa7980 azifa7980 is offline
Registered User
 
Join Date: Aug 2004
Posts: 15
re:display history data in MSHFlexGrid

hi,
i tried to make the coding but i have not yet try it. can you please check for me the coding? if there any mistake can you correct it for me?

Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim sql1 As String

Private Sub txtSerialNo_Change()
sql1="select * from master_pcba_debug where serialno LIKE 'XM%'"
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\pcba debug system\debug.mdb;Persist Security Info=False"
rs.CursorLocation=adUseClient
rs.Open sql1,cn,adopenForwardonly,adLockReadOnly
With Adodc1.rs
!serialno = txtSerialNo
!defcausemode = cboDefect.Text
!pinno = cboPinNo.Text
!componentpno = txtICPN
!iclotcode = txtNewLC
!TimeStamp = lblTime
!remark = txtFailure
!reworkact = cboRework.Text
!componentloc = cboLoc.Text
.Requery
End With
Adodc1.Refresh
Set MSHFlexGrid1.DataSource = Adodc1
MSHFlexGrid1.FormatString = "Serial No. | Defect Mode | Location | Pin # | Rework Action | Failure | IC Part No. | New Lot Code | Test Time"
cn.Close
rs.Close
End Sub

I hope that you can help solve this problem. i need it URGENT!
tahnk you.
Reply With Quote
  #4 (permalink)  
Old 08-30-04, 14:32
loquin loquin is offline
Super Moderator
 
Join Date: Jun 2004
Location: Arizona, USA
Posts: 1,797
In the sql assignment, you are specifying that you wish to see all records where the serial number begins with XM.

If you want to return all records where the serial number is 123456, then

sql1="select * from master_pcba_debug where serialno = '123456'" (assuming that the serial number field is a string data type (Varchar, etc.)

Secondly; why are you changing the data within the current record before trying to populate the flexgrid?

Take a look HERE for example mshFlexGrid code.
__________________
Lou
使大吃一惊
"Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
"I have my standards. They may be low, but I have them!" - Bette Middler
"It's a book about a Spanish guy named Manual. You should read it." - Dilbert

Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On