ADO.NET Component and VB6 client - ADO.Net or ADO 2.7

ADO.NET Component and VB6 client - ADO.Net or ADO 2.7

Post by John » Thu, 03 Jul 2003 17:06:32



Hi,

I'm writing a component which references ADO.NET and uses
Interop so that it can be called from a VB6 client.

Question is, do I have to use ADO 2.7 in the .NET
component so that the client can process any returned
recordsets or can I used the ADO.NET functionality in the
component and cast a generated DataSet/Reader to an ADO
RecordSet object ?

I really don't wanna use ADO 2.7 in the .NET component so
if I can't cast it, what else could i use to pass a
DataSet from component to client ? XML could be an option
but I'm concerned about the memory and time overheads with
regards to parsing and processing.

Regards,
John

 
 
 

ADO.NET Component and VB6 client - ADO.Net or ADO 2.7

Post by Konstantin Kip » Fri, 04 Jul 2003 18:50:30


Quote:> Question is, do I have to use ADO 2.7 in the .NET
> component so that the client can process any returned
> recordsets or can I used the ADO.NET functionality in the
> component and cast a generated DataSet/Reader to an ADO
> RecordSet object ?

ADO.NET = ADO 2.6 and higher :-) .NET classes simply use ADO 2.6(2.7) to do
all the work. So, you cannot use ADO.NET without having ADO 2.6 or higher
installed.

Quote:> I really don't wanna use ADO 2.7 in the .NET component so
> if I can't cast it, what else could i use to pass a
> DataSet from component to client ? XML could be an option
> but I'm concerned about the memory and time overheads with
> regards to parsing and processing.

You cannot cast because classes are entirely different. Anyway, DataSet is
serializable and when you send it to a client, will be automatically
converted to xml+xsd and restored back on the client. Of course, you can
serialize and deserialize it manually, but you will lose some flexibility,
because your deserializer have to be installed on the client PC.

Does this answer your question?

---

Konstantin

 
 
 

1. ADO.NET vs. ADO 2.7

I'm trying to port some old code from an Access 2000 VBA Application into a
VB.NET Application.  To speed up this process I've ended up just including
the ADO 2.7 COM objects so I can get in there and parse through some things
that need changed and are already written in ADO 2.7.

The problem I am having right now is this though:

An unhandled exception of type 'System.Runtime.InteropServices.COMException'
occurred in TrackerII.exe

Additional information: Arguments are of the wrong type, are out of
acceptable range, or are in conflict with one another.

That occurs when I try to open a recordset like this.  Following is all the
code for the module.  The line where the recordset is opened is what is
triggering the error.  Any help would be much appreciated.  Thanks.
Module PeripheralCode

Public Sub PopulateADSF()

Dim objStreamReader As StreamReader

Dim conn As New SqlClient.SqlConnection()

Dim rs1 As New ADODB.Recordset()

Dim intCampaign As Integer

Dim intClient As Integer

Dim intStation As Integer

Dim str800Number As String

Dim d As Integer

Dim strDMAname As String

Dim lgDubOrders As Long

Dim objUser As Environment

Dim strLine As String

Try

objStreamReader = New StreamReader("C:\Documents and Settings\" &
objUser.UserName & "\My Documents\TrackerII.txt")

'For loop should go here.

strLine = objStreamReader.ReadLine

strLine = objStreamReader.ReadLine

strLine = objStreamReader.ReadLine

strLine = objStreamReader.ReadLine 'Fourth line is connection string.

'Close the file.

objStreamReader.Close()

Catch

MsgBox("There was no connection string file. Contact your IT Department to
research this error.")

End Try

conn.ConnectionString = strLine

conn.Open()

rs1.Open("SELECT * FROM Campaign", conn, ADODB.CursorTypeEnum.adOpenDynamic,
ADODB.LockTypeEnum.adLockOptimistic)

rs1.Close()

conn.Close()

End Sub

2. Syntax LM Sever and Access DB

3. ADO 2.7 is not ADO 2.7?

4. C++ Interface.

5. ADO 2.7 in VB.NET

6. Temporary table in memory

7. VS.NET effects VB 6.0 ADO 2.7 context-sensitive help

8. Web-database application development platform

9. Client SDK - Oledb - ADO.Net Multi-Threaded App Problems - VS.Net 2003

10. Client SDK - Oledb - ADO.Net Multi-Threaded App Problems - VS.Net

11. Version difference from ADO 2.5 to ADO 2.7

12. Error when using AddNew method in ADO (using ADO 2.7 SP1 from VB 6 SP4)

13. Pass ADO/ADO.NET parameter arrays for batch insert/update