473,224 Members | 1,965 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,224 software developers and data experts.

Filling a DataSet with an ADO Recordset or Record

I am writing a web service for a classic ASP application. I need to consume
an ADO recordset and then send it to another web service for processing. I
found an MSDN ariticle telling how to do this
(http://msdn.microsoft.com/library/de...recordset.asp),
one big problem - it says to import ADOComponent.dll and msado15.dll. I found
msado15.dll but I can't find ADOComponenet.dll, neither on my machine or to
download from the web. Does anyone have it???

Thank you!
Dec 30 '05 #1
6 10756
KJ
I read the article. "ADOComonent.dll" is an example name for a complied
output file:

"For example, an existing COM component with a ProgId of
ADOComponent.DataClass is compiled into ADOComponent.dll. It has
methods that return objects of type ADODB.Recordset. To consume this
object from .NET, import both ADOComponent.dll, and msado15.dll, which
contains the ADODB.Recordset and ADODB.Record objects. To import the
COM type libraries to .NET, issue the following commands.

TlbImp "C:\Program Files\Common Files\System\Ado\msado15.dll"
/out:ADODB.dll
TlbImp ADOComponent.dll /out:ADOCOM.dll"

Dec 30 '05 #2
Recordset rs = new RecordsetClass();
rs.CursorLocation = CursorLocationEnum.adUseClient;
rs.Open(strSQL, strConn, CursorTypeEnum.adOpenStatic,
LockTypeEnum.adLockReadOnly, (int) CommandTypeEnum.adCmdText);
OleDbDataAdapter da = new OleDbDataAdapter();
DataSet ds = new DataSet();
int intRowsRetrieved;
intRowsRetrieved = da.Fill(ds, rs, "Customers");
intRowsRetrieved = da.Fill(ds.Tables["Customers"], rs);
--Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"James" wrote:
I am writing a web service for a classic ASP application. I need to consume
an ADO recordset and then send it to another web service for processing. I
found an MSDN ariticle telling how to do this
(http://msdn.microsoft.com/library/de...recordset.asp),
one big problem - it says to import ADOComponent.dll and msado15.dll. I found
msado15.dll but I can't find ADOComponenet.dll, neither on my machine or to
download from the web. Does anyone have it???

Thank you!

Dec 30 '05 #3
Peter,

Thank you for your response. In this project I am not creating a
recordset, a recordset is being sent to it from a classic asp application as
a paramater. This is running as a piece of the middleware between the the asp
UI and another web service that is communicating with a main frame cobol
application. I need to accept this recordset, put the data from fields into a
fixed length string to send on the the other web service which in turn runs a
cobol transaction on the main frame. The other web service and main frame
application are owned by another state government agency. When I build my
asmx file it says no errors but it returns the error - Cannot serialize
interface ADODB.Recordset.

Here is my code:

[WebMethod(CacheDuration = 30,
Description="Accepts an Authorization in an ADOc recordset format. It
returns an xml data stream with the return status and other specified data.
The return table name is rtnRS.")]
public string SendAuth(Recordset rsAuthForm)
{
string xmlString = "";
string authString = "";
string rtnString = "";

OleDbDataAdapter da = new OleDbDataAdapter();
DataSet ds = new DataSet();
int intRowsRetrieved;

// read the recordset into the dataset
intRowsRetrieved = da.Fill(ds,rsAuthForm,"auth");
intRowsRetrieved = da.Fill(ds.Tables["auth"], rsAuthForm);

// create the fixed length string for the authorization header
authString = stringAuthHeader(ds);
.... and so on

This is the only routine I use a recordset, all the others use a string
input and a string output. It was working great before implementing this part.

Thank you for you help,

James
"Peter Bromberg [C# MVP]" wrote:
Recordset rs = new RecordsetClass();
rs.CursorLocation = CursorLocationEnum.adUseClient;
rs.Open(strSQL, strConn, CursorTypeEnum.adOpenStatic,
LockTypeEnum.adLockReadOnly, (int) CommandTypeEnum.adCmdText);
OleDbDataAdapter da = new OleDbDataAdapter();
DataSet ds = new DataSet();
int intRowsRetrieved;
intRowsRetrieved = da.Fill(ds, rs, "Customers");
intRowsRetrieved = da.Fill(ds.Tables["Customers"], rs);
--Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"James" wrote:
I am writing a web service for a classic ASP application. I need to consume
an ADO recordset and then send it to another web service for processing. I
found an MSDN ariticle telling how to do this
(http://msdn.microsoft.com/library/de...recordset.asp),
one big problem - it says to import ADOComponent.dll and msado15.dll. I found
msado15.dll but I can't find ADOComponenet.dll, neither on my machine or to
download from the web. Does anyone have it???

Thank you!

Dec 30 '05 #4
Yes, because an ADO Recordset is a COM object and the .NET WebServices
infrastructure doesn't know what to do with it. You have several options, the
best one would probably be one of the Xml options the Recordset provides,
which would flatten out the structure to xml or string that can be worked
with.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"James" wrote:
Peter,

Thank you for your response. In this project I am not creating a
recordset, a recordset is being sent to it from a classic asp application as
a paramater. This is running as a piece of the middleware between the the asp
UI and another web service that is communicating with a main frame cobol
application. I need to accept this recordset, put the data from fields into a
fixed length string to send on the the other web service which in turn runs a
cobol transaction on the main frame. The other web service and main frame
application are owned by another state government agency. When I build my
asmx file it says no errors but it returns the error - Cannot serialize
interface ADODB.Recordset.

Here is my code:

[WebMethod(CacheDuration = 30,
Description="Accepts an Authorization in an ADOc recordset format. It
returns an xml data stream with the return status and other specified data.
The return table name is rtnRS.")]
public string SendAuth(Recordset rsAuthForm)
{
string xmlString = "";
string authString = "";
string rtnString = "";

OleDbDataAdapter da = new OleDbDataAdapter();
DataSet ds = new DataSet();
int intRowsRetrieved;

// read the recordset into the dataset
intRowsRetrieved = da.Fill(ds,rsAuthForm,"auth");
intRowsRetrieved = da.Fill(ds.Tables["auth"], rsAuthForm);

// create the fixed length string for the authorization header
authString = stringAuthHeader(ds);
... and so on

This is the only routine I use a recordset, all the others use a string
input and a string output. It was working great before implementing this part.

Thank you for you help,

James
"Peter Bromberg [C# MVP]" wrote:
Recordset rs = new RecordsetClass();
rs.CursorLocation = CursorLocationEnum.adUseClient;
rs.Open(strSQL, strConn, CursorTypeEnum.adOpenStatic,
LockTypeEnum.adLockReadOnly, (int) CommandTypeEnum.adCmdText);
OleDbDataAdapter da = new OleDbDataAdapter();
DataSet ds = new DataSet();
int intRowsRetrieved;
intRowsRetrieved = da.Fill(ds, rs, "Customers");
intRowsRetrieved = da.Fill(ds.Tables["Customers"], rs);
--Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"James" wrote:
I am writing a web service for a classic ASP application. I need to consume
an ADO recordset and then send it to another web service for processing. I
found an MSDN ariticle telling how to do this
(http://msdn.microsoft.com/library/de...recordset.asp),
one big problem - it says to import ADOComponent.dll and msado15.dll. I found
msado15.dll but I can't find ADOComponenet.dll, neither on my machine or to
download from the web. Does anyone have it???

Thank you!

Dec 30 '05 #5
Peter,

Thank you again for your response! I am new to C# and XML. I ended up
writing a routine to return an XML recordset through a string so I can send
it back to my ASP calling application. But I don't have any idea how to do
what you are saying to do. Can you give me some references to some samples? I
did a search for 'C# recordset xml' and haven't found anything to help yet. I
will keep searching.

We had this entire project written in VB6 as a com object which communicated
with the other agencies dcom object until the servers were upgraded to 2003
and a service pack which blew out their dcom object and my com object. So
they switched to web services and I am trying to do the same with as little
disruption to my ASP UI as possible. We are using SOAP in the ASP UI to
communicate to my new web service. In the old architecture we used recordsets
throughout as both input and output.

Thank you,
James

"Peter Bromberg [C# MVP]" wrote:
Yes, because an ADO Recordset is a COM object and the .NET WebServices
infrastructure doesn't know what to do with it. You have several options, the
best one would probably be one of the Xml options the Recordset provides,
which would flatten out the structure to xml or string that can be worked
with.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"James" wrote:
Peter,

Thank you for your response. In this project I am not creating a
recordset, a recordset is being sent to it from a classic asp application as
a paramater. This is running as a piece of the middleware between the the asp
UI and another web service that is communicating with a main frame cobol
application. I need to accept this recordset, put the data from fields into a
fixed length string to send on the the other web service which in turn runs a
cobol transaction on the main frame. The other web service and main frame
application are owned by another state government agency. When I build my
asmx file it says no errors but it returns the error - Cannot serialize
interface ADODB.Recordset.

Here is my code:

[WebMethod(CacheDuration = 30,
Description="Accepts an Authorization in an ADOc recordset format. It
returns an xml data stream with the return status and other specified data.
The return table name is rtnRS.")]
public string SendAuth(Recordset rsAuthForm)
{
string xmlString = "";
string authString = "";
string rtnString = "";

OleDbDataAdapter da = new OleDbDataAdapter();
DataSet ds = new DataSet();
int intRowsRetrieved;

// read the recordset into the dataset
intRowsRetrieved = da.Fill(ds,rsAuthForm,"auth");
intRowsRetrieved = da.Fill(ds.Tables["auth"], rsAuthForm);

// create the fixed length string for the authorization header
authString = stringAuthHeader(ds);
... and so on

This is the only routine I use a recordset, all the others use a string
input and a string output. It was working great before implementing this part.

Thank you for you help,

James
"Peter Bromberg [C# MVP]" wrote:
Recordset rs = new RecordsetClass();
rs.CursorLocation = CursorLocationEnum.adUseClient;
rs.Open(strSQL, strConn, CursorTypeEnum.adOpenStatic,
LockTypeEnum.adLockReadOnly, (int) CommandTypeEnum.adCmdText);
OleDbDataAdapter da = new OleDbDataAdapter();
DataSet ds = new DataSet();
int intRowsRetrieved;
intRowsRetrieved = da.Fill(ds, rs, "Customers");
intRowsRetrieved = da.Fill(ds.Tables["Customers"], rs);
--Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"James" wrote:

> I am writing a web service for a classic ASP application. I need to consume
> an ADO recordset and then send it to another web service for processing. I
> found an MSDN ariticle telling how to do this
> (http://msdn.microsoft.com/library/de...recordset.asp),
> one big problem - it says to import ADOComponent.dll and msado15.dll. I found
> msado15.dll but I can't find ADOComponenet.dll, neither on my machine or to
> download from the web. Does anyone have it???
>
> Thank you!

Dec 30 '05 #6
Peter,

I found SoapReflectionImporter. I simply changed public method to:

public string SendAuth(SoapReflectionImporter rsAuthForm)

It now compiles and I don't get an error when viewing the .asmx file. My asp
programmer is out today so I can't test that part. Should this fix it?

James
"Peter Bromberg [C# MVP]" wrote:
Yes, because an ADO Recordset is a COM object and the .NET WebServices
infrastructure doesn't know what to do with it. You have several options, the
best one would probably be one of the Xml options the Recordset provides,
which would flatten out the structure to xml or string that can be worked
with.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"James" wrote:
Peter,

Thank you for your response. In this project I am not creating a
recordset, a recordset is being sent to it from a classic asp application as
a paramater. This is running as a piece of the middleware between the the asp
UI and another web service that is communicating with a main frame cobol
application. I need to accept this recordset, put the data from fields into a
fixed length string to send on the the other web service which in turn runs a
cobol transaction on the main frame. The other web service and main frame
application are owned by another state government agency. When I build my
asmx file it says no errors but it returns the error - Cannot serialize
interface ADODB.Recordset.

Here is my code:

[WebMethod(CacheDuration = 30,
Description="Accepts an Authorization in an ADOc recordset format. It
returns an xml data stream with the return status and other specified data.
The return table name is rtnRS.")]
public string SendAuth(Recordset rsAuthForm)
{
string xmlString = "";
string authString = "";
string rtnString = "";

OleDbDataAdapter da = new OleDbDataAdapter();
DataSet ds = new DataSet();
int intRowsRetrieved;

// read the recordset into the dataset
intRowsRetrieved = da.Fill(ds,rsAuthForm,"auth");
intRowsRetrieved = da.Fill(ds.Tables["auth"], rsAuthForm);

// create the fixed length string for the authorization header
authString = stringAuthHeader(ds);
... and so on

This is the only routine I use a recordset, all the others use a string
input and a string output. It was working great before implementing this part.

Thank you for you help,

James
"Peter Bromberg [C# MVP]" wrote:
Recordset rs = new RecordsetClass();
rs.CursorLocation = CursorLocationEnum.adUseClient;
rs.Open(strSQL, strConn, CursorTypeEnum.adOpenStatic,
LockTypeEnum.adLockReadOnly, (int) CommandTypeEnum.adCmdText);
OleDbDataAdapter da = new OleDbDataAdapter();
DataSet ds = new DataSet();
int intRowsRetrieved;
intRowsRetrieved = da.Fill(ds, rs, "Customers");
intRowsRetrieved = da.Fill(ds.Tables["Customers"], rs);
--Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"James" wrote:

> I am writing a web service for a classic ASP application. I need to consume
> an ADO recordset and then send it to another web service for processing. I
> found an MSDN ariticle telling how to do this
> (http://msdn.microsoft.com/library/de...recordset.asp),
> one big problem - it says to import ADOComponent.dll and msado15.dll. I found
> msado15.dll but I can't find ADOComponenet.dll, neither on my machine or to
> download from the web. Does anyone have it???
>
> Thank you!

Dec 30 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: allyn44 | last post by:
Hello--i have inherited a dataset that has records like below: id locationid 1 7 2 3 5 4 5 6 4
1
by: allyn44 | last post by:
Hello, I have a table that has null fields that need to be filled in with the value of the previous record (example below) id date 1 2/2/02 2 3 4/4/02 4
5
by: msprygada | last post by:
I am having a problem with getting a recordset to fill with data in an Access Data Project from a SQL Server database. Here is the code example that is in the Access help files that I can get to...
3
by: Leo | last post by:
Hi everybody, Is there a way to fill a continuous form with an ADO recordset? Normally when I populate the form with the recordset only the first record is shown. I want to fill all records....
5
by: Prasad | last post by:
Hi I have a legacy DLL, that has functions which accept and return type "Variant" I want to use that DLL in .NET. I am able to use functions well that return variants but that return common data...
3
by: Newbie | last post by:
Could someone please tell me how or if the following is possible. I have created a small test database and have opened one connection, one DataAdapter, and one Dataset for it in my vb.net...
0
by: Peter Newman | last post by:
VB.Net 2003 & SQL2005 Ive been trying to find a way to search a Dataset for a value in a colum then move the currency manager to that row ? ie search for "211001" in the Column "Licence" ...
2
by: Peter S. | last post by:
I am pulling some data from a source via ODBC and placing the information in a DataSet. The first pull is very large but once that is complete I plan to do nightly pulls to get any new data that...
0
by: Martin Arvidsson \(Visual Systems AB\) | last post by:
Hi all gurus out there! When i use the Wizard to create some fields from a table it creates, the dataset, bindingsource and tableadapter. Now for the problem. When i open that form in my...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.