Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Iron Speed
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
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  
Old September 9th, 2004, 12:23 PM
lujus1 lujus1 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 3 lujus1 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question I can't bound a recordset to my FlexGrid

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.

Reply With Quote
  #2  
Old October 12th, 2004, 10:11 AM
diwakerverma diwakerverma is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 4 diwakerverma User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thumbs up

[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

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > I can't bound a recordset to my FlexGrid


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway