How to Setup an ODBC Connection
This sample demonstrates how to setup an ODBC connection.
Files used in this sample are located in the folder:
C:\Program Files\CodeSegment\SMS Studio\Samples\ODBCConnection
How to run this sample
- Create a new ODBC Data Source and set its name to SMS ODBC Database. See How to Create an ODBC Data Source for detailed instructions.
- Open Windows Explorer and locate the CreateTables.vbs file. Double-click on this file to run the script. When asked for the name of the Data Source enter SMS
ODBC Database. The new tables will be created in the database according to the requirements of the ODBC connection.
- In the Connections window in SMS Studio click the Add button and select the ODBC connection to database option in the Add Connection dialog.
- In the Database tab of the Add ODBC Connection dialog enter the following parameters:
Data Source: SMS ODBC Database
Collect every: 10 seconds
- Click the OK button to close the Add ODBC Connection dialog.
- In the Connection window click the Connect button to activate the newly added connection.
- Open Windows Explorer and locate the
TestReceive.vbs file. Double-click on this file to run the script. Type in the text of the message and click the OK button. Check the Inbox
window in SMS Studio to see that the test message has arrived. You can also manually open the database and add records to the Incoming table. Records should appear as new
messages in the SMS Studio Inbox window. Allow up to 10 seconds (the Collect every setting) for messages to appear in the Inbox window.
- Use the Send Message dialog to send a message through ODBC connection. Make sure to select the newly added account in the Account field. Check the Outbox window to see that the message has
been successfully sent. Open the database and check if the message has been stored in the Outgoing table.
Related topics
ODBC Account