Results 1 to 4 of 4

Thread: [RESOLVED] Extremely quick question: My.settings | How do I use data stored on a variable.

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2015
    Posts
    6

    Resolved [RESOLVED] Extremely quick question: My.settings | How do I use data stored on a variable.

    Hello all,

    I have been experimenting with my.settings I love the idea mechanic but am unsure how to implement it.

    My attempts are trying to get a database path in my.settings.DBpath that I have stored and able to change but I want to be able to get it to load into a variable so that I can actually use it fully.

    This is extremely simple of a request but I been looking through the various sub parameters for something like text or data or content and cannot find anything that functions like how a textbox would. When I try i get this error : ArgumentException was unhandled

    Format of the intialization string does not conform to specification starting at index 35.

  2. #2
    Hyperactive Member
    Join Date
    Mar 2012
    Posts
    311

    Re: Extremely quick question: My.settings | How do I use data stored on a variable.

    That error message doesn't really mean much to us because you didn't post any code, esp. around the line where this error occurs.

    Using Settings is pretty easy, and doesn't take much to get at their values. Assuming you have the DBPath as a String Setting:
    Code:
    Dim strDBPath As String = My.Settings.DBPath
    If IO.File.Exists(DBPath) Then
        ' Open connection to DB
    Else
        ' Alert user that it cannot find DB
    End If

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2015
    Posts
    6

    Re: Extremely quick question: My.settings | How do I use data stored on a variable.

    Thank you pyth007, I was more asking for a quite tutorial as to how to use it then actual code being provided as I find asking for a concept of how to use the mechanic is more useful in this case. Thank you very much, another question I have about this method is since it allows for permanent saving of values does it survive from user to user on a windows system or does it keep separate instances for each user? just curious as sometimes it will load changed value other times not but maybe down to my cleaning programs I have installed.

  4. #4
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Extremely quick question: My.settings | How do I use data stored on a variable.

    It depends. If it is user-scoped then each user gets their own value stored in their own user config file in their machine. If it is application-scoped, then it's read-only anyways and hte user isn't going to be able to change it (unless you use a means to directly open config file and manage it yourself... I suspect though that this isn't a case like that.)

    -tg
    * 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??? *

Tags for this Thread

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