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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Ado across DLL's...

Status
Not open for further replies.

DTJeff

Programmer
Dec 9, 2003
37
0
0
GB
Hi.

Im trying to create a application to connect to an SQL databse using ADO (so record locking can be achieved). This in itself is no problem except that I want the data connection and recordsets etc to be in a dll, and the code that uses it (including forms etc) to be another dll.

Essentially what i want to end up with is:

Application
// \\
Data DLL Forms and logic DLL
//
SQL DB

The reason for wanting this layout is the application is really just going to be a container, and the Forms dll will in fact be several "programs" which can all use the one common SQL connection (instead of one per sub application).

Is this possible?

Thanks for any help :)
 
Not only is it possible, it is the preferred approach. It is called a distributed application (or nTier)... All you have to do is create separate assemblies... one for presentation layer... one for business logic... and one for data access. Add a reference to the business layer to the presentation layer and add a reference to the data access layer to the business layer... and there you have it.
 
Hi,

Thanks for the reply. I think i need to correct the diagram a little. This is what i'm looking to do:

Application
// || \\
Data DLL Forms and logic DLL(1) Forms and logic DLL(2)
//
SQL DB

rather than:

Application
// \\
Forms and logic DLL Forms and logic DLL(2)
// \\
Data DLL Data DLL
// \\
SQL DB SQL DB

In other words have several "sub" programs (in dll's) using a single DB connection. (the way suggestd in your post would result in each "sub" application creating its own connection.
 
no... the way I suggested would only have one connection through the one data access layer. The entire solution (regardless of how many assemblies) would use this layer, and only this layer, to communicate with the db.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top