Nick you might like to use CreateObject("COM", dmoObj)  etc so you can do
all your COM stuff in cfscript block

<cfscript>

x = CreateObject("COM", dmoObj);
strEntityType = ;
strEntityName = ;
thisDatabase = dmoObj.Databases(strDb);

</cfscript>

or whatever...

Justin

>-----Original Message-----
>From: DeVoil, Nick [mailto:[EMAIL PROTECTED]]
>Sent: Tuesday, January 16, 2001 11:16 AM
>To: CF-Talk
>Subject: RE: cfobject question
>
>
>Clint,
>Something like this should do it
>
><cfobject...... name="dmoObj">
><cfset strDb = ...>
><cfset strEntityType = ...>
><cfset strEntityName = ...>
>
><cfscript>
>thisDatabase = dmoObj.Databases(strDb);
></cfscript>
>
><cfswitch expression="#strEntityType#">
><cfcase value="Tables">
>       <cfset dmoCollection = thisDatabase.Tables>
>       <cfset strImage = "images/table.gif">
>       <cfif strEntityName is not "">
>               <cfscript>
>               dmoEntities = dmoCollection(strEntityName).Columns;
>               </cfscript>
>       </cfif>
></cfcase>
>
><cfcase value="Views">
>       <cfset dmoCollection = thisDatabase.Views>
>       <cfset strImage = "images/view.gif">
></cfcase>
>
><cfcase value="Stored_Procedures">
>       <cfset dmoCollection = thisDatabase.StoredProcedures>
>       <cfset strImage = "images/sp.gif">
></cfcase>
>
><cfcase value="Users">
>       <cfset dmoCollection = thisDatabase.Users>
>       <cfset strImage = "images/users.gif">
></cfcase>
>
><cfdefaultcase>
></cfdefaultcase>
></cfswitch>
>
>
>-----Original Message-----
>From: Clint Tredway [mailto:[EMAIL PROTECTED]]
>Sent: Monday, January 15, 2001 4:46 PM
>To: CF-Talk
>Subject: cfobject question
>
>
>I need to find out if cfboject can an equivalent to this ASP code:
>With dmoServer.Databases(strDb)
>       Select Case strEntityType
>                       Case "Tables":
>                               Set dmoCollection = .Tables
>                               strImage = "images/table.gif"
>                               if strEntityName <> "" then
>                                       set dmoEntities =
>dmoCollection(strEntityName).Columns
>                               end if
>                       Case "Views":
>                               Set dmoCollection = .Views
>                               strImage = "images/view.gif"
>                       Case "Stored_Procedures":
>                               Set dmoCollection = .StoredProcedures
>                               strImage = "images/sp.gif"
>                       Case "Users":
>                               Set dmoCollection = .Users
>                               strImage = "images/user.gif"
>               End Select
>Basically what this is doing is using the SQLDMO object to get a list of
>tables,views,sprocs,or users depending on what the strEntityName is. I
>cannot reproduce this in CF. Can someone help me?
>
>-Clint
>
>
>**********************************************************************
>Information in this email is confidential and may be privileged.
>It is intended for the addressee only. If you have received it in error,
>please notify the sender immediately and delete it from your system.
>You should not otherwise copy it, retransmit it or use or disclose its
>contents to anyone.
>Thank you for your co-operation.
>**********************************************************************
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to