Solved

data provider could not be initialized

Posted on 2010-09-17
10
1,327 Views
Last Modified: 2013-11-28
I've been having problems in Access 2003, which I use as front-end connection to a SQL 2005 server, with the following error message  - "Data provider could not be initialized". The message pops up every  few hours. I tried to catch it On Error events in all forms in my project, and sequentially suppress it.  This did not work, I mean, the error is not caught on this event.

I also tried to tune up SQL server settings connected to a new feature in SQL 2005 to poll, discover, and clean up disconnected sessions (http://social.msdn.microsoft.com/forums/en-US/sqldataaccess/thread/47d2df0a-0f32-41f8-a5b2-6d8d656d3271/ ). Although It seems that I receive now  fewer error messages, it did not solve the problem. Two other threads here were not helpful:
http://www.experts-exchange.com/Microsoft/Development/MS_Access/Access_Forms/Q_23925257.html 
http://www.experts-exchange.com/Microsoft/Development/MS_Access/Access_Forms/Q_23256341.html
0
Comment
Question by:aryef
  • 4
  • 4
10 Comments
 
LVL 3

Expert Comment

by:alexfarias
ID: 33701056
0
 
LVL 3

Expert Comment

by:alexfarias
ID: 33701068
maybe is a MDAC issue...try to reinstall it
0
 
LVL 3

Expert Comment

by:alexfarias
ID: 33701078
0
 
LVL 3

Expert Comment

by:alexfarias
ID: 33701092
so I read the second answer, it seems that has to do with permissions ... try it too, check the permissions in the database
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

Author Comment

by:aryef
ID: 33701596
No,... the application works correctly all of the time, I have access to all db resources I need. The pop-up message suddenly pops up after a long inactivity period, usually more than one hour. So, it could not be any permission/security or MDAC issue. The user that access the MS SQL is granted  dbo permissions on the database.  It could not be also an  IIS issue, for I do not use it. I use direct  ADO connection to DB  im my VBA code.  Sample code is
Set conn = New ADODB.Connection
    conn.ConnectionString = "some valid connection string"
    conn.Open
    Set cmd = New ADODB.Command
With cmd
   .ActiveConnection = conn
   .CommandTimeout = 5
   .CommandText = strCommandText
   .CommandType = adCmdStoredProc
End With

Set rst = New ADODB.Recordset
    rst.Open cmd
If Not rst.State = adStateClosed Then
   If Not rst.EOF Then
 
    Retval = rst.GetString(adClipString, , DELIM, DELIM)
   End If
End If
0
 

Author Comment

by:aryef
ID: 33712153
Now I am trying to use "Launch Depends..." of Sysinternals Process Explorer, to try to find out where this message is thrown. As I said, it is not caught at "OnError" or "OnCurrent" event in any form in my project.
I'll post if I find something interesting there...
0
 

Author Comment

by:aryef
ID: 33765706
First of all, the error message is 100% reproducible by choosing the "refresh" item of the "records" menu of Access Menu bar. it has no apparent consequence, for after its appearing, the application works as fine as it should.
It was not possible to catch the message neither at OnError event of the Form not at OnCurrent.

OK, I tried to bind the main form of my project to just a regular Access table, instead of ADO recordset. As a result, the error message ("data provider coudl not  be initialized") was incurred as many times as it takes of refreshing the each and every subform of my main form!  Instead of appearing once, I had 13 uch appearances when choosing the "refresh".

So, I rebound the main form back to its ADO recordset. Now, I again receive the message only once, when I choose the "refresh" item of the "Records" menu.

If someone now what event fires up on clicking the "refresh" item of the "records" menu, this will probably solve this very strange problem..
??
0
 

Author Comment

by:aryef
ID: 33772938
I did the following experiment - I run the application within a VMware Player box. VMWare Player has a very interesting feature - when you restore it from a minimized state, or just click within, it does not incur any repaint or screen refresh events in MS Access applications. And, as a result, no "Data provider...." message ever appears after an inactivity period. Only if I specifically choose "Records" -> "Refresh" menu item, it happens, but it seems to be not a problem, becuae no one will need to do it on purpose.
Quite a strange "solution"... Doe anyone know how to mimic this behavior (skip all repaint events)  in regular, not virtualized, evnvironment??
0
 

Accepted Solution

by:
ee_auto earned 0 total points
ID: 34018091
Question PAQ'd, 500 points refunded, and stored in the solution database.
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Article by: Leon
Software Metering within our group of companies has always been an afterthought until auditing of software and licensing became a pain point. Orchestrator and SCCM metering gave us the answer and it was an exciting process.
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

911 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now