> I'm new to CF and am using version 4.5.1 of both Studio and
> Server. I have a COM object that returns a generated integer
> value. I can use this COM object in any COM enabled Windows
> app. However, when I try to use in a cfm page I get the
> following error:
>
> An error occurred while evaluating the expression:
>
> oASIWeb.SetDataPath("E:\InetPub\wwwroot\SolidData\Data");
> oASIWeb.SetDatabase("sdweb");
> RetVal = oASIWeb.NewID("USERS");
>
> Error near line 4, column 4.
>
> The symbol you have provided (oASIWeb.SetDataPath) is not the
> name of a function. Built-in functions in ColdFusion have names
> with no qualifiers, i.e., no periods (.) in them.
>
> It appears that CF thinks I'm trying to run one of its
> functions. My CF code is as follows:
>
> <CFOBJECT TYPE="COM" NAME="oASIWeb" CLASS="asiweb.asiweb"
> ACTION="CREATE">
>
> <CFSCRIPT>
> oASIWeb.SetDataPath("E:\InetPub\wwwroot\SolidData\Data");
> oASIWeb.SetDatabase("sdweb");
> RetVal = oASIWeb.NewID("USERS");
> </CFSCRIPT>
>
> <CFOUTPUT>#RetVal#</CFOUTPUT>
>
> Am I missing something? Do I need to give the IUSR_MachineName
> account the proper security access? If yes, what? Thanks --Tom
Unfortunately, using COM objects can be problematic with CF occasionally.
Instead of doing what you're doing within a CFSCRIPT, you might have better
luck doing it within CFSET tags:
<cfset rs = oASIWeb.SetDataPath("E:\InetPub\wwwroot\SolidData\Data")>
<cfset rs = oASIWeb.SetDatabase("sdweb")>
<cfset RetVal = oASIWeb.NewID("USERS")>
That usually works for me. To be honest, I've never used COM objects within
CFSCRIPT, but I wouldn't be surprised if they're not supported within
CFSCRIPT as well as they should be.
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.