Developing one DLL in two environments (Test server+database, Production server+database)- VC++ 6.0, OLEDB, ATL COM, ASP 
Author Message
 Developing one DLL in two environments (Test server+database, Production server+database)- VC++ 6.0, OLEDB, ATL COM, ASP

I've got one DLL that I'm writing in Visual C++ 6.0; it's an ATL COM
component, and uses OLE DB and ASP.  It's used on a Windows 2000 Advanced
Server o/s, running IIS 5.0, MDAC 2.5, Oracle 8i version 8.1.7.0.0.

The problem isn't so much a problem as it is an annoyance.  I imagine most
developers feel the pain of this.

I've got a test server with a test Oracle 8i database, and a production
server with a production Oracle 8i database.  I was wondering if there's a
way to set options on each server to pass in the database Provider
information; namely, the CDBPropSet's DBPROP_INIT_DATASOURCE and
DBPROP_AUTH_PASSWORD.  I'd like to avoid passing this information in through
a method's parameter from my ASP pages.

After I test the component, I need to edit all 8 DBPropSets, and change the
Provider information from my test server's database to my production
server's database.  Then, after I put the DLL on the production server, I
need to change the Provider information -back- to my test server's database.
It'd be great if I could put an option somehow in Component Services... or,
maybe, determine the machine's name/cluster node, and the DLL determines
which provider set to use.

Actually even a compiler setting would be handy; it would save me from
commenting out one property set and un-commenting another.  I can't use the
same datasource name for the provider because I access both systems from my
development PC; and keeping different passwords on the Oracle database makes
sure that I don't drop a table from the wrong system!

Anyone have any recommendations?  Thanks!

-Tom



Fri, 26 Aug 2005 12:57:52 GMT  
 Developing one DLL in two environments (Test server+database, Production server+database)- VC++ 6.0, OLEDB, ATL COM, ASP
The standard solution would be to use a COM+ Connection String to store the
database provider information.

Works great!



Sat, 27 Aug 2005 01:57:33 GMT  
 Developing one DLL in two environments (Test server+database, Production server+database)- VC++ 6.0, OLEDB, ATL COM, ASP
What's the difference between a COM+ Connection String and a regular
connection string?  I couldn't find anything on the 'net or in my books
regarding a COM+ connection string... maybe I'm searching for the wrong
thing?  Is there an MSDN or KBase article you could point me to?

Thanks!

-Tom


Quote:
> The standard solution would be to use a COM+ Connection String to store
the
> database provider information.

> Works great!



Sat, 27 Aug 2005 10:37:52 GMT  
 Developing one DLL in two environments (Test server+database, Production server+database)- VC++ 6.0, OLEDB, ATL COM, ASP
Sorry, I used the wrong term. It is a Constructor String.

Have a look at the IObjectConstruct Interface.

You can set the Constructor String for a COM+ Application using Component
Services. Click on the Properties of any COM+ Component, and select the
"Activation" tab. If the COM+ Component supports the IObjectConstruct
Interface you can select the "Enable object construction" checkbox and type
in any string in the "Constructor String" textbox.

If you create a VB COM object, for example, you can get at this string by
coding:

Implements IObjectConstruct

' --------------------------------------------------------------------------
---------------------
' IObjectConstruct_Construct
' --------------------------------------------------------------------------
---------------------
Private Sub IObjectConstruct_Construct(ByVal pCtorObj As Object)

  Dim s As String

  s = pCtorObj.ConstructString

  ' Do whatever you want with this string
 End Sub



Sat, 27 Aug 2005 12:35:04 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Developing one DLL in two environments (Test server+database, Production server+database)- VC++ 6.0, OLEDB, ATL COM, ASP

2. Database Issues in a distributed client server environment

3. New to ATL Please Help - Navigating Interface with two types of server (Exe and Dll)

4. DCOM and ATL: two client and two server

5. Lifetime of EXE COM server that uses DLL COM server

6. Starting an inproc server as a local server using a DLL Surrogate

7. Database/Database Server Blocking.

8. HELP !!!! Developing a provider for SQL-Server 7.0

9. Develop RADIUS server using Visual C++

10. Developing a simple DNS Server

11. Developing apps for Terminal Server

12. Developing Active Server Component using VC6

 

 
Powered by phpBB® Forum Software