Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using ADO recordset in MTS project

Status
Not open for further replies.

Jogi

Programmer
Sep 14, 1999
4
PK
We are planning to use MTS in our project. Should we use ADO recordset for communication between different tiers; or there is any better technique.
 
Hi Jogi!<br>
<br>
I've seen that done (see the book by Joseph Moniz called 'Enterprise Application Architecture with VB, ASP, MTS'. Once you get past his jargon, the architecture seems to be pretty solid.<br>
<br>
I guess one reason for *not* using the ADO recordset is if you have any datatypes that don't cleanly map to one of the supported types. We had a currency that was 21 digits long (fifteen digits to the left of the decimal, and six to the right), which none of the Microsoft integral datatypes could handle, so we ended up using 'string' -- most unsatisfactory, but it worked.<br>
<br>
Chip H.<br>

 
Hi Chip!<br>
<br>
We do not have such an exceptional case in our project. But we will consider your experience and decide accordingly. I still have a confusion. Let us say my bussiness tier sends say 100 records to user tier. How will we incorporate string there.<br>
<br>
Thanks for your response.<br>
<br>
Jogi
 
Hi Jogi!<br>
<br>
I'm a little confused -- I think you're asking: 'If I have a datatype that doesn't map cleanly, and I end up using a string to pass it, how would that work?'<br>
<br>
And the answer is: Fairly simply. If I have a field called "BigNumber", in the software layer closest to the database, I'd do something like:<br>
<br>
public property get szBigNumber() as string<br>
szBigNumber = CStr(MyRecordset.Fields("BigNumber))<br>
end property<br>
<br>
If the ADO recordset itself can't handle the datatype, then I would create a View in the database which does the conversion for me, and ADO will be able to handle that (as a string) just fine.<br>
<br>
CREATE VIEW SalesNumView AS<br>
SELECT PrimaryKey, STR(BigNumber), OtherField<br>
FROM SalesNumTable;<br>
<br>
Is that what you're asking?<br>
<br>
Chip H.<br>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top