Solved

data provider could not be initialized

Posted on 2010-09-17
10
1,303 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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Many companies are making the switch from Microsoft to Google Apps (https://www.google.com/work/apps/business/). Use this article to learn more about what Google Apps has to offer and to help if you’re planning on migrating to Google Apps. It is …
The System Center Operations Manager 2012, known as SCOM, is a part of the Microsoft system center product that provides the user with infrastructure monitoring and application performance monitoring. SCOM monitors:   Windows or UNIX/LinuxNetwo…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

707 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

15 Experts available now in Live!

Get 1:1 Help Now