Home > Software engineering >  Novice asked how to connect the vb6 chart to access (database), who can help me changed?
Novice asked how to connect the vb6 chart to access (database), who can help me changed?

Time:10-21

Is ready to chart and text can display the access data
Ask for help, but the chart is unable to connect and read access data

Below is a chart of the interface
 Dim RPTRS As you 
Dim DBCLS As New dbclass
Dim ii As Double
Dim iii As Integer
Dim e As Double
Dim r As Double
Public CHHT As Long
Public CHWD As Long
Dim chht1 As Long
Dim chwd1 As Long

Private Sub cmdborder_Click (Index As an Integer)
Optdef. Value=https://bbs.csdn.net/topics/False
With MSChart1. Plot. Backdrop
The Select Case Index
Case 0
. Frame. Style=VtFrameStyleThickOuter
'Set style to show a shadow.
Case 1
. Frame. Style=VtFrameStyleNull
'Shadow. Style=VtShadowStyleDrop
End the Select
End With
End Sub

Private Sub cmdcancel_Click ()
Unload Me
End Sub

Private Sub cmdch_Click (Index As an Integer)
Optdef. Value=https://bbs.csdn.net/topics/False
MSChart1. ShowLegend=True
The Select Case Index
Case 0
MSChart1. ChartType=VtChChartType2dBar
Case 1
MSChart1. ChartType=VtChChartType3dBar
Case 2
MSChart1. ChartType=VtChChartType2dPie
Case 3
MSChart1. ChartType=VtChChartType2dLine
Case 4
MSChart1. ChartType=VtChChartType3dLine
Case 5
MSChart1. ChartType=VtChChartType3dStep
End the Select
End Sub

Private Sub cmdeffect_Click (Index As an Integer)
Optdef. Value=https://bbs.csdn.net/topics/False
With MSChart1. Plot
The Select Case Index
Case 0
'Set the style to solid.
. Wall. Brush. Style=VtBrushStyleHatched
Case 1
. Wall. Brush. Style=VtBrushStyleSolid
End the Select
'Set the color to white.
. Wall. Brush. The FillColor. Set 255, 255, 255
End With
End Sub
Private Sub cmdrowcol_Click (Index As an Integer)
Optdef. Value=https://bbs.csdn.net/topics/False
The Select Case Index
Case 0
MSChart1. Plot. DataSeriesInRow=True
Case 1
MSChart1. Plot. DataSeriesInRow=False
End the Select
End Sub

Private Sub cmdsave_Click ()
On Error GoTo saverr
Dim strsavefile As String
With dlgChart 'CommonDialog object
The Filter="Pictures (*. BMP) | *. BMP"
. DefaultExt="BMP"
. CancelError=True
. ShowSave
Strsavefile.=FileName
If strsavefile="" Then Exit Sub
End With
MSChart1. EditCopy
SavePicture Clipboard. GetData strsavefile
The Exit Sub
Saverr:
MsgBox Err. The Description

End Sub

Private Sub cmdshadow_Click (Index As an Integer)
Optdef. Value=https://bbs.csdn.net/topics/False
With MSChart1. Plot. Backdrop
The Select Case Index
Case 0
. Shadow. Style=VtShadowStyleDrop
'Set style to show a shadow.
Case 1
. Shadow. Style=VtShadowStyleNull
End the Select
End With
End Sub

Private Sub Command1_Click ()

E=MSChart1. Plot. View3d. Elevation
R=MSChart1. Plot. View3d. Rotation

Timer1. Enabled=True

End Sub





Private Sub Command2_Click ()
Timer1. Enabled=False
Timer2. Enabled=False
E=MSChart1. Plot. View3d. Elevation
R=MSChart1. Plot. View3d. Rotation
Ii=1
Iii=1
End Sub

Private Sub Command3_Click ()
E=MSChart1. Plot. View3d. Elevation
R=MSChart1. Plot. View3d. Rotation
Timer1. Enabled=True
End Sub

Private Sub Form_Activate ()
If chht1 & gt; 0 Then
MSChart1. Height=chht1
MSChart1. Width=chwd1
End the If
End Sub

Private Sub Form_Load ()

Dim dbname1 As Connection
The Set dbname1=DBCLS. Dbname3
The Set RPTRS=New you
RPTRS. Open the "select * from table1," dbname1, adOpenStatic adLockOptimistic,

With MSChart1
Set the DataSource=RPTRS
. ShowLegend=True
End With
End Sub

'Paste these functions provides into the Declarations section
'of the Form or Code Module.
The Public Function RedFromRGB (ByVal RGB As Long) _
As Integer
'The ampersand after & amp; HFF coerces the number as a
'long, preventing Visual Basic from evaluating the
'The number as a negative value. The logical And is
'2 return bit values.
RedFromRGB=& amp; HFF& And RGB
End the Function

The Public Function GreenFromRGB (ByVal RGB As Long) _
As Integer
'The result of The And operation is means by
'256, to return the value of the middle bytes.
'Note the use of the Integer divisor.
GreenFromRGB=(& amp; HFF00 & amp; And RGB) \ 256
End the Function

The Public Function BlueFromRGB (ByVal RGB As Long) _
As Integer
'This function works like the GreenFromRGB above,
'the except you don' t need the ampersand. The
'number is already a long. The result means by
'65536 to obtain the highest bytes.
BlueFromRGB=(& amp; HFF0000 And RGB) \ 65536
End the Function

nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related