Click here to Skip to main content
Click here to Skip to main content

How to conduct an SMS survey using a cell phone connected SMS gateway and MS Access

By , 16 Oct 2007
 

Introduction

Briefly, this tutorial will teach you how to conduct an SMS survey using a cell phone connected SMS gateway and store the survey results in an MS Access database, from which you can generate/print out reports.

You are assumed to be familiar with the Windows Operating System, MS Access, and the SQL language. As a pre-requisite, you would need to prepare a GSM modem or cell phone with data cable for this solution, and a Windows NT based PC like Windows 2000, Windows 2003, or Windows XP.

The system architecture used for the SMS messaging part of the solution consists of a GSM modem, or a cell phone attached to your PC either by a serial port or USB port, a SQL driven SMS gateway software, and a SQL database such as Microsoft SQL Server (MSSQL). For this solution, we used the VisualGSM Enterprise Server, an off-the-shelf SMS gateway software that comes with a 45 day free use - refer to Figure 1 for the setup components.

Screenshot - system1.gif

Figure 1

Setting up the SMS gateway

The first step to setting up your SMS gateway would be to prepare your MSSQL database - you would need to have administrator access. If you do not have a MSSQL database, you may download SQL Server 2005 Express Edition, a free version of MSSQL here (also see Setup Guide for SQL Server 2005 Express).

After you have setup your MSSQL database, you would need to install an SMS gateway software. For this solution, we use VisualGSM Enterprise SMS software, which you can download a trial version of. Unzip the download package, and after reading the extracted readme file, run the installation file setup.exe. The last part of the installation will run the database setup wizard which allows you to automatically setup your MSSQL database for the SMS gateway software.

After that, with your GSM modem or cell phone (list of compatible cell phones/GSM modems) connected to your PC, proceed to setup the COM ports (usually COM 1 or COM 2 for GSM modems) using the SMS gateway software. If you are using a USB cable, you must install a driver that creates a virtual COM port - you can find the virtual COM port using Windows Device Manager/Modems setup. Most GSM modems use baud rates of 9,600, 19,200, or 115,200 (for USB modems). Note: Besides GSM modems, VisualGSM Enterprise also supports the SMPP protocol of communication.

Start the SMS gateway service. If you encounter any problems, you may find the debug log at the following path: c:\program files\visualtron software corporation\visualgsm\vgsmlog\. If the log shows that the software cannot detect the modem, you may use Hypterminal to test the connection to your modem - refer to this Hyperterminal test guide.

Preparing the MS Access file

For our SMS survey, we will need to setup the SMS gateway to write SMS survey replies to an MS Access database.

Run MS Access, create a new database, e.g., access_demo.mdb, and add a table "survey" with fields "Survey_results" and "Respondent". The field "Survey_results" will store the respondent's reply, while the field "Respondent" will store the mobile number of the respondent. Refer to Figure 2 for a screen capture. Save your database configuration.

Screenshot - access.gif

Figure 2

After that, create an MS Access "system DSN" for this database, e.g., VGSMDEMO - refer to Figure 3. This system DSN is required for the SMS gateway software to access your MS Access database.

Screenshot - dsn.gif

Figure 3

Creating the SQL action to insert SMS into an MS Access file

The SMS gateway software allows you to setup "keyword actions" that can execute a SQL statement based on the SMS survey reply received. The keywords should match the SMS response from your survey users (case insensitive).

We use the following SQL statement (refer to figure 4):

insert into survey (SURVEY_RESULTS,RESPONDENT) values ('YES','{N}')

This setup would create a new record in the table "Survey", set the field "Survey_results" equal to "Yes", and the field "Respondent" equal to {N}. {N} represents the respondent's mobile number. It is a fixed property provided by VisualGSM Enterprise. For the example shown in Figure 4, if the user replies A, VisualGSM will insert a new record into "Survey" in which the field "Survey_results" will carry the value 'YES'.

Screenshot - keyword.gif

Screenshot - keyword2.gif

Figure 4

Useful links

  1. SQL Server 2005 Express Edition: http://www.microsoft.com/sql/editions/express/default.mspx
  2. Setup guide for SQL Server 2005 Express: http://www.visualtron.com/download/Configuring_MSSQLExpress2005.pdf
  3. VisualGSM Enterprise SMS gateway: SMS Gateway
  4. How to test your GSM modem/cell phone using Hyperterminal: Hyperterminal SMS

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Adam Page
Web Developer
Singapore Singapore
Member
I'm a freelancer with more than 8 years of experience, specializing in wireless application development.

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
Questionpak soft sms gatewaymemberjimisd_axily8 Dec '12 - 17:29 
Pak Soft SMS Gateway is a .NET C# messaging Gateway that can be used to send and receive messages using any ETSI 07.05 compliant GSM modem or phone handset connected to the PC serial port through serial cable, infrared or bluetooth.
Some of the features of the Pak Soft SMS Gateway
Fully Supported Multipart Or Long SMS
Send SMS
Read incoming SMS
Send MMS
Read MMS
Send WAP Push message
Send vCalendar,
vCard Send Flash SMS
Send Picture SMS
Ability to define group of destination numbers so that messages can be sent in bulk easily.
Easily Integtrate With Any Database Like (Access,Oracle SQL Server etc) Complete sending and receving sms history
 
U can download from
http://www.mediafire.com/?hadyonq2vhhanw3
 
if u need any help please email me zahid.mahmood2013@gmail.com
QuestionSMS from MS AccessmemberBerti Vogs29 Jun '12 - 0:34 
It was very useful, thank you. I would like to share another SMS solution that makes it possible to send SMS from MS Access.ozekisms.com/index.php?owpn=472
I made the configurations easily.
 
I will try this way as well.
 
Bye, Berti
NewsMobile Marketing agencymemberSara Williams3 Mar '11 - 1:13 
TxtImpact has announced the launch of Mobile site builder an Add-on application integrated with mobile marketing campaigns.TxtImpact MobileSite Builder lets companies create branded mobile websites and Integrate Mobile web in your Text mobile marketing campaigns for richer user experience.http://www.txtimpact.com[^]
QuestionCan you supply the source code for this project?memberMember 400813110 Jan '09 - 12:18 
Dear Adam,
 
I am looking for a solution for my project. It requires of me to send surveys from my cell phone to the PC database using GSM/SMS. I read your article and tried to understand how to implement it. I followed your steps by was unsuccessfull. Can you build such application for me? I am willing to pay for your services.
 
To be clear what I need, I would like to described it in a few words below:
 
Steps:
1. Send data from Cell Phone to PC (server with dedicated IP)
2. PC (server with dedicated PC) analyses data and stores it into the Database
3. PC sends a response of a successfull transmission of the survey to a cell phone.
 
It could be as simple as asking a few questions in one survey and storing it. All I need is to demonstrate that this could be accomplished. You can program in any language you wish (C++, .NET, JAVA etc)
 
Thank you for your response in advance.
 
Regards,
Vitaly
QuestionHow can creat a Virtual Com portmemberMember 26646231 Mar '08 - 8:06 
Dear please explain me how can i create a Virtual Com Port. windows xp
"you must install a driver that creates a virtual COM port - you can find the virtual COM port using Windows Device Manager/Modems setup."

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web04 | 2.6.130523.1 | Last Updated 17 Oct 2007
Article Copyright 2007 by Adam Page
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid