Database update via winsock control

Posted on 2006-05-17
Last Modified: 2013-11-13

I am using the winsock control to connect a PDA to an Access database.  This works by :-

The PDA sending the SQL command to the Winsock Server
The Winsock server then processes the command
The Winsock server then returns the records back to the PDA.  

This process is working fine.

However I now need the ability to perform such functions as record set UPDATE / ADD NEW etc.

Does anyone have any ideas on how to accomplish this???

Example of sending the Records to the Client

    Dim buff As String
    Dim x As Integer
    Dim iRecords As Long
    Dim iFields As Integer
    While Not Rs.EOF
        iFields = Rs.Fields.Count
        For x = 0 To Rs.Fields.Count - 2
            buff = buff & Rs.Fields(x).Value & "|"
        Next x
        buff = buff & Rs.Fields(x).Value & "|"
        iRecords = iRecords + 1
    Set Rs = Nothing
    buff = buff & "~"
    Sbuff = "DATAOK" & Format(iRecords, "000000") & "," & Format(iFields, "0000") & "," & buff & "~"
Question by:samstarkey
    LVL 11

    Accepted Solution

    When the winsock server sends the records to the PDA,  include the record ID (Primary Key). The PDA could then send an update SQL statement for the winsock server to process.

    "UPDATE MyTable SET Field1 = 'Hello', Field2 = 'World' WHERE ID = 1"

    The problem you'll run into is record locking with more than one user. Will user1 change the same record before user2, if so user2's changes will overwrite.
    LVL 2

    Author Comment

    Thanks TreyH,

    Didn't do my research very well.  Standard SQL statements...  I generally work by DAO and record sets so rarely dulge into core SQL

    Thanks anyway, pointed me in the dircetion i needed

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
    This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
    This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
    This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now