?
Solved

rsContacts.ActiveConnection = CurrentProject.Connection Crashes Access

Posted on 2013-01-09
22
Medium Priority
?
770 Views
Last Modified: 2013-01-15
I have a database that has work for years.  It just started to crash when it reaches the vb line

rsContacts.ActiveConnection = CurrentProject.Connection

Every time it gets to this line, Access crashes with Microsoft Access has stopped working with an option to search online for a solution or restart.

Any help would be appreciated
0
Comment
Question by:Scamquist
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 12
  • 8
  • 2
22 Comments
 
LVL 26

Expert Comment

by:jerryb30
ID: 38761835
What has changed?
DB version?
OS?
Computer running the program?
Local database? Over a network?
Is Access a front end to another database?
0
 
LVL 1

Author Comment

by:Scamquist
ID: 38761850
Running on a terminal server.  Access 2007.  recently upgraded outlook to 2010 for a hosted exchange.  

The database is split.  Front and back end are on the same server.
0
 
LVL 26

Expert Comment

by:jerryb30
ID: 38761924
It is difficult to infer why a process which has been working stops suddenly from a single line of code.
I have no clues, and I am only asking questions so others may offer further suggestions/questions.
Does your process involve Outlook?
Does a local instance (not run on a terminal server) work?

I should have asked: Aside from what you mentioned on upgrade, has anything changed?
0
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 38761976
please try this line instead:
set rsContacts.ActiveConnection = CurrentProject.Connection

connection is a object, without the set (in vba), it will use the connection string property, which is just waste of resource as it will try to open another connection...
0
 
LVL 1

Author Comment

by:Scamquist
ID: 38762376
I used the line
set rsContacts.ActiveConnection = CurrentProject.Connection

Same problem.  I upgraded to Outlook 2010 because I began using a hosted Exchange.  Do you think it would help to upgrade the rest of the office suite to 2010 professional?
0
 
LVL 1

Author Comment

by:Scamquist
ID: 38762383
FYI, here are the preceeding lines

Public Function AppraiserBidEmail()
'Test if outlook is open.  If not, open it
Call IsOutlookOpen
Dim objOutlook As New Outlook.Application
Dim ObjEmail As Outlook.MailItem

Dim strLtrContent As String
Dim rsContacts As New ADODB.Recordset

rsContacts.ActiveConnection = CurrentProject.Connection
rsContacts.Open "tblRFB"
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 38762433
this one will be difficult to tackle, I fear.
maybe some project references are not working anymore, with the upgrade ...
can you check which version of ado is used in the project?
can you duplicate the problem on another computer (maybe a VM?)
0
 
LVL 1

Author Comment

by:Scamquist
ID: 38762454
How do I check the version of ado is used?

I copied the front and backend to my local computer and it did not fail.
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 38762461
0
 
LVL 1

Author Comment

by:Scamquist
ID: 38762472
I ran the code.  Error:

Microsoft OLE DB Provider for SQL Server -->[DBNETLIB][ConnectionOpen)Connect()).]SQL Server does not exist or access denied.
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 38762485
very good.
so, something has changed, which makes the connection string is not correct or needs to be changed.

you may want to check this article to troubleshoot the sql server connection:
http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/A_1881-Connect-to-your-SQL-Server.html
0
 
LVL 1

Author Comment

by:Scamquist
ID: 38762599
the backend database is an accdb access 2007 file, not SQL.
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 38762611
the error message tells you that you are trying to connect to a sql server, though.
please double-check the connection string you are using there.
0
 
LVL 1

Author Comment

by:Scamquist
ID: 38762649
Very strange.  This database has been working for a couple of years.  SQL was never used.  Are there connection strings when using linked tables?  

I also included the references in case there is something strange there.
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 38762668
yes, that access project does use a connection string internally to connect to the sql server...
0
 
LVL 1

Author Comment

by:Scamquist
ID: 38762678
I forgot, there are a few tables that connect to a SQL server on my website.  How would I find the connection string?
0
 
LVL 1

Author Comment

by:Scamquist
ID: 38762689
BTW, I am able still able to open all of the tables that are connected to the web SQL server.
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 38762697
from within the access project?
if yes, this sounds very curious ...
0
 
LVL 1

Author Comment

by:Scamquist
ID: 38762713
The tables are linked via ODBC.  No problems opening.  Could there be a problem with a mix of references to Office 12 and Office 14?  It to too much of a coincidence that this started once outlook 2010 was installed.
Access-References.jpg
0
 
LVL 1

Accepted Solution

by:
Scamquist earned 0 total points
ID: 38765103
Found a solution.  
Per Microsoft:
In a mixed Microsoft Office Access 2007 and Microsoft Office 2010 environment, you use the Microsoft.ACE.OLEDB.12.0 connection string through a Visual Basic for Applications (VBA) command to connect to Access 2007. In this situation, Access 2007 may crash.

Crash indeed.

The patch is located at

http://support.microsoft.com/kb/2512789

AngelIII thanks for the try
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 38765969
good finding
0
 
LVL 1

Author Closing Comment

by:Scamquist
ID: 38777595
My hardware support tech found a hot fix.
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses
Course of the Month12 days, 8 hours left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question