Process Mapping Logo

Process Mapping - Forums

Sharing 19 years of knowledge and experience

 
Metastorm BPM forums
Sign up Latest Topics
 
 
 


Reply
  Author   Comment  
Jerome

Avatar / Picture

Guru
Registered:
Posts: 5,507
Reply with quote  #1 

Parentheses in Function with ODBC Connection String Cause Error When Used in Script

Last edited: 21 Oct 2004


The information in this article applies to product: e-Work 6.x

Issue

  •                                 An e-Work procedure contained a server-side VBScript with the following 2 functions - one that runs ExecSQL() against the e-Work database and one that runs ExecSQL() against an external database.                                

                                                                    Function insertEwork()
    ework.ExecSQL("INSERT INTO distributor_counties (distrib_id,county_name,st_key,zip_code,discty_notes) VALUES (1,'e-Work Script Cty','VA','22003','e-Work Script Test Notes')")
                                    End Function                                        

                                            Function insertExternal()
    ework.ExecSQL("INSERT INTO distributor_counties (distrib_id,county_name,st_key,zip_code,discty_notes) VALUES (4,'IW Ext Cty','VA','22003','IW Ext Test Notes')","DSN=ework2;UID=ework;PWD=secret")
                                            End Function                                        

    When either of these functions was called from 'When button pressed', the user received a 'Failed to refresh form' error and the following was written to the e-Work Designer log:
                                           

                                                    Pre Eval: %Script(VBScript,,%Procedure.Name,%MapName,"insertEwork ")
                                            Post Eval: %Script(VBScript,,Database Insertions,External DB Scripts,insertEwork )
                                            Details: Unable to load script text, reason <0x80020101>. Procedure Script call failed. Position: 58

Resolution

  • Remove the parentheses from the ExecSQL() that contains a database connection string. The revised script is:

                                    Function insertEwork()
    ework.ExecSQL("INSERT INTO distributor_counties (distrib_id,county_name,st_key,zip_code,discty_notes) VALUES (1,'e-Work Script Cty','VA','22003','e-Work Script Test Notes')")
                                    End Function                                        

                                            Function insertExternal()
    ework.ExecSQL"INSERT INTO distributor_counties (distrib_id,county_name,st_key,zip_code,discty_notes) VALUES (4,'IW Ext Cty','VA','22003','IW Ext Test Notes')","DSN=ework2;UID=ework;PWD=secret"
                                            End Function                                                                        

Keywords: kb464


__________________
Post an example, and we will have a much better idea what the problem is. In about 90% of posts, the problem is one of communication. Examples bridge that gap.
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:


Create your own forum with Website Toolbox!