Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Database and Reporting > How to provide datasource for DBGrid without datacontrol?


Reply
 
Thread Tools Display Modes
  #1  
Old 07-15-2003, 11:15 PM
Ambalavanar Ambalavanar is offline
Newcomer
 
Join Date: Jul 2003
Posts: 7
Unhappy How to provide datasource for DBGrid without datacontrol?


I am using DBgrid in my program. I can easily connect DBGrid to database using datacontrols. But i am having problem with datacontrol if I use it in some other system where VB is not installed.
Please provide Help for using DBGrid without datacontrol as datasource.
Reply With Quote
  #2  
Old 07-15-2003, 11:46 PM
gundavarapu's Avatar
gundavarapu gundavarapu is offline
Senior Contributor
 
Join Date: Aug 2002
Location: In loved one's heart
Posts: 929
Default

Hi,
try this

Code:
dim Recordset1 as adodb.recordset 'recordset1.open..... set DataGrid1.Datasource = Recordset1
__________________
Regards,
Sidhu

When you do not get the expected result, change your programming language.
Reply With Quote
  #3  
Old 07-16-2003, 02:24 AM
Ambalavanar Ambalavanar is offline
Newcomer
 
Join Date: Jul 2003
Posts: 7
Default

Quote:
Originally Posted by gundavarapu
Hi,
try this

Code:
dim Recordset1 as adodb.recordset 'recordset1.open..... set DataGrid1.Datasource = Recordset1



Sorry, This code is not working
it is showing 'Class does not support Automation'.
Please gimme some other solution.
Thank you.
Reply With Quote
  #4  
Old 07-16-2003, 03:08 AM
gundavarapu's Avatar
gundavarapu gundavarapu is offline
Senior Contributor
 
Join Date: Aug 2002
Location: In loved one's heart
Posts: 929
Default

Hi,

I have used this so many times. It should work.
check these first.
1. Have you created a connection to the database using the ADODB.Connection Object.
2. Have you created a rowset to the table using the ADODB.Recordset object.
3. Did you place a datagrid control with the name Datagrid1.

if you have these three then it should work. You double check these things and post once again.

regards,
Sidhu
__________________
Regards,
Sidhu

When you do not get the expected result, change your programming language.
Reply With Quote
  #5  
Old 07-16-2003, 10:38 PM
Ambalavanar Ambalavanar is offline
Newcomer
 
Join Date: Jul 2003
Posts: 7
Default

I did everything as u mentioned above. Even then it is not working. Please help in correcting this. Any .DLL problem?
Reply With Quote
  #6  
Old 07-16-2003, 11:38 PM
gundavarapu's Avatar
gundavarapu gundavarapu is offline
Senior Contributor
 
Join Date: Aug 2002
Location: In loved one's heart
Posts: 929
Default

Hi, May be inconsistency in the Control.
Is it that necessary for you to use a DataGrid Control? If not, then why don't you try with several grids which come up with the VB Software.

But, I still wonder why that is not working for you?
I've using this for years.

May be you could post the code, for someone to look into the problem.

Regards,
Sidhu
__________________
Regards,
Sidhu

When you do not get the expected result, change your programming language.
Reply With Quote
  #7  
Old 07-17-2003, 04:14 AM
Ambalavanar Ambalavanar is offline
Newcomer
 
Join Date: Jul 2003
Posts: 7
Default

Quote:
Originally Posted by gundavarapu
Hi, May be inconsistency in the Control.
Is it that necessary for you to use a DataGrid Control? If not, then why don't you try with several grids which come up with the VB Software.

But, I still wonder why that is not working for you?
I've using this for years.

May be you could post the code, for someone to look into the problem.

Regards,
Sidhu



Tell me which Grid can directly take datasource from recordset? or is there anyway to use MSRDC as datasource?
Sorry, I'm troubling u very much....
Thank u
Reply With Quote
  #8  
Old 07-17-2003, 04:35 AM
gundavarapu's Avatar
gundavarapu gundavarapu is offline
Senior Contributor
 
Join Date: Aug 2002
Location: In loved one's heart
Posts: 929
Default

troubles are the way to success

Logically speaking, any grid should connect to the recordset, otherwise there is no fun in using grids. You can use any of the native grids provided with VB.

like

DataGrid - Data Grid
MSFlexGrid - MS Flex Grid
MSHFlexGrid- MS Hierarchial Flex Grid
...

Coming to MSRDC, i've not used RDC till now as i feel comfortable ADODC, infact i've been using ADODB only, I hate data controls.
One point for you to note, ADODC is the latest control from the microsoft desk. It even provides connectivity to SQL Server, for that matter to any of the database which has either a ODBC or Ole Db providers.

It can also be used to connect remote data sources.
I'm telling all this because, if possible, i want you to try and use ADODC instead of MSRDC.
Even Microsoft recommends ADO technology for new projects.
Even ADO is out dated, now ADO.Net is the latest technology.

So i suggest you to get along with the latest technology and leave the old DAO to hell.

Though, this does not solve the problem, it surely provides a wide range of things for you to try.

Regards,
Sidhu
__________________
Regards,
Sidhu

When you do not get the expected result, change your programming language.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Listbox datasource? I_R_Lee General 10 09-22-2002 04:28 AM
Simple Datasource Question holtzy Database and Reporting 8 08-06-2002 07:33 AM
listbox datacontrol jcblue Database and Reporting 2 04-12-2002 10:18 AM
Clearing Textbox datasource at runtime ? Rad_Boy General 7 02-19-2002 04:40 AM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->