[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

01/28/2003 at 10:28AM PST, ID: 20485884
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

4.2

VB6 COM using ADO 2.7 in .NET

Asked by kfblake in .NET, Microsoft Programming

Tags: recordset

Ok, this has completely stumped me.  Here's the deal.
I have a VB6 DLL that I have registered as a COM, and have also created a .NET wrapper for using tlbimp.exe.  I have also included a wrapper for msado15.dll, the ADO 2.7 Microsoft DLL containing the ADODB._Recordset and ADODB._Record references.  Additionally, that is the EXACT (and only) DLL I am referencing in VB6 and using for my recordets.  Here is the code:
VB6 Component:
Public Function Query_DB(DB_DSN as String, Table as String, ParamString as String, Optional OrderBy as String, Optional OrderDirection as String, Optional FieldName as String) as Variant

Dim cnnDB as New ADODB.Connection
Dim rsDB as New ADODB.Recordset
Dim strSQL as String

cnnDB.Open "DSN=" & DB_DSN
strSQL = "Select * from [" & Table & "] " & ParamString

If Len(OrderBy)>0 Then
  strSQL = strSQL & " Order By [" & OrderBy & "]"
  If UCase(OrderDirection) = "ASC" Or UCase(OrderDirection) = "DESC" Then
     strSQL = strSQL & " " & OrderDirection
  End if
End If

Set rsDB = cnnDB.Execute(strSQL)
If Len(FieldName)>0 Then
  Query_DB = CStr(rsDB(FieldName))
Else
  Set Query_DB = rsDB
End if

Set rsDB = Nothing
cnnDB.Close
Set cnnDB = Nothing
End Function

As you can see, it simply returns either the value of a specified field, or the whole recordset.  The coding itself has worked before, I am now trying to use it with .NET.

Here is how I'm calling it in ASPX:
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<%@ Import Namespace="netIASET" %>
<%@ Import Namespace="ADODB" %>

<%@ Page Language="vb" Debug="true" %>
<%@ Register TagPrefix="Macromedia" Namespace="FlashGateway" Assembly="flashgateway" %>
<Macromedia:Flash id="Flash" Runat="Server" />

Dim objIADB as IADB
objIADB = new IADB()

Dim rsGroups as ADODB._Recordset = objIADB.Query_DB("MAIN","GROUPS","","GroupID","Asc","")

Dim daGroups as OleDbDataAdapter = New OleDbDataAdapter
Dim dsGroups as DataSet = New DataSet

daGroups.Fill(dsGroups,rsGroups,"Groups")

'assign the dataset into Macromedia Flash flash.datasource property
Flash.DataSource = dsGroups.Tables("Groups")
'bind datatable to flash
Flash.DataBind()


Don't worry about the Macromedia Flash stuff, that's me using Flash Remoting, it doesn't even come into effect yet.  IADB is the Class in which the previous Function exists.  Now, I can create the object fine, and if I just return a fieldvalue (a string) I get it just fine.  However, when I try to return a recordset I get: SPECIFIED CAST IS NOT VALID.  I researched it and found it to be a mismatch in DLLs, but I am using the same exact DLL in VB6 as in the aspx file.  I am just completely stumped.  PLEASE HELP.

Btw, ADODB.dll is the msado15.dll file installed with ADO 2.7 put thru tlbimp.exe (as recommended by Microsoft in Filling an ADO RecordSet with a DataSet).  And netIASET.dll is the wrapper for my VB6 component.

HELP HELP HELP!  I want to give more then 500, and will do so if someone finds an answer.  I was thinking 1000.
kfblake
[+][-]01/28/03 10:30 AM, ID: 7831777

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/28/03 10:45 AM, ID: 7831887

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/28/03 10:52 AM, ID: 7831937

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/28/03 11:26 AM, ID: 7832160

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/28/03 11:33 AM, ID: 7832207

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/28/03 11:39 AM, ID: 7832248

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/28/03 11:47 AM, ID: 7832305

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/28/03 12:40 PM, ID: 7832649

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/28/03 12:46 PM, ID: 7832693

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/28/03 01:11 PM, ID: 7832823

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/28/03 01:16 PM, ID: 7832847

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/28/03 01:37 PM, ID: 7832995

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/28/03 01:41 PM, ID: 7833021

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/28/03 01:54 PM, ID: 7833112

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/28/03 02:04 PM, ID: 7833180

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/28/03 02:17 PM, ID: 7833257

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/28/03 02:20 PM, ID: 7833266

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/28/03 02:25 PM, ID: 7833296

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/28/03 02:27 PM, ID: 7833312

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/28/03 02:32 PM, ID: 7833336

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/28/03 02:36 PM, ID: 7833359

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/28/03 02:45 PM, ID: 7833423

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/28/03 04:07 PM, ID: 7833918

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/28/03 04:31 PM, ID: 7834050

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/29/03 09:26 AM, ID: 7839465

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/29/03 09:33 AM, ID: 7839511

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/29/03 02:19 PM, ID: 7841497

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/29/03 02:28 PM, ID: 7841535

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/29/03 11:55 PM, ID: 7843992

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/04/03 03:47 PM, ID: 7878785

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/04/03 09:57 PM, ID: 7880519

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/04/03 10:15 PM, ID: 7880579

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: .NET, Microsoft Programming
Tags: recordset
Sign Up Now!
Solution Provided By: bgungor
Participating Experts: 3
Solution Grade: A
 
 
[+][-]02/18/03 12:54 PM, ID: 7977097

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/18/03 12:55 PM, ID: 7977103

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/18/03 03:55 PM, ID: 7978242

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20090824-EE-VQP-74