• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 232
  • Last Modified:

Database update via winsock control


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 & "~"
1 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.
samstarkeyAuthor Commented:
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
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.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now