Symbianize Forum

Most of our features and services are available only to members, so we encourage you to login or register a new account. Registration is free, fast and simple. You only need to provide a valid email. Being a member you'll gain access to all member forums and features, post a message to ask question or provide answer, and share or find resources related to mobile phones, tablets, computers, game consoles, and multimedia.

All that and more, so what are you waiting for, click the register button and join us now! Ito ang website na ginawa ng pinoy para sa pinoy!

Exclusively for Visual Basic 6.0 Programmers Only!

Re: HELP mga SIRS!!

Hi!
Try this one, it might help you on MS Chart.
Medyo matagal ko na din di ginagamit eh..
Pero ang ginagawa ko lang dati, nilalagay ko lang sa Array ang Data ko, then set Chart.ChartData = Array

Heto ang sample..
1. On your form, put MS Chart Control and 1 Command Button.


Or Place another Command Button and paste this code.


I know, meron akong help file ng MS Chart, hanapin ko na lang.

-Sir/Mam. Do know how to put the data from SYBASE(PowerBuilder) to chart/graph using Visual Basic6??

idea, suggestion or comment accepted
 
How To Graph Data From A Database.

Im using Sybase as database ..

Visual basic6 as frontend.

...gusto ko sana, na ilagay sa CHART yung mga data coming from my database..
 
Re: How To Graph Data From A Database.

thx sa advice Sir. ((MSchart properties..))

1. ano po ba ang gagamitin kong properties para baguhin ang icon sa gilid ng SERIES?? see picture.


View attachment 749295
:pray: :pray:

Heto ang list ng mga available markers...

The VtMarkerStyle constants provide options for displaying data point markers.

Constant Description

VtMarkerStyleNull Suppressed
VtMarkerStyleDash Dash marker
VtMarkerStylePlus Plus marker
VtMarkerStyleX X marker
VtMarkerStyleStar Star marker
VtMarkerStyleCircle Circle marker
VtMarkerStyleSquare Square marker
VtMarkerStyleDiamond Diamond marker
VtMarkerStyleUpTriangle Triangle marker
VtMarkerStyleDownTriangle Down triangle marker
VtMarkerStyleFilledCircle Filled circle marker
VtMarkerStyleFilledSquare Filled square marker
VtMarkerStyleFilledDiamond Filled diamond marker
VtMarkerStyleFilledUpTriangle Filled triangle marker
VtMarkerStyleFilledDownTriangle Filled down triangle marker
VtMarkerStyle3dBall Three-dimensional ball marker


sir knives. salamat ng marami... hehe..
pag aaralan ko muna yung flow ng system tapos ask nalang ako kung may mga hindi ako maintindihan..

Grabe kasi yung system na hinaHANDLE ko e, weak/newbie palang ako, bigatin na agad tong system na to.. hmm. kaya need ko talaga ng tulong mga kaSYMBIANZE :DD..


sa MSCHART na yung FOCUS ko ngayon eh. Pinapagawa ako ng Graph about sa database nila using VB6.


---Nga po pala and DAPAT na gamit na chart eh XY(Scatter) or VtChChartType2dXY..

TRY ko po yung code sir. Knives, at wait ko po yung "help file ng MS Chart" nyo.. pag aaralan ko din :)) thx talaga.. di ko pa kasi gamay yung mschart..
:pray::pray::pray::pray:


Naka-attach ang help file...

-Sir/Mam. Do know how to put the data from SYBASE(PowerBuilder) to chart/graph using Visual Basic6??

idea, suggestion or comment accepted

Im using Sybase as database ..

Visual basic6 as frontend.

...gusto ko sana, na ilagay sa CHART yung mga data coming from my database..

Loop through all recordset, ilagay mo na lang sa Array.
Then yung array na yun ang magiging ChartData ng MS Chart mo.

Creativity and imagination....
Kahit ano pang database yan. Pwede yang palitawin sa MS Chart.
 

Attachments

  • MSCHRT98.zip
    189.2 KB · Views: 30
Re: How To Graph Data From A Database.

Heto ang list ng mga available markers...

The VtMarkerStyle constants provide options for displaying data point markers.

Constant Description

