disconnected recordset (msdatashape) no longer works?

  • Thread starter Thread starter Eric Peterson
  • Start date Start date
E

Eric Peterson

I use the shape object to make recordsets that have no db
connection for use in grids and such. For example

(mPhoneNumbersRS as ADODB.Recordset)
****************************************
mPhoneNumbersRS.let_ActiveConnection
("Provider=MSDataShape;Data Provider=none;Data
Source=localhost;")

sTmp = "SHAPE APPEND NEW adChar(20) as Type, NEW advarChar
(20) as PhoneNumber, NEW advarChar(6) as Ext, NEW adChar
(1) as Dial, NEW adNumeric (7,0) as CodeID"

mPhoneNumbersRS.Open(sTmp, ,
ADODB.CursorTypeEnum.adOpenStatic,
ADODB.LockTypeEnum.adLockOptimistic)

PhoneGrid.DataSource = mPhoneNumbersRS
*****************************************

This *used* to work in VB6, but now I get an error. I've
read through all the KB articles I could find
on 'msdatashape' and everything pertains to ADO.NET. I'm
not ready to use ADO.NET. Is there a way where I can
still use my trusty old MSDataShape in VB.NET without
going to ADO.NET?
 
Hi Eric,

You are going on a route that has no end.

Databinding in VB.net is possible with any class that implements the
IBindingList Or ITypedList that includes dataset, dataview, datatable.

As far as I know there is no recordset in it.

So you maybe can get your ADODB working, but then you have the next problem.

I would go looking for the dataset and the dataview using OleDB or SQL.

I hope this helps you a little bit on the right route?

Cor
 
Hello Eric,


I agree with Cor. However, in the interim if you must use ADO with
msdatashape, there are two things you can do.


1. Use the Fill method of the OleDbDataAdapter class to convert the ADODB
recordset to a DataTable.

You can do this by using the technique in the following article.

ID: 310349
HOW TO: Use the OleDbDataAdapter to Fill a DataSet from an ADO Recordset
http://support.microsoft.com/?id=310349

I tried this with an ADODB recordset using MSDatashape, and it seemed to
work pretty well.


2. Use the older VB6 controls, such as MSHFlexGrid, which support the data
binding to an ADODB recordset.

I hope this helps!

Keith Fink
Microsoft Developer Support
 
Back
Top