Welcome to the Excel Forum

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed.

Please Register to Remove these Ads

Please Register to Remove these Ads



Reply
  #1  
Old 05-20-2009, 04:09 PM
split_atom18 split_atom18 is offline
Forum Contributor
 
Join Date: 23 Apr 2009
Location: Fredericksburg, IA
MS Office Version:Ultimate 2007
Posts: 126
split_atom18 Has established their mark in the community
Connection Strings

Please Register to Remove these Ads

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
__________________
"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!
Reply With Quote
  #2  
Old 05-28-2009, 02:50 PM
split_atom18 split_atom18 is offline
Forum Contributor
 
Join Date: 23 Apr 2009
Location: Fredericksburg, IA
MS Office Version:Ultimate 2007
Posts: 126
split_atom18 Has established their mark in the community
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!
Reply With Quote
  #3  
Old 05-28-2009, 07:09 PM
ConneXionLost's Avatar
ConneXionLost ConneXionLost is offline
Valued Forum Contributor
 
Join Date: 11 Mar 2009
Location: Victoria, Canada
MS Office Version:2003
Posts: 576
ConneXionLost is attaining expert status ConneXionLost is attaining expert status
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,
__________________
Docendo discimus.

Last edited by ConneXionLost; 05-30-2009 at 12:51 AM.
Reply With Quote
  #4  
Old 06-01-2009, 12:46 PM
split_atom18 split_atom18 is offline
Forum Contributor
 
Join Date: 23 Apr 2009
Location: Fredericksburg, IA
MS Office Version:Ultimate 2007
Posts: 126
split_atom18 Has established their mark in the community
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!
Reply With Quote
  #5  
Old 06-02-2009, 02:07 PM
split_atom18 split_atom18 is offline
Forum Contributor
 
Join Date: 23 Apr 2009
Location: Fredericksburg, IA
MS Office Version:Ultimate 2007
Posts: 126
split_atom18 Has established their mark in the community
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!
Reply With Quote


Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Forum Jump