VtMarkerStyleNull Suppressed
VtMarkerStyleDash Dash marker
VtMarkerStylePlus Plus marker
VtMarkerStyleX X marker
VtMarkerStyleStar Star marker
VtMarkerStyleCircle Circle marker
VtMarkerStyleSquare Square marker
VtMarkerStyleDiamond Diamond marker
VtMarkerStyleUpTriangle Triangle marker
VtMarkerStyleDownTriangle Down triangle marker
VtMarkerStyleFilledCircle Filled circle marker
VtMarkerStyleFilledSquare Filled square marker
VtMarkerStyleFilledDiamond Filled diamond marker
VtMarkerStyleFilledUpTriangle Filled triangle marker
VtMarkerStyleFilledDownTriangle Filled down triangle marker
VtMarkerStyle3dBall Three-dimensional ball marker





Naka-attach ang help file...





Loop through all recordset, ilagay mo na lang sa Array.
Then yung array na yun ang magiging ChartData ng MS Chart mo.

Creativity and imagination....
Kahit ano pang database yan. Pwede yang palitawin sa MS Chart.








Sir, salamat po sa mga help file at sa tip na din :)..


SCENARIO:



---as of now, eto palang yung binigay nilang info. about sa kanilang database sa akin..
"SYBASE CENTRAL".. dito naviview ko yung tables and columns but not the data.. see pics..
View attachment 125110


eto naman yung kanilang system..
View attachment 125111
bale dito lang ako bumabase sa data nila...



Here's the question..
1. Posible ba na magawa kong itransfer ito sa chart kahit di ko pa nakikita yung data nila ?
accdg. to them para ma View ko daw yung data dapat meron akong POWERBUILDER na nakainstall sa pc ko.

2. kung possible, paano ko itaTransfer yung data sa MSChart ng VB6, Kahit isang halimbawa lang sir. makukuha ko na to, dami kasing graph na gagawin at isa pa di ko pa gamay itong SYBASE, tanging alam ko lang is MSAccess, SQL at MYSQL..
 

Attachments

  • sybasecentral.JPG
    sybasecentral.JPG
    80.9 KB · Views: 6
  • system.jpg
    system.jpg
    121.1 KB · Views: 10
Re: How To Graph Data From A Database.

Sir, salamat po sa mga help file at sa tip na din :)..


SCENARIO:



---as of now, eto palang yung binigay nilang info. about sa kanilang database sa akin..
"SYBASE CENTRAL".. dito naviview ko yung tables and columns but not the data.. see pics..
View attachment 749888


eto naman yung kanilang system..
View attachment 749889
bale dito lang ako bumabase sa data nila...



Here's the question..
1. Posible ba na magawa kong itransfer ito sa chart kahit di ko pa nakikita yung data nila ?
accdg. to them para ma View ko daw yung data dapat meron akong POWERBUILDER na nakainstall sa pc ko.

2. kung possible, paano ko itaTransfer yung data sa MSChart ng VB6, Kahit isang halimbawa lang sir. makukuha ko na to, dami kasing graph na gagawin at isa pa di ko pa gamay itong SYBASE, tanging alam ko lang is MSAccess, SQL at MYSQL..

Ask ko lang, using VB6 kaya mo bang i-retrive ang data from your database? I think, yun ang unang dapat mong aralin.

Try mo lang, ilagay mo sa listview.
Pag nagawa mo yun, same logic sa para mailipat sa graph.

Dati, meron akong ginawa, isang form na may graph,
then madami ng pwedeng palitawin na graph galing sa form na yun, dynamic siya...
 
Re: How To Graph Data From A Database.

Ask ko lang, using VB6 kaya mo bang i-retrive ang data from your database? I think, yun ang unang dapat mong aralin.

Try mo lang, ilagay mo sa listview.
Pag nagawa mo yun, same logic sa para mailipat sa graph.

Dati, meron akong ginawa, isang form na may graph,
then madami ng pwedeng palitawin na graph galing sa form na yun, dynamic siya...




--eto sir yung code ko para maView ko yung data sa listview.. naviView ko na sir..


Code:
Private Sub lblReport_Click()
    Dim RS As ADODB.Recordset
    Dim begindate As Date
    Dim lstdate As Date
    Dim STRSQL As String
    Dim strStatus As String
    Dim vType As Byte
    
    If validateSite Then
        Screen.MousePointer = vbHourglass
        
        lv.ListItems.Clear
