We help IT Professionals succeed at work.

DBGrid, retrieve fields by pressing Command button.

pfjvisser asked
Medium Priority
Last Modified: 2008-03-10
Hi there,
Is there a way to let a Dbgrid retrieve fields when pushing a button. during runtime..
Watch Question

write this in the button click event

Dim adoConn as ADODB.connection
Dim intFldCnt As Integer
Dim intTotalBugs As Integer
Dim strDeveloperName As String

set adoconn = new adodb.connection
adoconn.connectionString = "Your Connection String"
adoConn.CursorLocation = adUseClient
Set adoRecset = New ADODB.Recordset
adoRecset.Open "select Field1, field2 from TableName " _
adoConn, adOpenStatic, adLockOptimistic, adCmdText
Set DBGRDBugs.DataSource = adoRecsetUser

Explore More ContentExplore courses, solutions, and other research materials related to this topic.