Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB Databases Basics
|
VB Databases Basics Beginning-level VB coding questions specific to using VB with databases. Issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB Databases Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 6th, 2004, 02:49 AM
Registered User
 
Join Date: Sep 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default MSHFlexGrid with DataSource Problem

I have a problem with my MSHFlexGrid when reading really long string from memo field. It seems that recordset will not set and I got the error of:

Run-time error2147417848 (80010108)
Automation Error

or Method 'DataSource' of object 'IMSHFlexGrid' failed.

my code for reading database is:

below is in frmMain
--------------------------------------------------------------
opendb etc..

sqlstr = "Select f1, f2, f3, memo from myTable where id=1"

setResult_Ado1 sqlstr

If (rsRecordset.RecordCount > 0) Then
    Set Adodc2.Recordset = rsRecordset
        Adodc2.Refresh
        Set MSHFlexGrid2.DataSource = Adodc2
        set_Flex2 Me
Else
        MSHFlexGrid2.Clear
        MSHFlexGrid2.Rows = 2
End If

closedb etc..
--------------------------------------------------------------

Sub setResult_Ado1 sqlstr is called from module which as below
--------------------------------------------------------------
public sub opendb
...
end sub

public sub closedb
...
end sub

Public Sub setResult_Ado1(sql As String)

    Set rsRecordset = New ADODB.Recordset
    rsRecordset.ActiveConnection = cnConnection
    rsRecordset.Source = sql
    rsRecordset.CursorLocation = adUseClient
    rsRecordset.Open , , adOpenKeyset, adLockReadOnly

End Sub
--------------------------------------------------------------

I got Set MSHFlexGrid2.DataSource = Adodc2 as nothing therefore nothing.

any help?
thanks



 
Old September 10th, 2004, 08:06 AM
Registered User
 
Join Date: Sep 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Off topic.
Is your question on vb.net? If yes, is MSHFlexGrid a part of vb.net? The standard version of vb.net which I have only comes with a datagrid and I was looking for a flexigrid component to convert my vb5 stuff to .net
TIA





Similar Threads
Thread Thread Starter Forum Replies Last Post
MSHFlexgrid Row selection problem spmano1983 Beginning VB 6 0 August 17th, 2007 01:23 AM
Object datasource VS DataSource SoftMind BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 4 July 27th, 2006 10:44 PM
MSHFlexgrid slgknjn Beginning VB 6 4 February 25th, 2005 04:07 PM
DataBind/DataSource problem liorlankri ADO.NET 3 November 10th, 2004 09:15 AM
problem to deploye extended datasource Choose File BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 0 July 16th, 2004 10:46 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.