'        If cboVehicle.ListIndex = cboVehicle.ListCount - 1 Then
'            'All vehicle is selected
'            strVCriteria = ""
'        Else
            STRSQL = "SELECT vehicle_type FROM " & VEHICLE_TYPES & _
                     " WHERE description ='" & RemoveQoute(cboVehicle.List(cboVehicle.ListIndex)) & "'"
            Debug.Print STRSQL
            
            Set RS = getData(STRSQL, adLockReadOnly, adOpenForwardOnly, adUseClient)
            strSCriteria = "site_id='" & cboSites & "'"
            strVCriteria = "AND vehicle_type=" & RS!vehicle_type
            vType = RS!vehicle_type
            
            Call CloseRecordset(RS)
'        End If
        Set RS = gConnect1.Execute("sp_report_vsummary '" & cboSites & "'," & vType & ",'" & CDate(format(dtp1.Value, DATEFORMAT)) & "','" & CDate(format(dtp2.Value, DATEFORMAT)) & "'")
        
        begindate = format(dtp1.Value, DATEFORMAT)
        RS.Sort = "date_survey ASC"
        Do
            lstdate = getdate(begindate)
            RS.Filter = "date_survey >= #" & begindate & "# and date_survey <= #" & lstdate & "#"
            
            Call Fillrecord(RS, begindate, lstdate)
            begindate = DateAdd("d", 1, lstdate)
        Loop Until lstdate = format(dtp2.Value, DATEFORMAT)
        Call CloseRecordset(RS)
        
        PreviewStatus lv.ListItems.Count > 0
        If lv.ListItems.Count = 0 Then
             MsgBox "No records found", vbOKOnly + vbInformation, "Report"
        End If
        
        Screen.MousePointer = vbDefault
        mdiMain.mnuExport.Enabled = lv.ListItems.Count <> 0
    End If
End Sub








Private Function validateSite() As Boolean
    Dim strError As String
    Dim intErrorCnt As Integer
    Dim STRSQL As String
    Dim RS As ADODB.Recordset
    
    Screen.MousePointer = vbHourglass
    
    validateSite = True
    intErrorCnt = 1
    If cboSites = "" Then
        strError = intErrorCnt & ") Please fill-in all required information."
        intErrorCnt = intErrorCnt + 1
        validateSite = False
    End If
    
    STRSQL = "SELECT site_id FROM " & SITES & _
             " WHERE site_id='" & RemoveQoute(cboSites.Text) & "'"
    Debug.Print STRSQL
        
    Set RS = getData(STRSQL, adLockReadOnly, adOpenStatic, adUseClient)
    If RS.EOF Then
        If Trim(strError) = "" Then
            strError = intErrorCnt & ") Survey Site ID not found."
        Else
            strError = strError & vbCrLf & intErrorCnt & ") Survey Site ID not found."
        End If
        intErrorCnt = intErrorCnt + 1
        validateSite = False
        Call CloseRecordset(RS)
    End If
    
    If dtp1.Value > dtp2.Value Then
        If Trim(strError) = "" Then
            strError = intErrorCnt & ") Invalid date range."
        Else
            strError = strError & vbCrLf & intErrorCnt & ") Invalid date range."
        End If
        intErrorCnt = intErrorCnt + 1
        validateSite = False
    End If
    Screen.MousePointer = vbDefault
    
    If Not validateSite Then
        MsgBox strError, vbExclamation, "Validate"
    End If
End Function
 
Last edited:
Hello Everyone!


1. I just want to ask if it's Possible to Migrate visual basic 6.0 to visual studio 2012 directly? if not. what will be the steps on how to migrate vb6 to vs 2012?


2. Paano kunin ang data sa listview at ilagay sa array upang gamitin sa chart gamit ang Visualbasic6.

Thanks
 
Re: How To Graph Data From A Database.

Hello Everyone!


1. I just want to ask if it's Possible to Migrate visual basic 6.0 to visual studio 2012 directly? if not. what will be the steps on how to migrate vb6 to vs 2012?


2. Paano kunin ang data sa listview at ilagay sa array upang gamitin sa chart gamit ang Visualbasic6.

Thanks

