Results 1 to 4 of 4

Thread: db???

  1. #1
    cool_rockz
    Guest

    db???

    need help plzzzzzzzzzzzzzzzz

    I am reading a string of data eg. speed, time, range etc. and want to store them in a table form (database) and update the data base after the next reading.

    I would then save the file to disk (floppy etc) giving it a unique filename.When the file is opened ( in any machine) the data in the table should be present.

    Where should I save my database...can I use access for this and will I need to save access document to disk in order to view my file in any other machine. (ill me making this an exe program)

    can I use savesetting and getsetting through windows registry to save database???

    how can I code this?
    please also direct me to web sites which could help me undrstand save to disk commands.

    plezzzz help

  2. #2
    DaoK
    Guest
    I want to know why you are using a string to put all these variable?

    And how do you do to read only one part of the string after?

    (I know that a newby question but I want to know more about String variable)

  3. #3
    cool_rockz
    Guest

    Cool string....

    actually Iam reading strings from the comm port (ie from an external device using serial port).So I can read a byte at a time and do calulation on them.
    I u hav a long sting and u only want to read certain piece from it then...read help on string...

    heres a few on wat u want...·
    SelLength — returns or sets the number of characters selected.
    · SelStart — returns or sets the starting point of text selected; indicates the position of the insertion point if no text is selected.
    · SelText — returns or sets the string containing the currently selected text; consists of a zero-length string ("") if no characters are selected.

    These properties aren't available at design time.

    Syntax

    object.SelLength [= number]
    object.SelStart [= index]
    object.SelText [= value]

    eg...
    Private Sub Form_Load ()
    Text1.Text = "Two of the peak human experiences"
    Text1.Text = Text1.Text & " are good food and classical music."
    End Sub
    Private Sub Form_Click ()
    Dim Search, Where ' Declare variables.
    ' Get search string from user.
    Search = InputBox("Enter text to be found:")
    Where = InStr(Text1.Text, Search) ' Find string in text.
    If Where Then ' If found,
    Text1.SelStart = Where - 1 ' set selection start and
    Text1.SelLength = Len(Search) ' set selection length.

    Else
    MsgBox "String not found." ' Notify user.
    End If
    End Sub


    ......
    chaooooo..


  4. #4
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    cool_rockz, unless there is a specific need for a database (eg. other people need access at the same time etc.), then just use normal file I/O. For example :

    Code:
    Open "c:\myLog.log" For Output As #1
        Print #1, "--------"
        Print #1, "Something : " & vbTab & someValue
        Print #1, someOtherValue
    Close #1
    And if you're going to be doing a lot of outputting and reading to the file in each session, I would suggest storing the file on the HDD somewhere. Putting the file into the temp folder would probably be best (Use the GetTempPath API).

    Though you can stick it anywhere.

    Then you'd copy the file onto the floppy when you're done.
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

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