{"id":27943,"date":"2020-02-28T04:49:56","date_gmt":"2020-02-28T04:49:56","guid":{"rendered":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/?p=27943"},"modified":"2025-07-23T06:32:27","modified_gmt":"2025-07-23T06:32:27","slug":"error-company-database-link-exception-occurred-in-sage-300-using-comapi","status":"publish","type":"post","link":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2020\/02\/28\/error-company-database-link-exception-occurred-in-sage-300-using-comapi\/","title":{"rendered":"Error &#8211; Company database link Exception occurred in Sage 300 using COMAPI"},"content":{"rendered":"\n<p>We are aware that Sage 300 SDK provides capabilities to import the data using an external utility created in different programming languages like VB6.0, C#, etc. During development of such utility programmer may come across situation where they encounter errors on Insert\/Update operations.<\/p>\n\n\n\n<p>So, in this blog, we will discuss about how to handle an exception occurred while importing the data into the Sage 300 Common Services module.<\/p>\n\n\n\n<p><strong>New Stuff: <\/strong>  <a href=\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2020\/02\/28\/change-session-date-in-sage-300c\/\">Change session date in sage 300C<\/a><\/p>\n\n\n\n<p>In\ntoday\u2019s blog we will see one of the possible cause of the error\n\u201cCannot write to system database tables or originate propagation\nusing a company database link. Use a system database link instead.\u201d\nand probable solution to the error. \n<\/p>\n\n\n\n<p>One solution can be that the program requires connection to the system database link instead of company database link. It becomes difficult to identify the cause of the exception as it occurs while inserting\/updating the data into sage 300 using COMAPI.<\/p>\n\n\n\n<p>\n<strong>Using Company DBLink<\/strong><\/p>\n\n\n\n<p><em>mDBLinkCmpRW=accpacsession.OpenDBLink(AccpacCOMAPI.tagDBLinkTypeEnum.DBLINK_COMPANY, AccpacCOMAPI.tagDBLinkFlagsEnum.DBLINK_FLG_READWRITE);<\/em><\/p>\n\n\n\n<p>When\nthe user using the company object to import the data into sage 300,\nthe user can get an error on the below line of code:<\/p>\n\n\n\n<p><em>CSRATES1detail.Insert();<br>CSRATES1detail.Update();<\/em><\/p>\n\n\n\n\n<p> <a rel=\"noopener noreferrer\" href=\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-content\/uploads\/2020\/02\/img1.png\" target=\"_blank\"><img fetchpriority=\"high\" width=\"401\" height=\"159\" class=\"size-full\" style=\"border: 1px solid #A9A9A9; padding: 2px; margin: 2px;\" \nsrc=\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-content\/uploads\/2020\/02\/img1.png\" alt=\"\" class=\"wp-image-27942\" srcset=\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-content\/uploads\/2020\/02\/img1.png 401w, https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-content\/uploads\/2020\/02\/img1-300x119.png 300w\" sizes=\"(max-width: 401px) 100vw, 401px\" \/><\/a><\/p>\n\n\n\n\n<p>\n<strong>Using System DBLink<\/strong><\/p>\n\n\n\n<p>System\ndatabase link instead of the company database will be required to use\nthe Sage 300 object in-order to resolve the above mentioned error.<\/p>\n\n\n\n<p><em>mDBLinkCmpRW=accpacsession.OpenDBLink(AccpacCOMAPI.tagDBLinkTypeEnum.DBLINK_SYSTEM, AccpacCOMAPI.tagDBLinkFlagsEnum.DBLINK_FLG_READWRITE);<\/em><\/p>\n\n\n\n<p>This can be helpful for the developer to quickly overcome the error and proceed further with the development.<\/p>\n\n\n\n<p><span style=\"font-size: Medium;\"><strong>About Us<\/strong><\/span><\/p>\n\n\n\n<p><a href=\"https:\/\/www.greytrix.com\/\">Greytrix<\/a> a globally recognized Premier Sage Gold Development Partner is a one stop solution provider for Sage ERP and Sage CRM needs. Being recognized and rewarded for multi-man years of experience, we bring complete end-to-end assistance for your technical consultations, product customizations, data migration, system integrations, third party add-on development and implementation expertise.<\/p>\n\n\n\n<p><a href=\"https:\/\/www.greytrix.com\/\">Greytrix<\/a> helps in Sage ERP\nand CRM upgrades to the latest version and migration for <a href=\"https:\/\/www.greytrix.com\/product\/professional-services\/migrate-qb-sage-erp-to-sage-intacct\">Sage Intacct from\nSage 300, Sage 100, Sage 50 and QuickBooks<\/a>; for Sage\n100, Sage 300 (Sage Accpac), Sage Enterprise Management (Sage X3) from <a href=\"https:\/\/www.greytrix.com\/product\/sage-300-erp\/sage-pro-sage-300-migration\">Sage Pro<\/a>, <a href=\"https:\/\/www.greytrix.com\/product\/sage-300-erp\/sage-50-us-sage-300-migration\">Sage 50 US<\/a>, <a href=\"https:\/\/www.greytrix.com\/product\/sage-300-erp\/sage-50-ca-sage-300-migration\">Sage 50 CA<\/a>, <a href=\"https:\/\/www.greytrix.com\/resources\/sage-erp-crm-migration.pdf\">Sage 50 Usage\nBusiness Works, Sage Business Vision<\/a> and <a href=\"https:\/\/www.greytrix.com\/product\/sage-100-erp\/quickbooks-sage-100-migration\">QuickBooks<\/a>; for\nSage CRM from <a href=\"https:\/\/www.greytrix.com\/resources\/sage-erp-crm-migration.pdf\">Salesforce | ACT! |\nSalesLogix | Goldmine | Sugar CRM | Maximizer<\/a><\/p>\n\n\n\n<p>For more information on Sage ERP \u2013 CRM migration solutions, please contact us at <a href=\"mailto:erpmig@greytrix.com\">erpmig@greytrix.com<\/a>.&nbsp;We will be glad to assist you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We are aware that Sage 300 SDK provides capabilities to import the data using an external utility created in different programming languages like VB6.0, C#, etc. During development of such utility programmer may come across situation where they encounter errors on Insert\/Update operations. So, in this blog, we will discuss about how to handle an\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2020\/02\/28\/error-company-database-link-exception-occurred-in-sage-300-using-comapi\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[3439,891,3440,3441,3438,2357,2372,2429],"class_list":["post-27943","post","type-post","status-publish","format-standard","hentry","category-sage-accpac","tag-cannot-write-to-system-database-tables-or-originate-propagation-using-a-company-database-link-use-a-system-database-link-instead","tag-error","tag-error-in-sage-300","tag-exception","tag-exception-in-sage-300","tag-sage-300-erp","tag-sage-300-erp-error","tag-sage-300c"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Fix: Company Database Link Exception in Sage 300<\/title>\n<meta name=\"description\" content=\"Resolve the &quot;Company Database Link Exception&quot; error in Sage 300 when using COMAPI. Follow this guide for troubleshooting and effective error handling.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2020\/02\/28\/error-company-database-link-exception-occurred-in-sage-300-using-comapi\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Fix: Company Database Link Exception in Sage 300\" \/>\n<meta property=\"og:description\" content=\"Resolve the &quot;Company Database Link Exception&quot; error in Sage 300 when using COMAPI. Follow this guide for troubleshooting and effective error handling.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2020\/02\/28\/error-company-database-link-exception-occurred-in-sage-300-using-comapi\/\" \/>\n<meta property=\"og:site_name\" content=\"Sage 300 ERP \u2013 Tips, Tricks and Components\" \/>\n<meta property=\"article:published_time\" content=\"2020-02-28T04:49:56+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-07-23T06:32:27+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-content\/uploads\/2020\/02\/img1.png\" \/>\n<meta name=\"author\" content=\"Greytrix\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Greytrix\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2020\/02\/28\/error-company-database-link-exception-occurred-in-sage-300-using-comapi\/\",\"url\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2020\/02\/28\/error-company-database-link-exception-occurred-in-sage-300-using-comapi\/\",\"name\":\"Fix: Company Database Link Exception in Sage 300\",\"isPartOf\":{\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2020\/02\/28\/error-company-database-link-exception-occurred-in-sage-300-using-comapi\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2020\/02\/28\/error-company-database-link-exception-occurred-in-sage-300-using-comapi\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-content\/uploads\/2020\/02\/img1.png\",\"datePublished\":\"2020-02-28T04:49:56+00:00\",\"dateModified\":\"2025-07-23T06:32:27+00:00\",\"author\":{\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#\/schema\/person\/93977cd8aa8fbd1f151d3f664e29c9f2\"},\"description\":\"Resolve the \\\"Company Database Link Exception\\\" error in Sage 300 when using COMAPI. Follow this guide for troubleshooting and effective error handling.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2020\/02\/28\/error-company-database-link-exception-occurred-in-sage-300-using-comapi\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2020\/02\/28\/error-company-database-link-exception-occurred-in-sage-300-using-comapi\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2020\/02\/28\/error-company-database-link-exception-occurred-in-sage-300-using-comapi\/#primaryimage\",\"url\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-content\/uploads\/2020\/02\/img1.png\",\"contentUrl\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-content\/uploads\/2020\/02\/img1.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2020\/02\/28\/error-company-database-link-exception-occurred-in-sage-300-using-comapi\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Error &#8211; Company database link Exception occurred in Sage 300 using COMAPI\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#website\",\"url\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/\",\"name\":\"Sage 300 ERP \u2013 Tips, Tricks and Components\",\"description\":\"Explore the world of Sage 300 with our insightful blogs, expert tips, and the latest updates. We\u2019ll empower you to leverage Sage 300 to its fullest potential. As your one-stop partner, Greytrix delivers exceptional solutions and integrations for Sage 300. Our blogs extend our support to businesses, covering the latest insights and trends. Dive in and transform your Sage 300 experience with us! \",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#\/schema\/person\/93977cd8aa8fbd1f151d3f664e29c9f2\",\"name\":\"Greytrix\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/3cdb553d6ca07df0e407d5e092f2410d163e0fd40b27734b345b04c8f0786969?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/3cdb553d6ca07df0e407d5e092f2410d163e0fd40b27734b345b04c8f0786969?s=96&d=mm&r=g\",\"caption\":\"Greytrix\"},\"url\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/author\/greytrix\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Fix: Company Database Link Exception in Sage 300","description":"Resolve the \"Company Database Link Exception\" error in Sage 300 when using COMAPI. Follow this guide for troubleshooting and effective error handling.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2020\/02\/28\/error-company-database-link-exception-occurred-in-sage-300-using-comapi\/","og_locale":"en_US","og_type":"article","og_title":"Fix: Company Database Link Exception in Sage 300","og_description":"Resolve the \"Company Database Link Exception\" error in Sage 300 when using COMAPI. Follow this guide for troubleshooting and effective error handling.","og_url":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2020\/02\/28\/error-company-database-link-exception-occurred-in-sage-300-using-comapi\/","og_site_name":"Sage 300 ERP \u2013 Tips, Tricks and Components","article_published_time":"2020-02-28T04:49:56+00:00","article_modified_time":"2025-07-23T06:32:27+00:00","og_image":[{"url":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-content\/uploads\/2020\/02\/img1.png","type":"","width":"","height":""}],"author":"Greytrix","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Greytrix","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2020\/02\/28\/error-company-database-link-exception-occurred-in-sage-300-using-comapi\/","url":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2020\/02\/28\/error-company-database-link-exception-occurred-in-sage-300-using-comapi\/","name":"Fix: Company Database Link Exception in Sage 300","isPartOf":{"@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2020\/02\/28\/error-company-database-link-exception-occurred-in-sage-300-using-comapi\/#primaryimage"},"image":{"@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2020\/02\/28\/error-company-database-link-exception-occurred-in-sage-300-using-comapi\/#primaryimage"},"thumbnailUrl":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-content\/uploads\/2020\/02\/img1.png","datePublished":"2020-02-28T04:49:56+00:00","dateModified":"2025-07-23T06:32:27+00:00","author":{"@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#\/schema\/person\/93977cd8aa8fbd1f151d3f664e29c9f2"},"description":"Resolve the \"Company Database Link Exception\" error in Sage 300 when using COMAPI. Follow this guide for troubleshooting and effective error handling.","breadcrumb":{"@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2020\/02\/28\/error-company-database-link-exception-occurred-in-sage-300-using-comapi\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2020\/02\/28\/error-company-database-link-exception-occurred-in-sage-300-using-comapi\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2020\/02\/28\/error-company-database-link-exception-occurred-in-sage-300-using-comapi\/#primaryimage","url":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-content\/uploads\/2020\/02\/img1.png","contentUrl":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-content\/uploads\/2020\/02\/img1.png"},{"@type":"BreadcrumbList","@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2020\/02\/28\/error-company-database-link-exception-occurred-in-sage-300-using-comapi\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/"},{"@type":"ListItem","position":2,"name":"Error &#8211; Company database link Exception occurred in Sage 300 using COMAPI"}]},{"@type":"WebSite","@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#website","url":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/","name":"Sage 300 ERP \u2013 Tips, Tricks and Components","description":"Explore the world of Sage 300 with our insightful blogs, expert tips, and the latest updates. We\u2019ll empower you to leverage Sage 300 to its fullest potential. As your one-stop partner, Greytrix delivers exceptional solutions and integrations for Sage 300. Our blogs extend our support to businesses, covering the latest insights and trends. Dive in and transform your Sage 300 experience with us! ","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#\/schema\/person\/93977cd8aa8fbd1f151d3f664e29c9f2","name":"Greytrix","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/3cdb553d6ca07df0e407d5e092f2410d163e0fd40b27734b345b04c8f0786969?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3cdb553d6ca07df0e407d5e092f2410d163e0fd40b27734b345b04c8f0786969?s=96&d=mm&r=g","caption":"Greytrix"},"url":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/author\/greytrix\/"}]}},"_links":{"self":[{"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/posts\/27943","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/comments?post=27943"}],"version-history":[{"count":1,"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/posts\/27943\/revisions"}],"predecessor-version":[{"id":27949,"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/posts\/27943\/revisions\/27949"}],"wp:attachment":[{"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/media?parent=27943"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/categories?post=27943"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/tags?post=27943"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}