Pwede yan from VB6 to VB.Net, how? aralin mo ang vb.net.
Manually gagawa ka ng new program.

--eto sir yung code ko para maView ko yung data sa listview.. naviView ko na sir..


Code:
Private Sub lblReport_Click()
    Dim RS As ADODB.Recordset
    Dim begindate As Date
    Dim lstdate As Date
    Dim STRSQL As String
    Dim strStatus As String
    Dim vType As Byte
    
    If validateSite Then
        Screen.MousePointer = vbHourglass
        
        lv.ListItems.Clear
'        If cboVehicle.ListIndex = cboVehicle.ListCount - 1 Then
'            'All vehicle is selected
'            strVCriteria = ""
'        Else
            STRSQL = "SELECT vehicle_type FROM " & VEHICLE_TYPES & _
                     " WHERE description ='" & RemoveQoute(cboVehicle.List(cboVehicle.ListIndex)) & "'"
            Debug.Print STRSQL
            
            Set RS = getData(STRSQL, adLockReadOnly, adOpenForwardOnly, adUseClient)
            strSCriteria = "site_id='" & cboSites & "'"
            strVCriteria = "AND vehicle_type=" & RS!vehicle_type
            vType = RS!vehicle_type
            
            Call CloseRecordset(RS)
'        End If
        Set RS = gConnect1.Execute("sp_report_vsummary '" & cboSites & "'," & vType & ",'" & CDate(format(dtp1.Value, DATEFORMAT)) & "','" & CDate(format(dtp2.Value, DATEFORMAT)) & "'")
        
        begindate = format(dtp1.Value, DATEFORMAT)
        RS.Sort = "date_survey ASC"
        Do
            lstdate = getdate(begindate)
            RS.Filter = "date_survey >= #" & begindate & "# and date_survey <= #" & lstdate & "#"
            
            Call Fillrecord(RS, begindate, lstdate)
            begindate = DateAdd("d", 1, lstdate)
        Loop Until lstdate = format(dtp2.Value, DATEFORMAT)
        Call CloseRecordset(RS)
        
        PreviewStatus lv.ListItems.Count > 0
        If lv.ListItems.Count = 0 Then
             MsgBox "No records found", vbOKOnly + vbInformation, "Report"
        End If
        
        Screen.MousePointer = vbDefault
        mdiMain.mnuExport.Enabled = lv.ListItems.Count <> 0
    End If
End Sub








Private Function validateSite() As Boolean
    Dim strError As String
    Dim intErrorCnt As Integer
    Dim STRSQL As String
    Dim RS As ADODB.Recordset
    
    Screen.MousePointer = vbHourglass
    
    validateSite = True
    intErrorCnt = 1
    If cboSites = "" Then
        strError = intErrorCnt & ") Please fill-in all required information."
        intErrorCnt = intErrorCnt + 1
        validateSite = False
    End If
    
    STRSQL = "SELECT site_id FROM " & SITES & _
             " WHERE site_id='" & RemoveQoute(cboSites.Text) & "'"
    Debug.Print STRSQL
        
    Set RS = getData(STRSQL, adLockReadOnly, adOpenStatic, adUseClient)
    If RS.EOF Then
        If Trim(strError) = "" Then
            strError = intErrorCnt & ") Survey Site ID not found."
        Else
            strError = strError & vbCrLf & intErrorCnt & ") Survey Site ID not found."
        End If
        intErrorCnt = intErrorCnt + 1
        validateSite = False
        Call CloseRecordset(RS)
    End If
    
    If dtp1.Value > dtp2.Value Then
        If Trim(strError) = "" Then
            strError = intErrorCnt & ") Invalid date range."
        Else
            strError = strError & vbCrLf & intErrorCnt & ") Invalid date range."
        End If
        intErrorCnt = intErrorCnt + 1
        validateSite = False
    End If
    Screen.MousePointer = vbDefault
    
    If Not validateSite Then
        MsgBox strError, vbExclamation, "Validate"
    End If
End Function

I really don't know if sinubukan nyo ang help file na binigay ko.
Pero heto, gumawa ako ng sample.
Madaming way para palitawin ang data sa Chart, pero heto ang
pinakamadali. Just ask, if you have questions.
 

Attachments

  • Chart.zip
    26.9 KB · Views: 17
