|
|
|||||||||
|
|||||||||
|
|||||||||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
When a ADODB Recordset is established and I try to bound its information to a FlexGrid, nothing happens. When I execute the code line by line and I reach the line that says "Set vsGrid.DataSource = recSet" and press F8 the debugger goes to the next line and the data does not show in the grid, and If a point the sentence "vsGrid.DataSource" the ControlTipText says "Nothing". I think I might've set wrong the Recordset. Here is the code:
''''''''''''''''''''''''''''''''''''''''''''' Dim datConnection As ADODB.Connection Dim recSet As ADODB.Recordset Dim strDB, strSQL As String strDB = "C:\Report.XLS" Set datConnection = New ADODB.Connection Set recSet = New ADODB.Recordset datConnection.Open "DRIVER=Microsoft Excel Driver (*.xls);" & "DBQ=" & strDB strSQL = "SELECT * FROM [Sheet1$A1:10]" recSet.Open strSQL, datConnection, adOpenStatic Set vsGrid.DataSource = recSet 'Here is the problem, data is 'not shown on Grid Please somebody help me, because this code works for a Excel Sheets. |
|
#2
|
|||
|
|||
|
[QUOTE=lujus1]When a ADODB Recordset is established and I try to bound its information to a FlexGrid, nothing happens. When I execute the code line by line and I reach the line that says "Set vsGrid.DataSource = recSet" and press F8 the debugger goes to the next line and the data does not show in the grid, and If a point the sentence "vsGrid.DataSource" the ControlTipText says "Nothing". I think I might've set wrong the Recordset. Here is the code:
''''''''''''''''''''''''''''''''''''''''''''' Dim datConnection As ADODB.Connection Dim recSet As ADODB.Recordset Dim strDB, strSQL As String strDB = "C:\Report.XLS" Set datConnection = New ADODB.Connection Set recSet = New ADODB.Recordset datConnection.Open "DRIVER=Microsoft Excel Driver (*.xls);" & "DBQ=" & strDB strSQL = "SELECT * FROM [Sheet1$A1:10]" '//recSet.Open strSQL, datConnection, adOpenStatic '// try this isted of that recSet.Open strSQL, datConnection, adopenkeyset |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > I can't bound a recordset to my FlexGrid |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|