×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

How to access database from MTs which r located on two different machi

How to access database from MTs which r located on two different machi

How to access database from MTs which r located on two different machi

(OP)
I have two dll's in MTS which has to access the database(SQl Server) which is on a different machine. This two dlls must run in the same transaction. How do i enlist the connection for this using VB, meaning i want to have the same connection for these two components.
Can u tell me how to do this and is it possible using DSN's . If so how (using VB6.0)1

Thanks

RE: How to access database from MTs which r located on two different machi

Hi
Well Iam Curious to know why do u want to use two different dlls.U can have all the components in a single dll.But its up to u to decide.

Ill answer your question of connecting to the SQL Server?

Create a DSN using odbcad32.exe
Use Adodb.Connection Object and connect to the database using the open Method.
U should be able to do all data base operation with the Connect Object .



To Manage Transaction?

Set the transaction property of the Component where the transaction steps start(Alternative to Begin Tran) to Requires New Transaction


Set the transaction property of the Component where the transaction steps ends(Alternative to End Tran) to Supports Transaction.

Dont forget to use the method CommitTran/RollbackTran

This should solve your problem

RE: How to access database from MTs which r located on two different machi

Transaction is managed by MTS.What you need to do is tell MTS your components' transaction property and donot manage transaction manually!

For me (ADO2.6),i am using a UDL file to describe the db connection infomation and each dll will use this UDL file.I canot guarantee these two dlls will use the same db connection because the db connection is managed by MTS too.It is possible for two dll to use the same DB connection as the MTS's connection pooling technology.

Regards£¡

zallen@cmmail.com
Long live of freedom!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close