Re: How To Graph Data From A Database.

Pwede yan from VB6 to VB.Net, how? aralin mo ang vb.net.
Manually gagawa ka ng new program.



I really don't know if sinubukan nyo ang help file na binigay ko.
Pero heto, gumawa ako ng sample.
Madaming way para palitawin ang data sa Chart, pero heto ang
pinakamadali. Just ask, if you have questions.







--about sa Help file.. nakikita ko siya sa pc namin pero dito sa work ko, hindi ko mabasa,, bakit ganun ?? see pics.

View attachment 125259



...sir knives, eto po sana expected output ko eh, modify ko nlng.. nakukuha ko na yung system hehe..

View attachment 125260

thx.. :))
 

Attachments

  • DiMakita.jpg
    DiMakita.jpg
    117.2 KB · Views: 4
  • aa.jpg
    aa.jpg
    86.3 KB · Views: 7
pwede nyo ba akong tulungang hanapin guys sa code na ito kung saan nanggagaling yung data nila sa database?


Code:
Private Sub lblReport_Click()
    Dim RS As ADODB.Recordset
    Dim begindate As Date
    Dim lstdate As Date
    Dim STRSQL As String
    Dim strStatus As String
    Dim vType As Byte
    
    If validateSite Then
        Screen.MousePointer = vbHourglass
        
        lv.ListItems.Clear
'        If cboVehicle.ListIndex = cboVehicle.ListCount - 1 Then
'            'All vehicle is selected
'            strVCriteria = ""
'        Else
            STRSQL = "SELECT vehicle_type FROM " & VEHICLE_TYPES & _
                     " WHERE description ='" & RemoveQoute(cboVehicle.List(cboVehicle.ListIndex)) & "'"
            Debug.Print STRSQL
            
            Set RS = getData(STRSQL, adLockReadOnly, adOpenForwardOnly, adUseClient)
            strSCriteria = "site_id='" & cboSites & "'"
            strVCriteria = "AND vehicle_type=" & RS!vehicle_type
            vType = RS!vehicle_type
            
            Call CloseRecordset(RS)
'        End If
        Set RS = gConnect1.Execute("sp_report_vsummary '" & cboSites & "'," & vType & ",'" & CDate(format(dtp1.Value, DATEFORMAT)) & "','" & CDate(format(dtp2.Value, DATEFORMAT)) & "'")
        
        begindate = format(dtp1.Value, DATEFORMAT)
        RS.Sort = "date_survey ASC"
        Do
            lstdate = getdate(begindate)
            RS.Filter = "date_survey >= #" & begindate & "# and date_survey <= #" & lstdate & "#"
            
            Call Fillrecord(RS, begindate, lstdate)
            begindate = DateAdd("d", 1, lstdate)
        Loop Until lstdate = format(dtp2.Value, DATEFORMAT)
        Call CloseRecordset(RS)
        
        PreviewStatus lv.ListItems.Count > 0
        If lv.ListItems.Count = 0 Then
             MsgBox "No records found", vbOKOnly + vbInformation, "Report"
        End If
        
        Screen.MousePointer = vbDefault
        mdiMain.mnuExport.Enabled = lv.ListItems.Count <> 0
    End If
End Sub



:help:
 
Hello guys can anyone please help me how to use this code?

How can I get the AutoNumber/Identity value for the record just added?



Hindi ko po kasi magets kung san ko ilalagay yan... Please mga ser:help:


Ito try mo sana makatulong nilagay ko dyan sa naka attached sample na ginawa ko :) Generate autoNumber.

Enjoy! :)

Try din to : Link Here
 

Attachments

  • AutoGenerate IDnum.rar
    11.7 KB · Views: 12
Last edited:
pwede nyo ba akong tulungang hanapin guys sa code na ito kung saan nanggagaling yung data nila sa database?


Code:
Private Sub lblReport_Click()
    Dim RS As ADODB.Recordset
    Dim begindate As Date
    Dim lstdate As Date
    Dim STRSQL As String
    Dim strStatus As String
    Dim vType As Byte
    
    If validateSite Then
        Screen.MousePointer = vbHourglass
        
        lv.ListItems.Clear
