+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Valued Forum Contributor
    Join Date
    04-23-2009
    Location
    IOWA
    MS-Off Ver
    2010 Professional
    Posts
    233

    Connection Strings

    I have split my database into a front end and a back end. I used the tool that is given via access 2007. After the split my be database is no longer encripted. I re-opened it exclusive and password protected it. However now when I open my "Front End" I get password is invalid. I am pretty sure it is because I don't have a connection string. I have never worked with connection strings, therefore don't really know where to begin. I do however have the string I need. I just don't know where to put it.
    Code:
    Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\myFolder\myAccess2007file.accdb;Jet OLEDB:Database Password=MyDbPassword;
    I got this string from Here.

    My main question is where does this string go?

    Thanks in advance for any time spent helping me attempt to solve my issue. I wasn't sure if this should go in Programming or Tables and Databases, as it is a bit of both. Sorry if it is in the wrong spot.

    Dan
    Last edited by NBVC; 05-19-2010 at 09:43 PM.
    "I am not a rocket scientist, I am a nuclear engineer." - Split_atom18
    If my advice has been helpful to you, then please help me by clicking on the scales and adding to my reputation, Thanks!

  2. #2
    Valued Forum Contributor
    Join Date
    04-23-2009
    Location
    IOWA
    MS-Off Ver
    2010 Professional
    Posts
    233

    re: Connection Strings

    Bump would be glad to provide more information if is needed. I am still stuck on this issue.

    Thanks again,

    Dan
    "I am not a rocket scientist, I am a nuclear engineer." - Split_atom18
    If my advice has been helpful to you, then please help me by clicking on the scales and adding to my reputation, Thanks!

  3. #3
    Forum Moderator ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2003 & 2010
    Posts
    1,791

    re: Connection Strings

    Hi split_atom18,

    I've never worked with a connection string before either, but hey, the worse that could happen is you just delete what I suggest.

    First, you'll need a module (or create one) to put a Sub into.

    Here's an example Sub I found in a book:

    Code:
    Public Sub Reconnect()
    	Dim cnn As ADODB.Connection
    	
    	Set cnn = New ADODB.Connection
    	cnn.ConnectionString = _
    	"Provider=Microsoft.ACE.OLEDB.12.0;" & _
    	"Data Source=C:\myFolder\myAccess2007file.accdb;" & _
    	"Jet OLEDB:Database Password=MyDbPassword;"
    	cnn.Open
    	Debug.Print cnn.ConnectionString
    	Set cnn = Nothing
    
    End Sub
    Modify that example as required for your path & password, then you can try running "Reconnect" in the immediate window to see if it works. If it does, you can then remove the Debug line.

    After that, if you have a form (or switchboard) that opens when you start your database, you can just put "Reconnect" in the Form_Open property.

    Let me know how that goes.

    Cheers,
    Last edited by ConneXionLost; 05-30-2009 at 01:51 AM.
    Docendo discimus.

    Please consider:
    • Thanking those who helped you. Click the reputation icon in the contributor's post and add Reputation.
    • Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  4. #4
    Valued Forum Contributor
    Join Date
    04-23-2009
    Location
    IOWA
    MS-Off Ver
    2010 Professional
    Posts
    233

    re: Connection Strings

    Will try and give it a go today, thanks again for your help. Will let you know how it went.

    Thanks,

    Dan
    "I am not a rocket scientist, I am a nuclear engineer." - Split_atom18
    If my advice has been helpful to you, then please help me by clicking on the scales and adding to my reputation, Thanks!

  5. #5
    Valued Forum Contributor
    Join Date
    04-23-2009
    Location
    IOWA
    MS-Off Ver
    2010 Professional
    Posts
    233

    Re: Connection Strings

    It isn't recognizing "ADODB.Connection" as valid. So far it isn't working, but I am still playing with it. Just wanted to give you a brief update.

    Thanks again,

    Dan
    "I am not a rocket scientist, I am a nuclear engineer." - Split_atom18
    If my advice has been helpful to you, then please help me by clicking on the scales and adding to my reputation, Thanks!

  6. #6
    Valued Forum Contributor
    Join Date
    04-23-2009
    Location
    IOWA
    MS-Off Ver
    2010 Professional
    Posts
    233

    Re: Connection Strings

    It not recognizing was due to a glitch in Access, which is fixed by opening and running Microsoft Office Diagnostics. None of my ADO was working at the time I had posted this.

    Dan
    "I am not a rocket scientist, I am a nuclear engineer." - Split_atom18
    If my advice has been helpful to you, then please help me by clicking on the scales and adding to my reputation, Thanks!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.2.0