- win7 64bit, Visu+ 2.43, SQL Server Express 2012, SQL Management Studio 17.4 (SSMS)
- win10 64bit, Visu+ 2.43, SQL Server Express 2017, SQL Management Studio 17.4
All links open in new tab. Use them in case you don’t have the necessary software installed.
You might need to open Visu+ as admin: right-click on its icon and select Run as Administrator. A message box will appear asking if you allow this app to make changes to your computer. Click Yes.
Create the SQL database for your project
Open MS SQL Server Management Studio (SSMS) and connect to the installed SQL server. If you connect to the locally installed server, specify computer_name\instance_name, like below.
Right-click on Databases and select New Database. Add a meaningful name in the Database name textbox. Click OK.
Set the Default ODBC Connection Plugin
Now, go to Visu+, open your project and click on the project name, on the left side to display properties on the left side. On the General tab set the Default ODBC Connection Plugin to SQLServerExp2012.
Go to the next line, ODBC Settings, and click on the 3 dots area highlighted with blue.
In the new dialog:
- leave the first textbox unchanged
- add the SQL server in the second textbox as above
- enter the name of the database you created in the third textbox
Click OK to save.
Configure ODBC in Historical Log Settings
On the Project’s properties, scroll down to Historical Log Settings and expand ODBC Manager and click on ODBC DNS. Click on the 3 dots button that just appears on the right.
Now follow the wizard. Changes/input needed are circled in red:
After you click Finish a SQL connection wizard will appear:
Next, tick the the first checkbox and put the name of the database you created for this project:
Next, no changes are needed.
On the last screen, you can test the connection. If the connection is successful, click OK to close the wizard.
Create the project’s tables
To create the project’s table you simply need to go to the last option from ODBC Manager, on the project’s properties, Create DB Table.
Warning: if you already have the tables they will be deleted and recreated – all data will be lost. Make a backup first!
Click on the 3 dots blue area.
To visualize them in SSMS, right-click the database name and select Refresh.
Sample queries for checking the data
- -- select a few lines (10) to see if there is data
- SELECT TOP 10 FROM [BMSdb].[dbo].[Alarms]
- -- select most recent n (10) records
- SELECT TOP 10 FROM [BMSdb].[dbo].[Drivers] ORDER BY [TimeCol] DESC
- -- select all records
- SELECT * FROM [BMSdb].[dbo].[SysMsgs]
I’ve followed your tutorial but can’t figure out how to use the queries. Do you have a specific example of a vba script?
The tutorial is for Visu+, it doesn’t need VBA.
What exactly are you trying to do?