'        If cboVehicle.ListIndex = cboVehicle.ListCount - 1 Then
'            'All vehicle is selected
'            strVCriteria = ""
'        Else
            STRSQL = "SELECT vehicle_type FROM " & VEHICLE_TYPES & _
                     " WHERE description ='" & RemoveQoute(cboVehicle.List(cboVehicle.ListIndex)) & "'"
            Debug.Print STRSQL
            
            Set RS = getData(STRSQL, adLockReadOnly, adOpenForwardOnly, adUseClient)
            strSCriteria = "site_id='" & cboSites & "'"
            strVCriteria = "AND vehicle_type=" & RS!vehicle_type
            vType = RS!vehicle_type
            
            Call CloseRecordset(RS)
'        End If
        Set RS = gConnect1.Execute("sp_report_vsummary '" & cboSites & "'," & vType & ",'" & CDate(format(dtp1.Value, DATEFORMAT)) & "','" & CDate(format(dtp2.Value, DATEFORMAT)) & "'")
        
        begindate = format(dtp1.Value, DATEFORMAT)
        RS.Sort = "date_survey ASC"
        Do
            lstdate = getdate(begindate)
            RS.Filter = "date_survey >= #" & begindate & "# and date_survey <= #" & lstdate & "#"
            
            Call Fillrecord(RS, begindate, lstdate)
            begindate = DateAdd("d", 1, lstdate)
        Loop Until lstdate = format(dtp2.Value, DATEFORMAT)
        Call CloseRecordset(RS)
        
        PreviewStatus lv.ListItems.Count > 0
        If lv.ListItems.Count = 0 Then
             MsgBox "No records found", vbOKOnly + vbInformation, "Report"
        End If
        
        Screen.MousePointer = vbDefault
        mdiMain.mnuExport.Enabled = lv.ListItems.Count <> 0
    End If
End Sub



:help:

see below yan na part.
Code:
 STRSQL = "SELECT vehicle_type FROM " & VEHICLE_TYPES & _
                     " WHERE description ='" & RemoveQoute(cboVehicle.List(cboVehicle.ListIndex)) & "'"
            Debug.Print STRSQL
            
            Set RS = getData(STRSQL, adLockReadOnly, adOpenForwardOnly, adUseClient)
            strSCriteria = "site_id='" & cboSites & "'"
            strVCriteria = "AND vehicle_type=" & RS!vehicle_type
            vType = RS!vehicle_type
 
see below yan na part.
Code:
 STRSQL = "SELECT vehicle_type FROM " & VEHICLE_TYPES & _
                     " WHERE description ='" & RemoveQoute(cboVehicle.List(cboVehicle.ListIndex)) & "'"
            Debug.Print STRSQL
            
            Set RS = getData(STRSQL, adLockReadOnly, adOpenForwardOnly, adUseClient)
            strSCriteria = "site_id='" & cboSites & "'"
            strVCriteria = "AND vehicle_type=" & RS!vehicle_type
            vType = RS!vehicle_type










sir. thx.. paano ko kaya ididisplay yan sa MsCHART??? gumagamit kasi siya ng StoredProcedure eh..


tingnan nyo po..

Code:
 Set RS = gConnect1.Execute("sp_report_vsummary '" & cboSites & "'," & vType & ",'" & CDate(format(dtp1.Value, DATEFORMAT)) & "','" & CDate(format(dtp2.Value, DATEFORMAT)) & "'")
        
        begindate = format(dtp1.Value, DATEFORMAT)
        RS.Sort = "date_survey ASC"
 
anyone who can help me..

just wanted to know kung pano poh mag export ng data na laman ng datagrid to excel.

kc may find and filter function ako..

so pagkafilter ko gusto ko iexport to excel ung filtered result..

salamat sa makakatulong..urgent lang
 


parang ganyan poh..pero not whole database poh..

ung na filter lang poh ung i-export nya sa excel..

example poh.

may laman ung database ko na..

7 items, na ang material type ai ganto
1. i beam
2. i beam
3. c channel
4. i beam
5. c channel
6. c channel
7. i beam

then pag nag filter ako..lalabas sa datagrid ko ung puro i beam lang or ung puro c channel lang..

at un po ang gusto ko i-export sa excel..

sana naintindihan nyo poh paliwanag ko.
 
Back
Top Bottom