Results 1 to 4 of 4

Thread: Received Data from Serial Port and convert into parts and store in Access database

  1. #1

    Thread Starter
    Registered User
    Join Date
    Apr 2016
    Posts
    2

    Unhappy Received Data from Serial Port and convert into parts and store in Access database

    i am creating application receiving data from serial port in the following format :

    2201m2226m23697dcccc6dddd5gggg5

    i want to split this data in parts like

    2201m
    2226m
    23697d
    cccc6dd
    dddd5g
    gggg5

    and save these data in Access database tabel in different field

    kindly guide us i am new to VB.Net

  2. #2
    Lively Member hb21l6's Avatar
    Join Date
    Sep 2008
    Location
    UK - East Yorkshire
    Posts
    126

    Re: Received Data from Serial Port and convert into parts and store in Access databa

    hi,

    if you know each variable length you need from the string, you will need to break it down with substring.

    Code:
    Dim myval as string = "2201m2226m23697dcccc6dddd5gggg5"
    Dim substring1 As String = myval.Substring(0, 5) ' first five
    Dim substring2 As String = myval.Substring(5, 5) ' second five
    Dim substring2 As String = myval.Substring(10, 6) ' third six
    etc


    There are plenty of examples of how to write data to a database on this forum.

    Dave

  3. #3

    Thread Starter
    Registered User
    Join Date
    Apr 2016
    Posts
    2

    Re: Received Data from Serial Port and convert into parts and store in Access databa

    Hi Dave
    can you share the link for example

  4. #4
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,543

    Re: Received Data from Serial Port and convert into parts and store in Access databa

    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width