Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

VB6 DATAGRID Error

$
0
0
Hi all ! I am using vb6 and Datagrid ! I have an access database and i display those records in datagrid ! For example, there is a column named marks ! Below the datagrid there is a button and textbox named total ! if i click the button means, then the marks column in the datagrid should be added and display the result in the textbox ! I have tried the following method but it doesn't work !
Public con As New ADODB.Connection
Public rs As New ADODB.Recordset

In the form load the following code contains !

Set con = New ADODB.Connection
con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=.\college.mdb;Persist Security Info=False"
con.CursorLocation = adUseClient
Set rs = New ADODB.Recordset
rs.open "select marks from student",con,1,3
set Datagrid1.Datasource = rs


The marks column in the access is displaying correctly in the datagrid ! but i don't know how to take the values from the datagrid and add them up and display the total marks in a textbox ! Thanks in advance !

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>