Send and receive SMS in Visual FoxPro
|Video:||Send SMS from Visual FoxPro (part 1/2, configure your modem)|
|Video:||Send SMS from Visual FoxPro (part 2/2, configure your system)|
Fields of application
Visual FoxPro is a data centric and object oriented database
that can be used to maintain a well-structured corporate IT system. Now there
is a great possibility to increase the features of Visual FoxPro to be more
If you wish to further improve your Visual FoxPro database you can add SMS functionality to it. SMS technology makes it possible to improve corporate communication in a large extent. If you add SMS functionality to your database then you ensure that all the important changes will be forwarded to the intended people. Dealing with huge amount of data is important in companies as there are constant changes in their databases. With Ozeki's solution, information about these changes can be easily and very rapidly forwarded to the intended people.
To achieve this SMS functionality you need to install an SMS gateway on your computer such as Ozeki NG SMS Gateway. This software product is able to meet with all the requirements of companies because it is a stable and well-functioning software with high capacity. In this way you can send SMS messages from your corporate IT system to the mobile phones of the intended people. The benefits can be immediately noticed. With this solution your colleagues, employees but even your customers or business partners can be informed in a practical way. You can send short but important information to these people and it is quite sure that they will receive your message immediately. Therefore the communication of your company is highly improved both within and outside of the company.
In order to setup this solution you need to find a way
to connect your system to the mobile network. You can do this
by using an Internet connection or you can
setup a wireless connection by attaching a GSM phone/GSM modem to your computer. To help you make a
decision, we have prepared a webpage for you:
Internet based SMS connections vs. GSM modem based (wireless) SMS connections.
on what you select, you need the following prerequisites.
Prerequisites for Internet based connection to the Mobile network
If you wish to connect your system to an SMS service provider over the Internet you need the following components:
Figure 1/a - Prerequisites for Ozeki NG SMS Gateway IP SMS connection
In this case you need to find an SMS service
provider who can reach the mobile phones in your area. This SMS
service provider should be able to provide SMS service through
the Internet. To find such a provider, you can check our
website where we list some of them:
SMPP SMS Service providers.
Once you have found such a provider, you need to sign up for
their service to get the connection parameters. You can use these parameters
to configure your Ozeki NG SMS Gateway software.
Prerequisites for wireless (GSM modem) connection to the Mobile network
If you wish to connect your system to the mobile network wirelessly, you need a GSM modem or GSM phone, that you can attach to your computer with a data cable. In this case your Ozeki NG SMS Gateway software will operate this phone and will send and receive SMS messages wirelessly. To setup this connection method, you need the following components:
Figure 1/b - Prerequisites for Ozeki NG SMS Gateway GSM modem connectionYour checklist (for GSM modem connection):
|SIM Card - You can get this from your local mobile network operator.*|
|Modem - Use a Wavecom, Siemens or Multitech modem.|
|Data cable - Comes with the modem|
|Computer - Recommended: Intel P4 3Ghz, 2GB RAM, 500Mb HDD, Windows OS|
|Ozeki NG SMS Gateway - Download it from http://www.sms-integration.com|
*The SIM card will come with a plan, that will determine how much money you will spend on each SMS.
|Ozeki NG SMS Gateway can be obtained by |
opening the download page:
Download Ozeki NG SMS Gateway!
After you make sure you meet the requirements above, you can start to build your SMS system. It will work as follows: In case of incoming messages, Ozeki NG SMS Gateway inserts the message into Visual FoxPro by an SQL INSERT statement and you can read your incoming message. If you wish to send messages from FoxPro then Ozeki NG SMS Gateway polls the message out from the database by an SQL SELECT statement, processes it and finally sends out to mobile phones. Figure 2 demonstrates this process.
Figure 2 - Ozeki NG SMS Gateway - solution for SMS sending in Visual FoxPro
Ozeki NG SMS Gateway forwards messages to the mobile network either with the help of a GSM modem attached to your PC with a data cable or it connects directly to the SMS center of the mobile service provider over the Internet. Please note that GSM modem connection is highly recommended as it is more secure than IP SMS connectivity.
How to configure this solution
To send and receive SMS in Visual FoxPro you need to make some simple configuration in Ozeki NG SMS Gateway. To apply this solution properly please follow the steps of our configuration guide and watch this video tutorial as well.
|Video:||Send SMS in Visual FoxPro (configure your system)|
First you need to create a new database and then two database tables for incoming and outgoing messages: "ozekimessagein" and "ozekimessageout". To create these tables start Visual FoxPro at "All programs" in "Start" menu (Figure 3).
Figure 3 - Start Visual FoxPro
Then click on "New" menu item in "File" menu (Figure 4)
Figure 4 - Select New
Select "Database" option and "New file" button (Figure 5).
Figure 5 - New database
Define a location where you wish to save the created database. In our example it is "ozeki_visual_foxpro_db" folder in C drive (Figure 6).
Figure 6 - Select a folder for the database
Provide a name for the database (in our example it is "ozeki") and click on "Save" (Figure 7).
Figure 7 - Provide a name for the database
Expand the command window and clear its content (Figure 8)
Figure 8 - Cleared command window
Then paste these table definitions into the command window
CREATE TABLE ozekimessagein;
Figure 9 - Pasted table definitions
Now select all the definitions and right click on them and select "Execute Selection" option (Figure 10).
Figure 10 - Execute table definitions
If it is done, close the command window the created database tables will appear in the database (Figure 11).
Figure 11 - Created tables
The configuration of the database is finished, now you can start to configure Ozeki NG SMS Gateway. First log into Ozeki NG SMS Gateway with your username and password. Then click on "Add new user or application" (Figure 12).
Figure 12 - Add new user
Select "Database user" and click on "Install" next to it (Figure 13).
Figure 13 - Install database user
Provide a name for this user. In our example it is "visual_foxpro" (Figure 14).
Figure 14 - Provide a name
In "Database connection" tab provide the connection string and
click on "OK" (Figure 15).
Provider=VFPOLEDB.1;Data Source=PathToYourDatabase;Mode=ReadWrite;Password="";Collating Sequence=MACHINE
Figure 15 - Connection string for the user
Now click on "SQL for sending" tab and modify the SQL update
statements. To do so, you need to delete the apostrophes after "WHERE id=" part
in the update statements. First go to "Sending" tab and modify the "UPDATE"
statement in a way that the final statement should look like this (Figure 16):
UPDATE ozekimessageout SET status='sending' WHERE id=$id
Figure 16 - SQL statement for sending
Then you need to modify other update statements as well. The
statement in "Sent" tab is (Figure 17):
UPDATE ozekimessageout SET status='sent', senttime='$senttime' WHERE id=$id
Figure 17 - SQL statement for sent
The statement in "Not sent" tab is (Figure 18):
UPDATE ozekimessageout SET status='notsent' WHERE id=$id
Figure 18 - SQL statement for not sent
The statement in "Delivered" tab is (Figure 19):
UPDATE ozekimessageout SET status='delivered' WHERE id=$id
Figure 19 - SQL statement for delivered
The SQL statement in "Undelivered" tab is (Figure 20)
UPDATE ozekimessageout SET status='undelivered' WHERE id=$id
Figure 20 - SQL statement for undelivered
In order to demonstrate this process in a better way I enable "Log SQL SELECT statements" and "Log SQL UPDATE statements" (Figure 21).
Figure 21 - Logging
To test the system click on "SQL Prompt" menu item and select the following statement from the dropdown menu: "INSERT INTO ozekimessageout (receiver,msg,status) VALUES ('+36205460691' , 'Hello World' , 'send');" Then click on "Execute" (Figure 22). This SQL statement will insert a row into "ozekimessageout" table which will be sent out by Ozeki NG SMS Gateway as an SMS message.
Figure 22 - Create an outgoing message
If you inserted the outgoing message into "ozekimessageout" table, after a short period of time you can see in the "Events" of the created database user that the outgoing message has been found and updated by Ozeki NG SMS Gateway and finally it has been sent as an SMS message (Figure 23).
Figure 23 - Found outgoing message
The sent message can be seen in the "Outbox" of the created database user (Figure 24).
Figure 24 - Sent message of database user
For demonstrating incoming messages I will simulate an incoming message over SMPP connection (Figure 25).
Figure 25 - Received message
By clicking on the "Events" of the created database user it can be seen that the incoming message has been inserted into "ozekimessagein" table (Figure 26).
Figure 26 - Inserted message
To see the incoming message click on "SQL Prompt" menu item and select "SELECT*FROM ozekimessagein" statement and click on "Execute" (Figure 27).
Figure 27 - Select fields from ozekimessagein
As a result the received message can be seen (Figure 28).
Figure 28 - Received message
Visual FoxPro with Ozeki NG SMS Gateway is the best solution if you wish to implement an efficient SMS system in your corporate IT network. Ozeki's solution makes it possible to send important data and information from Visual FoxPro to multiple mobile phones if it is required. With this solution you will gain a stable, well-functioning and secure SMS system that is easy to work with and save valuable time and money.
- If you have not downloaded Ozeki NG SMS Gateway yet, you can do it right now on the product page.
- To learn more about the possible network connections, read GSM modem vs IP SMS connection page.
- Please find how to benefit from implementing SMS solutions in your business on SMS solutions for businesses page
- Feature list of Ozeki NG SMS Gateway
- User Guide for Ozeki NG SMS Gateway
- Product manual
Request more information
If you are interested in this solution, let us know, so we can send you more relevant information and quotation with prices. Please fill in the following form: