Parentheses in Function with ODBC Connection String Cause Error When Used in Script
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 FunctionFunction 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 FunctionWhen 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 FunctionFunction 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
Categories
- All Categories
- 123 Developer Announcements
- 54 Articles
- 150 General Questions
- 148 Thrust Services
- 57 OpenText Hackathon
- 37 Developer Tools
- 20.6K Analytics
- 4.2K AppWorks
- 9K Extended ECM
- 918 Core Messaging
- 84 Digital Asset Management
- 9.4K Documentum
- 32 eDOCS
- 186 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management
- 8 XM Fax
- Follow Categories