{"id":262,"date":"2012-02-18T11:11:42","date_gmt":"2012-02-18T11:11:42","guid":{"rendered":"http:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/?p=262"},"modified":"2025-05-28T05:12:55","modified_gmt":"2025-05-28T05:12:55","slug":"setting-logon-information-for-custom-report-in-sage-accpac-300","status":"publish","type":"post","link":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2012\/02\/18\/setting-logon-information-for-custom-report-in-sage-accpac-300\/","title":{"rendered":"Setting Logon information for Custom report in Sage Accpac (300)"},"content":{"rendered":"<p>In Sage Accpac ERP, if you design a report using one Database say e.g. \u201cSAMINC\u201d and when you deploy it at clients end where database name is different say \u201cSAMLTD\u201d, then sometimes while executing the custom report through the custom report UI you get a error message \u201c<strong>Logon failed\u201d<\/strong> as shown on below screen.<br \/>\n<img decoding=\"async\" class=\"aligncenter size-full wp-image-264\" src=\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-content\/uploads\/2012\/02\/11.jpg\" alt=\"\" width=\"274\" height=\"124\" \/><img decoding=\"async\" class=\"aligncenter size-full wp-image-265\" src=\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-content\/uploads\/2012\/02\/2.jpg\" alt=\"\" width=\"221\" height=\"122\" \/><br \/>\nThis is because the report still tries to connect to the first database, which it has stored with itself.<\/p>\n<p>To solve this error, you should pass the database connection details to the report at run time, using following code snippet<\/p>\n<p>&lt;Snip&gt;<br \/>\n&#8216;initialise crystal report application object<br \/>\nSet CrxApp = New CRAXDRT.Application<br \/>\n&#8216;setting the report file name with complete path to open the report<br \/>\nSet CrxRep = CrxApp.OpenReport(report path variable)<br \/>\n&#8216;Set your Database object to the Report object&#8217;s Database object<br \/>\nSet crxDatabase = CrxRep.Database<br \/>\n&#8216;Set your DatabaseTables object to the Database object&#8217;s Tables object<br \/>\nSet crxDatabaseTables = crxDatabase.Tables<br \/>\n&#8216;Loop through all tables in the report.<br \/>\nFor Each crxDatabaseTable In crxDatabaseTables<br \/>\n&#8216;delete the existing connection information linked to the report<br \/>\ncrxDatabaseTable.ConnectionProperties.DeleteAll<br \/>\n&#8216;set current log on information of the report<br \/>\ncrxDatabaseTable.SetLogOnInfo l_str_DBNAME, l_str_DBNAME, l_str_UserID,\u00a0l_str_Password<br \/>\n&#8216;fill the reports connectionstring buffer with current logon information<br \/>\ncrxDatabaseTable.ConnectBufferString = &#8220;DSN=&#8221; &amp; l_str_DBNAME &amp; &#8220;;;User ID=&#8221; \u00a0\u00a0&amp; l_str_UserID\u00a0 &amp; &#8220;;;Password=&#8221; &amp; l_str_Password &amp; &#8220;;;Database=&#8221; &amp; \u00a0\u00a0l_str_DBNAME &amp; &#8220;;;UseDSNProperties=1&#8221;<br \/>\nNext\u00a0 &#8216; For Each crxDatabaseTable In crxDatabaseTables<br \/>\n&#8216;Assign the report<br \/>\nfrmReport.CRViewer1.ReportSource = CrxRep<br \/>\n&#8216;Display the report<br \/>\nfrmReport.CRViewer1.ViewReport<br \/>\n&lt;\/Snip&gt;<\/p>\n<p>HAPPY CODING. For any quick help contact us on <strong>accpac@greytrix.com<\/strong><br \/>\n<span style=\"font-size: Medium;\"><strong>About Us<\/strong><\/span><br \/>\n<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<p><a href=\"https:\/\/www.greytrix.com\/\">Greytrix<\/a> offers unique GUMU&#x2122; integrated solutions of\u00a0<a href=\"https:\/\/www.greytrix.com\/product\/sage-crm\/gumu-sage-300-erp-integration\">Sage 300 with Sage CRM,<\/a>\u00a0<a href=\"https:\/\/www.greytrix.com\/product\/sage-300-erp\/gumu-300-salesforce-integration\">Salesforce.com\u00a0<\/a>and\u00a0<a href=\"https:\/\/www.greytrix.com\/product\/sage-300-erp\/ecommerce-magento-integration\">Magento eCommerce<\/a> along with Sage 300 Migration from <a href=\"https:\/\/www.greytrix.com\/resources\/sage-erp-crm-migration.pdf\">Sage 50 US, Sage 50 CA, Sage PRO, QuickBooks, Sage Business Vision and Sage Business Works<\/a>. We also offer best-in-class\u00a0<a href=\"https:\/\/www.greytrix.com\/product\/erp-development\/sage-300-erp-development\">Sage 300 customization and development services<\/a>\u00a0and integration service for applications such as <a href=\"https:\/\/www.greytrix.com\/product\/erp-development\/sage-300-integration-services\">POS | WMS | Payroll | Shipping System | Business Intelligence | eCommerce for Sage 300 ERP<\/a> and in Sage 300c development services we offer services such as upgrades of older codes and screens to new web screens, newer integrations using sdata and web services \u00a0to Sage business partners, end users and Sage PSG worldwide. Greytrix offers over 20+ Sage 300 productivity enhancing utilities that we can help you with such as <a href=\"https:\/\/www.greytrix.com\/product\/sage-300-erp-add-ons\/greymatrix-apparel-solution\">GreyMatrix<\/a>, <a href=\"https:\/\/www.greytrix.com\/product\/sage-300-erp-add-ons\/greytrix-document-attachement\">Document Attachment<\/a>, <a href=\"https:\/\/www.greytrix.com\/product\/sage-300-erp-add-ons\/greytrix-document-numbering\">Document Numbering<\/a>, <a href=\"https:\/\/www.greytrix.com\/product\/sage-300-erp-add-ons\/auto-bank-reconciliation\">Auto-Bank Reconciliation<\/a>, <a href=\"https:\/\/www.greytrix.com\/product\/sage-300-erp-add-ons\/purchase-approval-system\">Purchase Approval System<\/a>, <a href=\"https:\/\/www.greytrix.com\/product\/sage-300-erp-add-ons\/three-way-po-matching\">Three way PO matching<\/a>, <a href=\"https:\/\/www.greytrix.com\/product\/sage-300-erp-add-ons\/bill-of-lading\">Bill of Lading<\/a> and <a href=\"https:\/\/www.greytrix.com\/product\/sage-300-erp-add-ons\/vat-middle-east\">VAT for Middle East<\/a>.<\/p>\n<p>For more details on Sage 300 and 300c Services, please contact us at\u00a0<a href=\"mailto:accpac@greytrix.com\">accpac@greytrix.com<\/a>. We will be glad to assist you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In Sage Accpac ERP, if you design a report using one Database say e.g. \u201cSAMINC\u201d and when you deploy it at clients end where database name is different say \u201cSAMLTD\u201d, then sometimes while executing the custom report through the custom report UI you get a error message \u201cLogon failed\u201d as shown on below screen. This\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2012\/02\/18\/setting-logon-information-for-custom-report-in-sage-accpac-300\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[618,704,891,1499],"class_list":["post-262","post","type-post","status-publish","format-standard","hentry","category-sage-accpac","tag-crystal","tag-database","tag-error","tag-logon"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Setting Logon information for Custom report in Sage Accpac (300)<\/title>\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\/2012\/02\/18\/setting-logon-information-for-custom-report-in-sage-accpac-300\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Setting Logon information for Custom report in Sage Accpac (300)\" \/>\n<meta property=\"og:description\" content=\"In Sage Accpac ERP, if you design a report using one Database say e.g. \u201cSAMINC\u201d and when you deploy it at clients end where database name is different say \u201cSAMLTD\u201d, then sometimes while executing the custom report through the custom report UI you get a error message \u201cLogon failed\u201d as shown on below screen. This\u2026 Read More &raquo;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2012\/02\/18\/setting-logon-information-for-custom-report-in-sage-accpac-300\/\" \/>\n<meta property=\"og:site_name\" content=\"Sage 300 ERP \u2013 Tips, Tricks and Components\" \/>\n<meta property=\"article:published_time\" content=\"2012-02-18T11:11:42+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-05-28T05:12:55+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-content\/uploads\/2012\/02\/11.jpg\" \/>\n<meta name=\"author\" content=\"sage300\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"sage300\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 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\/2012\/02\/18\/setting-logon-information-for-custom-report-in-sage-accpac-300\/\",\"url\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2012\/02\/18\/setting-logon-information-for-custom-report-in-sage-accpac-300\/\",\"name\":\"Setting Logon information for Custom report in Sage Accpac (300)\",\"isPartOf\":{\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2012\/02\/18\/setting-logon-information-for-custom-report-in-sage-accpac-300\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2012\/02\/18\/setting-logon-information-for-custom-report-in-sage-accpac-300\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-content\/uploads\/2012\/02\/11.jpg\",\"datePublished\":\"2012-02-18T11:11:42+00:00\",\"dateModified\":\"2025-05-28T05:12:55+00:00\",\"author\":{\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#\/schema\/person\/1aced4e22c30ccf606960de27c9542f5\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2012\/02\/18\/setting-logon-information-for-custom-report-in-sage-accpac-300\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2012\/02\/18\/setting-logon-information-for-custom-report-in-sage-accpac-300\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2012\/02\/18\/setting-logon-information-for-custom-report-in-sage-accpac-300\/#primaryimage\",\"url\":\"http:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-content\/uploads\/2012\/02\/11.jpg\",\"contentUrl\":\"http:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-content\/uploads\/2012\/02\/11.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2012\/02\/18\/setting-logon-information-for-custom-report-in-sage-accpac-300\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Setting Logon information for Custom report in Sage Accpac (300)\"}]},{\"@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\/1aced4e22c30ccf606960de27c9542f5\",\"name\":\"sage300\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/c3b4325cb326e36467f945b9b9adf2bb85e907fe092d42eb36b39743b492e626?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/c3b4325cb326e36467f945b9b9adf2bb85e907fe092d42eb36b39743b492e626?s=96&d=mm&r=g\",\"caption\":\"sage300\"},\"url\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/author\/sageaccpac\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Setting Logon information for Custom report in Sage Accpac (300)","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\/2012\/02\/18\/setting-logon-information-for-custom-report-in-sage-accpac-300\/","og_locale":"en_US","og_type":"article","og_title":"Setting Logon information for Custom report in Sage Accpac (300)","og_description":"In Sage Accpac ERP, if you design a report using one Database say e.g. \u201cSAMINC\u201d and when you deploy it at clients end where database name is different say \u201cSAMLTD\u201d, then sometimes while executing the custom report through the custom report UI you get a error message \u201cLogon failed\u201d as shown on below screen. This\u2026 Read More &raquo;","og_url":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2012\/02\/18\/setting-logon-information-for-custom-report-in-sage-accpac-300\/","og_site_name":"Sage 300 ERP \u2013 Tips, Tricks and Components","article_published_time":"2012-02-18T11:11:42+00:00","article_modified_time":"2025-05-28T05:12:55+00:00","og_image":[{"url":"http:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-content\/uploads\/2012\/02\/11.jpg","type":"","width":"","height":""}],"author":"sage300","twitter_card":"summary_large_image","twitter_misc":{"Written by":"sage300","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2012\/02\/18\/setting-logon-information-for-custom-report-in-sage-accpac-300\/","url":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2012\/02\/18\/setting-logon-information-for-custom-report-in-sage-accpac-300\/","name":"Setting Logon information for Custom report in Sage Accpac (300)","isPartOf":{"@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2012\/02\/18\/setting-logon-information-for-custom-report-in-sage-accpac-300\/#primaryimage"},"image":{"@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2012\/02\/18\/setting-logon-information-for-custom-report-in-sage-accpac-300\/#primaryimage"},"thumbnailUrl":"http:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-content\/uploads\/2012\/02\/11.jpg","datePublished":"2012-02-18T11:11:42+00:00","dateModified":"2025-05-28T05:12:55+00:00","author":{"@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#\/schema\/person\/1aced4e22c30ccf606960de27c9542f5"},"breadcrumb":{"@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2012\/02\/18\/setting-logon-information-for-custom-report-in-sage-accpac-300\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2012\/02\/18\/setting-logon-information-for-custom-report-in-sage-accpac-300\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2012\/02\/18\/setting-logon-information-for-custom-report-in-sage-accpac-300\/#primaryimage","url":"http:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-content\/uploads\/2012\/02\/11.jpg","contentUrl":"http:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-content\/uploads\/2012\/02\/11.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2012\/02\/18\/setting-logon-information-for-custom-report-in-sage-accpac-300\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/"},{"@type":"ListItem","position":2,"name":"Setting Logon information for Custom report in Sage Accpac (300)"}]},{"@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\/1aced4e22c30ccf606960de27c9542f5","name":"sage300","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/c3b4325cb326e36467f945b9b9adf2bb85e907fe092d42eb36b39743b492e626?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c3b4325cb326e36467f945b9b9adf2bb85e907fe092d42eb36b39743b492e626?s=96&d=mm&r=g","caption":"sage300"},"url":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/author\/sageaccpac\/"}]}},"_links":{"self":[{"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/posts\/262","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\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/comments?post=262"}],"version-history":[{"count":4,"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/posts\/262\/revisions"}],"predecessor-version":[{"id":26368,"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/posts\/262\/revisions\/26368"}],"wp:attachment":[{"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/media?parent=262"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/categories?post=262"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/tags?post=262"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}