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

  1. 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.
  2. 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.
  3. In the Connections window in SMS Studio click the Add button and select the ODBC connection to database option in the Add Connection dialog.
  4. In the Database tab of the Add ODBC Connection dialog enter the following parameters:
    Data Source: SMS ODBC Database
    Collect every: 10 seconds
  5. Click the OK button to close the Add ODBC Connection dialog.
  6. In the Connection window click the Connect button to activate the newly added connection.
  7. 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.
  8. 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

 

Copyright © 2002-2007 CodeSegment. All rights reserved.

   www.codesegment.com