Connecting atvise® with ODBC for seamless Database Integration

Created by Agent Aaron Camacho, Modified on Wed, 28 Jun 2023 at 09:30 PM by Agent Aaron Camacho

For connecting a data base with atvise®, follow the next steps:


  1. Download and install the appropriate driver for your database, such as "MySQL ODBC 8.0 ANSI Driver".                          
  2. Create a new data source connection in the System DSN section of ODBC (32-bit or 64-bit) based on the architecture of atvise® SCADA.                                                                                                                                                                  
  3. Follow the instructions specific to the driver you are setting up for the data source.                                                           
  4. Take note of the connection name, as it will be required for the script in atvise®.                                                                                                                                                                                   
  5. Open atvise® Live in the builder and navigate to the Scripting section. Click on the Download button and select "Import" for the "i026 ODBC example".                                                                                                                                                                                                                                                                                                             
  6. Go to the "Menu Script" section. The following menu scripts will be created: Library > Project > Menu Scripts > ODBC.                                                                                                                  
  7. Modify the line odbcClient.source = "DSN=ODBC_Name; Uid=NameOfUid; Pwd=password;"; . Change the name of the ODBC connection accordingly.                                                                                                                   
  8. Alternatively, you can simplify the code by using odbcClient.source = "DSN=ODBC_Name;"; . In this case, the Uid and Pwd are not required since the ODBC connection already contains the credentials for authentication.                                                                                                                            
  9. Modify the odbcClient.query to match the query you want to execute. Simply copy and paste the query from your database and click on the "Save and Run" button. Note that in this step, you do not need to specify the database.table in the query since the database was already selected in the ODBC connection.                                                                                                                                                                                                   
  10. The result will be displayed in the Server Log if you use a query "SELECT" using console.log(query);


Note that these steps are general guidelines, and you may need to adapt them based on your specific database and atvise® configuration.


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article