Send GPS data to database

Hi Experts,

I am developing an application that displays the mobile user’s latitude/longitude, speed and direction; but I need to go a few steps further.  I need to find a way to send the latitude, latitude and the unit’s ID to a database.  I need the push to occur every 15-30 seconds “or” 1/8th of a mile, whichever occurs first.  What is the best way to make this happen?  I am new to VB and everything thus far is self taught, with some help from experts such as you.  Please be specific in your answers and I ask for your patience with me if I do not understand everything.

I am developing with Visual Studio 2005, language VB.
NCSOAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

WilliamFrantzCommented:
What is your target device?  A Windows Mobile cell phone?

Generally speaking, you won't be able to do what you envision.  Nearly all phones prohibit access to location information.  Furthermore, most phones do not have a full-fledged GPS receiver in them.  They have half a GPS receiver.  The other half is in some central office of the carrier (Verizon, Cingular, etc.).  Your phone just picks up the GPS signals and sends raw data over the network to the carrier who crunches the numbers to determine your location.  This is "Assisted GPS".

There is probably not enough raw data on the device itself to get a fix without the cooperation of the carrier.

You'll probably have to build your own device using a GPS receiver and a cell phone.  A good choice would be a Pocket PC phone and a Bluetooth GPS receiver.  You could then write some custom software for the phone to accomplish what you want.

Keep in mind that most devices don't have enough battery life to report a fix every 15 seconds.  They will go dead in less than a day.
0
WilliamFrantzCommented:
Here's a Garmin Bluetooth receiver:
http://www.garmin.com/products/gps10/

The PPC 6700 is an EVDO, Bluetooth phone that would be a good choice for this project:
http://www.microsoft.com/windowsmobile/articles/ppc6700.mspx

You could alternatively use a laptop with a data card like this:
http://www.novatelwireless.com/products/merlin/merlin-s620.html

0
NCSOAuthor Commented:
Thanks for your responses.  I apologize for not being more clear of the current configuration.  All the clients (laptop users) have a GPS antenna and receiver in the cars; and the current application displays the vehicles latitude, longitude and speed.  I need to be able to capture this data every 1/8th of a mile or every 30 seconds, whichever occurs first and store this GPS data in a SQL database table.  This process is required for us to complete an AVL (Automatic Vehicle Location) project here at the Sheriff's Office.  Thanks for you assistance.
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

WilliamFrantzCommented:
So you don't need to transmit the location data over-the-air?  You just need to keep a log in a local SQL database on the laptop?

What you need is some custom software for your laptops that grabs GPS data from the serial port(?) and plops it into a database.  Such an application wouldn't be difficult to write.  I see that you already have Visual Basic.

Here's an article about SQL access from Visual Basic:

http://www.adit.co.uk/html/sqlforaccess2.html

Here's a VB example for reading GPS data from an NMEA device:

http://www.developerfusion.co.uk/show/4634/


0
NCSOAuthor Commented:
PAQ refund please, I have developed the methodology necessary to accomplish my project needs.  My specific question was how to store the data stream to a database.
0
VenabiliCommented:
Sure. Post your solution and you get your points back - this is how EE works.
Because the solution above will work :) And unless you post another one, there is no reason not to give points
0
NCSOAuthor Commented:
Per your request!
       
Dim conn As New System.Data.SqlClient.SqlConnection("Connection String Goes Here")
        Dim da As New System.Data.SqlClient.SqlDataAdapter("Select * from [table name]", conn)
        Dim ds As New System.Data.DataSet
        Dim cmd As New SqlCommand("insert into [table name](Latitude,Longitude,speedmph,fixstatus,unitid,username)values(@latitude,@longitude,@speedmph,@fixstatus,@unitid,@username)", conn)

        Try
            conn.Open()
            cmd.Parameters.Add(New SqlParameter("@longitude", SqlDbType.NVarChar = 12)).Value = Longitude.Text
            cmd.Parameters.Add(New SqlParameter("@latitude", SqlDbType.NVarChar = 12)).Value = Latitude.Text
            cmd.Parameters.Add(New SqlParameter("@speedmph", SqlDbType.NVarChar = 12)).Value = SpeedMPH.Text
            cmd.Parameters.Add(New SqlParameter("@fixstatus", SqlDbType.NVarChar = 12)).Value = FixStatus.Text
            cmd.Parameters.Add(New SqlParameter("@unitid", SqlDbType.NVarChar = 12)).Value = UnitID.Text
            cmd.Parameters.Add(New SqlParameter("@username", SqlDbType.NVarChar = 12)).Value = UserName.Text
            cmd.ExecuteNonQuery()
        Catch ex As Exception
            MessageBox.Show(ex.Message)
        Finally
            conn.Close()
        End Try
0
GranModCommented:
PAQed with points refunded (500)

GranMod
Community Support Moderator
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
GIS/GPS Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.