Results 1 to 37 of 37

Thread: DataBase Password/Connection Problem

  1. #1

    Thread Starter
    Addicted Member Codehammer's Avatar
    Join Date
    Aug 2004
    Posts
    164

    DataBase Password/Connection Problem

    Hi,

    This Used the Disconnected Model:

    I Have Asked Before And Still Cant Get it To Work as I Keep Getting it Underlined, Maybe a option Explicit or Strict Error. Here is a Example of how I Make My connection and Using the First, Next, Etc.

    Will Someone please Make a password for the Database called Password and Configure the Connection so it will Work. It Usually asks for Username and Password when I Only Put In A Database Password.

    Helping with the Find Button Will be A BONUS.
    The Database is in the bin Folder. Place The Zip in The C:\ And Unzip.
    Attached Files Attached Files
    Curiosity SKILLED the cat
    Google Talk from your Mobile phone

    Chat from your mobile or get an emulator like J2ME Wireless Toolkit 2.2

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    You're not going to get much help this way...

  3. #3

    Thread Starter
    Addicted Member Codehammer's Avatar
    Join Date
    Aug 2004
    Posts
    164

    Why Not

    Guys, I Had Another Thread and no ones Suggestion Worked. So I Make A DB and you guys say ya wont help. What Gives Man!
    Curiosity SKILLED the cat
    Google Talk from your Mobile phone

    Chat from your mobile or get an emulator like J2ME Wireless Toolkit 2.2

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Where's the older thread? Post a link to it.

  5. #5

    Thread Starter
    Addicted Member Codehammer's Avatar
    Join Date
    Aug 2004
    Posts
    164

    Just for you!

    It took 20 Min on my SUPER-FAST, 56K modem to get you this:

    http://vbforums.com/showthread.php?threadid=302933.


    I Also had to browse 10 pages of this SLOW Site and its Not Like I Can Visit here Every Damn 5 minutes Like some Guys can. Now days Later I'm Still Nowhere.
    Curiosity SKILLED the cat
    Google Talk from your Mobile phone

    Chat from your mobile or get an emulator like J2ME Wireless Toolkit 2.2

  6. #6
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

  7. #7
    Hyperactive Member CyberHawke's Avatar
    Join Date
    May 2004
    Location
    Washington DC
    Posts
    477
    How exactly do you want the password to work?
    do you want to use a database password or do you want to have a user/password configuration?

    btw mendhak, smoking seems to have given you a third eye, lets see what a little radiation will do
    Whadayamean it doesn't work....
    It works fine on my machine!

  8. #8

    Thread Starter
    Addicted Member Codehammer's Avatar
    Join Date
    Aug 2004
    Posts
    164

    Password

    If one Puts in a Password in the Access by clicking Tools, Security, set database password, Then Only a Password, not a Username is required to unlock the Db when you open Access.

    So I wanna Configure the Application so that It will only be Able to Access the database, no one using access not knowing the password can. Only the Program/Application Can.

    But if you setup a password in access and try connecting to the Db and type the correct password DB Vb.net shi*s itself. It wants a username and password. Blank username or Admin Username Does NOR WORK

    So thats why I with My superfast one channel 56k modem came here only to be sent around providing original Threads and beating around the bush by guys I think Know what I Want.


    Comeon Guys, I Even Sent a database in the Bin Folder with an Application.

    What
    More
    do
    you
    Want?
    Curiosity SKILLED the cat
    Google Talk from your Mobile phone

    Chat from your mobile or get an emulator like J2ME Wireless Toolkit 2.2

  9. #9
    Hyperactive Member CyberHawke's Avatar
    Join Date
    May 2004
    Location
    Washington DC
    Posts
    477

    Red face

    to say that you are downright rude would be an understatement.
    the programmers that "Donate" their time to help others shouldn't expect to be harrassed by the helpee. I've helped many other people in these forums, and I know that mendhak has as well.

    as for your description of your problem, I gave you code that shows EXACTLY how to open a database that is password protected. I know that it works (in vb.net) because I use it every day.

    I am returning your project to you recoded with the password protection in place and in working order.

    A simple thank you will suffice.
    Attached Files Attached Files
    Whadayamean it doesn't work....
    It works fine on my machine!

  10. #10
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Password

    Originally posted by Codehammer


    What
    More
    do
    you
    Want?
    You, On my Ignore List maybe?

    This is a public forum, so don't expect anything from anyone.

    Goodbye.

  11. #11

    Thread Starter
    Addicted Member Codehammer's Avatar
    Join Date
    Aug 2004
    Posts
    164

    Thumbs up Rude?

    Mendhak was the Guy I was Referring to all the Way, He left me with this one week. there in America everyone Got Good Connection, Here Im using 56k to Whereever this Forum is, And then all the "Help" I get by mendhak was Touring this Forum. I Click the Link of the Page, have Coffee and come back, the page has some error and Did not Load. Thats What I Have to Deal With man.

    I was mad , some guy you Dont Know Sending you Around. Thats what I Thought at the Time.

    Anyways I AM Sorry to both Mendhak and with CybeHAwke.
    The Amount of Times you must Have had to deal with the same Question again & again must make you annoyed and not want vague Questions.

    You Guys Like own the Place with the Amount of posts and Stuff Everywhere and I Will someday need your Help And Expertise. Probably sooner than I Think.

    THANKS to Both *Mendhak and with CybeHAwke* for Trying.
    Curiosity SKILLED the cat
    Google Talk from your Mobile phone

    Chat from your mobile or get an emulator like J2ME Wireless Toolkit 2.2

  12. #12

    Thread Starter
    Addicted Member Codehammer's Avatar
    Join Date
    Aug 2004
    Posts
    164

    How'd ya do it man

    When you setup the password in access, you clicked tools, Security, Database password.

    I Did that Too, Then in VB you Chose configure Dataadapter, then the path of the DB, then it should have asked for the Password.

    You Typed password and changed nothing else, or did you have admin as the Username??

    I just cant get it Still to word, the Line in the dataadapter works if I Copy it Though.

    Did you type that like out instead of using the Wizard to do the DB?

    Thanks again.
    Curiosity SKILLED the cat
    Google Talk from your Mobile phone

    Chat from your mobile or get an emulator like J2ME Wireless Toolkit 2.2

  13. #13
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    OK, I can understand the frustration of a 56K...

    Maybe I reacted a bit too.

    I'll play grandpa and try to say something here: this is a p2p forum, a lot of people here are usually busy with their own projects, so the best that you'll usually get is hints and guidance. For example, I may have not been answering your threads for quite some time. I was busy in between. See, money makes the world go round

    If you're lacking on your part with the Internet speeds, get yourself the MSDN CDs, install it, and buy yourself a couple books too. This will reduce any dependencies you have on the Internet as your source, but not eliminate it.

    And keep practicing!


  14. #14

    Thread Starter
    Addicted Member Codehammer's Avatar
    Join Date
    Aug 2004
    Posts
    164

    Searchin'

    Me Again, part of my program has a search Feature, Done Something like this;

    Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearch.Click
    'this assumes textbox1 is where the name is to search for
    Dim filter As String = String.Format("Name Like '{0}*'", TextBox1.Text)
    DataSet11.Tables("Bankruptcy").DefaultView.RowFilter = filter
    End Sub

    On my form the datatable/datagrid does update Showing the Correct Results, my plan is to show the results in a textbox. You Cannot refer to the dataset as this will return all results even though the datagrid/datatable has the search results.

    Curiosity SKILLED the cat
    Google Talk from your Mobile phone

    Chat from your mobile or get an emulator like J2ME Wireless Toolkit 2.2

  15. #15

    Thread Starter
    Addicted Member Codehammer's Avatar
    Join Date
    Aug 2004
    Posts
    164

    Actual Plan

    Plan Was to make the database+Application in such a way that where ever the application and database is, (any directory - does not matter) it must connect.

    This Means application.path, but the Squigly Line comes up if you type this.
    Curiosity SKILLED the cat
    Google Talk from your Mobile phone

    Chat from your mobile or get an emulator like J2ME Wireless Toolkit 2.2

  16. #16
    Hyperactive Member CyberHawke's Avatar
    Join Date
    May 2004
    Location
    Washington DC
    Posts
    477

    Re: How'd ya do it man

    Originally posted by Codehammer
    When you setup the password in access, you clicked tools, Security, Database password.

    I Did that Too, Then in VB you Chose configure Dataadapter, then the path of the DB, then it should have asked for the Password.

    You Typed password and changed nothing else, or did you have admin as the Username??

    I just cant get it Still to word, the Line in the dataadapter works if I Copy it Though.

    Did you type that like out instead of using the Wizard to do the DB?

    Thanks again.
    I took the code that you had generated using the wizard and edited it. I took out the user name, and set the password to the one that I set in access.
    Whadayamean it doesn't work....
    It works fine on my machine!

  17. #17
    Hyperactive Member CyberHawke's Avatar
    Join Date
    May 2004
    Location
    Washington DC
    Posts
    477

    Re: Actual Plan

    Originally posted by Codehammer
    Plan Was to make the database+Application in such a way that where ever the application and database is, (any directory - does not matter) it must connect.

    This Means application.path, but the Squigly Line comes up if you type this.
    application.path does not exist in VB.NET, use this to access your programs working path:
    VB Code:
    1. System.AppDomain.CurrentDomain.BaseDirectory()
    Whadayamean it doesn't work....
    It works fine on my machine!

  18. #18

    Thread Starter
    Addicted Member Codehammer's Avatar
    Join Date
    Aug 2004
    Posts
    164

    Whadayamean it doesn't work....

    I Wrote this to Test:
    Text = Application.StartupPath

    It Works Fine On my Machine

    Why do some people write me.text instead of what I Do: Text = ...

    Does using me. maybe use less Memory???

    Another Thing . . .. .Sorry to Bug

    In My Parent Form I Use a Connection to the database too, I Read in one of the Forums that If you make it Public then Only one Connection.

    So by using the Wizard(same as Example Attachment) set the Property from Friend to Public and that Should do it Right?

    But No, it Seems Every Kid/Child needs their own Connection.
    My Question:How Does one Use it Globally, as Public does not recognize it.

    I have a Similar Question About Enable/Disable menus on the Parent from the Child. Should I start a new thread?

    Thanks Again
    Curiosity SKILLED the cat
    Google Talk from your Mobile phone

    Chat from your mobile or get an emulator like J2ME Wireless Toolkit 2.2

  19. #19
    Hyperactive Member CyberHawke's Avatar
    Join Date
    May 2004
    Location
    Washington DC
    Posts
    477
    The use of "Me" fully qualifies what it is you are affecting the property of. Nearly every gui object in .NET has a Text property. By using Me.Text, you are explicitly stating that the Text property of the form is getting read or is being set, no question about it.

    Yes, if you are going to ask a question about another topic, you should bring it up in a new thread so that people can find it if they are running a search on that topic.
    Whadayamean it doesn't work....
    It works fine on my machine!

  20. #20
    Hyperactive Member CyberHawke's Avatar
    Join Date
    May 2004
    Location
    Washington DC
    Posts
    477

    Re: Whadayamean it doesn't work....

    Originally posted by Codehammer
    I Wrote this to Test:
    Text = Application.StartupPath

    It Works Fine On my Machine
    application.path and Application.StartupPath are two very different things.

    Yes, Application.StartupPath will get you to the same directory as the code I posted, but application.path does not exist in VB.NET.

    As a programmer, I am very literal about specific statements, and I try not to leave anything open to guesswork or interpretation, though I am not always successful at it.
    Whadayamean it doesn't work....
    It works fine on my machine!

  21. #21

    Thread Starter
    Addicted Member Codehammer's Avatar
    Join Date
    Aug 2004
    Posts
    164

    Right?

    But me does not only refer to the form Containing controls, like your post 5 min Ago with the transparent

    Originally posted by CyberHawke
    The use of "Me" fully qualifies what it is you are affecting the property of. Nearly every gui object in .NET has a Text property. By using Me.Text, you are explicitly stating that the Text property of the form is getting read or is being set, no question about it.
    Curiosity SKILLED the cat
    Google Talk from your Mobile phone

    Chat from your mobile or get an emulator like J2ME Wireless Toolkit 2.2

  22. #22
    Hyperactive Member CyberHawke's Avatar
    Join Date
    May 2004
    Location
    Washington DC
    Posts
    477
    "Me" refers to a Class, be that a form, code class, user control, whatever the current container is.
    Whadayamean it doesn't work....
    It works fine on my machine!

  23. #23

    Thread Starter
    Addicted Member Codehammer's Avatar
    Join Date
    Aug 2004
    Posts
    164

    Thumbs up Trial & only Errors

    I Did as You said Hawk, Then I Thought maybe its cause its a Different Applciation, so I Took the original Attachemnt and Tried to add the One Line.

    I Added it to the Thing called Connection, Did Not Work, Then on the Adapter only, no.

    Check the Attachment if I Edit the Yellow Conenction Think(oledbconnection1 by default)

    what did I miss Out.
    Attached Images Attached Images  
    Curiosity SKILLED the cat
    Google Talk from your Mobile phone

    Chat from your mobile or get an emulator like J2ME Wireless Toolkit 2.2

  24. #24
    Hyperactive Member CyberHawke's Avatar
    Join Date
    May 2004
    Location
    Washington DC
    Posts
    477
    Send me the project again, it's the only way I can look at what you changed.

    But this password thing is very easy, I think you are making it harder than it is.
    Whadayamean it doesn't work....
    It works fine on my machine!

  25. #25

    Thread Starter
    Addicted Member Codehammer's Avatar
    Join Date
    Aug 2004
    Posts
    164

    Its at the Top of the Page

    The Attachment is at the Top of the Page.

    I Am using visual basic.net 2003

    The Picture attachment shows what I Edit
    Curiosity SKILLED the cat
    Google Talk from your Mobile phone

    Chat from your mobile or get an emulator like J2ME Wireless Toolkit 2.2

  26. #26
    Hyperactive Member CyberHawke's Avatar
    Join Date
    May 2004
    Location
    Washington DC
    Posts
    477
    OK, so what is 'MemoryObject'?
    Whadayamean it doesn't work....
    It works fine on my machine!

  27. #27

    Thread Starter
    Addicted Member Codehammer's Avatar
    Join Date
    Aug 2004
    Posts
    164

    Forgot attachment

    Here it is
    Attached Images Attached Images  
    Curiosity SKILLED the cat
    Google Talk from your Mobile phone

    Chat from your mobile or get an emulator like J2ME Wireless Toolkit 2.2

  28. #28
    Hyperactive Member CyberHawke's Avatar
    Join Date
    May 2004
    Location
    Washington DC
    Posts
    477
    Did you edit the connection string?
    Whadayamean it doesn't work....
    It works fine on my machine!

  29. #29

    Thread Starter
    Addicted Member Codehammer's Avatar
    Join Date
    Aug 2004
    Posts
    164

    Found Error

    Hi,

    Sorry MAN the Error was I Renamed the Operating folder to passwordmeN to Distinguish it from the other one In the Same Directory.

    I Will Try out the Stoff on my Main DB Tonight, Should work.
    Curiosity SKILLED the cat
    Google Talk from your Mobile phone

    Chat from your mobile or get an emulator like J2ME Wireless Toolkit 2.2

  30. #30

    Thread Starter
    Addicted Member Codehammer's Avatar
    Join Date
    Aug 2004
    Posts
    164

    Thanks RESOLVED 90%

    Thanks for the Help Guys,
    The Connetion Works 100%.

    Last thing was to Make it so that the Application aLWAYS Finds the DB as they'll be in the Same Directory.

    I Guess this Cannot be in the Wizard, It Involves application.startupparth, Thats all I Know.

    Any Ideas
    Curiosity SKILLED the cat
    Google Talk from your Mobile phone

    Chat from your mobile or get an emulator like J2ME Wireless Toolkit 2.2

  31. #31
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Thanks RESOLVED 90%

    Originally posted by Codehammer

    Last thing was to Make it so that the Application aLWAYS Finds the DB as they'll be in the Same Directory.
    In the windows generated code, you'll see something like Connection.ConnectionString = "Data Soruce = C:\whatever\..."

    You could try changing that like so:

    Connection.ConnectionString = "Data Source = " & Application.StartUpPath.ToString & "\filename.mdb"

  32. #32

    Thread Starter
    Addicted Member Codehammer's Avatar
    Join Date
    Aug 2004
    Posts
    164

    Thats What I Thought Too

    Thats What I Thought Too, but was wondering about It. I Use the Wizards as you noticed in the Attachment, Do I put it in the Connection String There, or in the Windows Generatred code as you Said:this is where all those [Friend with events] are?

    I Actually have a Application with MDI. the Connection for 15 Childwindows all have their own Conection Point to the Same MDI.

    Is there a way to only do it in the Parent, all the Child windows then Just Inherit it. I Have Tried once, but changing the Default Friend to PUBLIC, then deleting the Child Windows Connection but the dataadapter.fill Did not work.

    The reason I'm Asking is Cause Hawks Code to password the Stuff, worked Cool, but took 30Min to Implement/Configure.

    If the Child Windows Could just Use the parent, Like I Only Make One Modification.
    Curiosity SKILLED the cat
    Google Talk from your Mobile phone

    Chat from your mobile or get an emulator like J2ME Wireless Toolkit 2.2

  33. #33
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Thats What I Thought Too

    Originally posted by Codehammer
    Thats What I Thought Too, but was wondering about It. I Use the Wizards as you noticed in the Attachment, Do I put it in the Connection String There, or in the Windows Generatred code as you Said:this is where all those [Friend with events] are?
    Yes... it's there. Look for a property called .ConnectionString = ...




    I Actually have a Application with MDI. the Connection for 15 Childwindows all have their own Conection Point to the Same MDI.

    Is there a way to only do it in the Parent, all the Child windows then Just Inherit it. I Have Tried once, but changing the Default Friend to PUBLIC, then deleting the Child Windows Connection but the dataadapter.fill Did not work.
    Yes, if you were to declare it in a module, and perform all the initialization there, it would be available to all child forms.

    Thing is, I don't know how to work with the wizard, so you'll need to go through the wizard's code and make the appropriate changes.

  34. #34

    Thread Starter
    Addicted Member Codehammer's Avatar
    Join Date
    Aug 2004
    Posts
    164

    Module

    I Have My Stuff all in a Class. Isnt a module for Dos type Stuff.

    Well At least I can Still do Stuff with the password the OLD way, Even thought It takes Long to Setup It's Secure with the password.
    Curiosity SKILLED the cat
    Google Talk from your Mobile phone

    Chat from your mobile or get an emulator like J2ME Wireless Toolkit 2.2

  35. #35
    Hyperactive Member CyberHawke's Avatar
    Join Date
    May 2004
    Location
    Washington DC
    Posts
    477
    If you wrote the code instead of depending on the wizards to do the work for you, you would have total control over what file was opened, how it was opened, and any additional parameters you wanted to control. Using the wizard works great as long as you don't need to change the code. Once you start changing the code that the wizard has generated, you may as well have written it yourself.

    Code modules are for holding code, not "Dos type Stuff", but any code that needs to be accessed globally within your project.

    Classes are great as long as you understand what a class is. A class is intended to be a template for objects that your project will create during run time. Not everything needs to be a class, and in fact, unless a specific procedure is executing against data that is contained within the current object, then it's almost pointless to to have it in the class.

    It would be advisable to pick up a book on OOP concepts in order to better understand them.

    Good luck
    Whadayamean it doesn't work....
    It works fine on my machine!

  36. #36
    Junior Member
    Join Date
    Aug 2004
    Location
    Milwaukee, Wisconsin
    Posts
    23
    app.startuppath is not reliable depeneding on how tha app is started. trust me, I dealt with a frustrating error and traced it down to that...



    I use this
    VB Code:
    1. strAppdir = app.ExecutablePath
    2.         i = InStrRev(strAppdir, "\")
    3.         strAppdir = strAppdir.Substring(0, i - 1)

    this code will always return the name of the executable of your app, I just strip the path out of that.

  37. #37

    Thread Starter
    Addicted Member Codehammer's Avatar
    Join Date
    Aug 2004
    Posts
    164

    Application.startuppath & other issues, need some tissues!

    About Application.startuppath, I Have used it in all My Applications and It Fine so far, the Only Problem i've had is with this Project, where, on 3 occations, after Build, the Line having the application.startuppath, changes to this, in one of the childwindows:

    "C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\password.mdb"

    On next build it screws up again, cannot find connection.

    In the program I Have this Check that, if Idle for 40 Sec, then one has to Authenticate again, if the form is minimized the authenticate is minimized too, normal or minimized the authenticate is MODAL, or Should be, if its max'd then it works 100%, if minimized, when returned to normal view, the form is accessable with the "modal" in the Background.

    is this a VB.net BUG?

    P.S - Mendak's way mentioned to make the Connectyion work, with the DB always in the Same path as Application.(above)
    Curiosity SKILLED the cat
    Google Talk from your Mobile phone

    Chat from your mobile or get an emulator like J2ME Wireless Toolkit 2.2

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