Возникла ошибка ole db код ошибки 0x80004005

I have migrated a classic ASP site to a new server and am getting the following error, message.

I have tried different connection strings but none of them work.

I am not even sure if the connection string is the problem

The new server is a Windows 2012 Server, SQL Server 2008 R2 Express machine.


Microsoft OLE DB Provider for SQL Server error '80004005'

[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.

/scripts/dbcode.asp, line 31 

Application("C2M_ConnectionString") = "Provider=SQLNCLI10;Server=(local);Database=mysite_live;Uid=mysitec_Live;Pwd=mypass;"

Hiten004's user avatar

Hiten004

2,4171 gold badge22 silver badges34 bronze badges

asked Feb 28, 2013 at 2:52

Burt's user avatar

9

If it is an Express instance, it is most likely not a default instance, but rather a named instance. So you probably meant:

... "Provider=SQLNCLI10;Server=.SQLEXPRESS; ...
--- instead of just (local) ---^^^^^^^^^^^^

Otherwise you’ll need to show us the server properties in SQL Server Configuration Manager on that machine in order for us to be able to tell you how to correct your connection string.

answered Feb 28, 2013 at 3:27

Aaron Bertrand's user avatar

Aaron BertrandAaron Bertrand

271k36 gold badges464 silver badges486 bronze badges

3

As Aaron Bertrand mentioned it would be interesting to have a look at your connection properties (In Sql Server configuration check if the following are enabled Name Pipes and TCP/Ip).
Since you’re able to connect from SSMS i would ask to check if the Remote connection is allowed on that server Also can you tell is the Sql browser service is running?

here is a link that i keep close to me as a reminder or check list on probable connection issues on SQL Server.
Sql Connection Issues
And lastly can you try as provider «SQLNCLI» instead of «SQLNCLI10»

answered Mar 4, 2013 at 23:02

Raymond A's user avatar

Raymond ARaymond A

7631 gold badge12 silver badges29 bronze badges

2

Step-1: Enabling TCP/IP Protocol
Start >> All Programs >> Microsoft SQL Server >> Configuration Tools >> SQL Server Configuration Manager >> SQL Server Network Configuration >> Protocols for MSSQLSERVER >> right click “TCP/IP” and select “Enable”.

Step-2: change specific machine name in Data Source attributes’value to (local) will resovle the problem ni SQL SERVER 2012.

answered Sep 28, 2014 at 16:31

BALAJE's user avatar

Try pinging the server in your connection string. The server your application resides on should be able to communicate on the port you specify by credentials. If you are developing locally try specifying «localhost». If the server is clustered or you installed as an instance then you need to specify that instance. Also make sure the server is configured for mixed-mode authentication if using sql credentials.

OR Try

Data Source=localhost;Initial Catalog=DBNAME;Persist Security Info=True;User ID=MyUserName; Password=MyPassword;

answered Feb 28, 2013 at 3:00

Ross Bush's user avatar

Ross BushRoss Bush

14.6k2 gold badges31 silver badges54 bronze badges

3

It can be a permission issue , Please check is that server is connecting with same configuration detail from SQL management.
other is username / password is wrong.

answered Feb 28, 2013 at 12:00

Jinesh Jain's user avatar

Jinesh JainJinesh Jain

1,2329 silver badges22 bronze badges

5

Here is what I would do:

EDIT: Note that this SO post, a few down, has an interesting method for creating the correct connection string to use.

  1. Open SSMS (Sql Server Management Studio) and copy/paste the
    username/password. Don’t type them, copy/paste. Verify there isn’t
    an issue.
  2. Fire up the code (this is next for me b/c this would be the next
    easiest thing to do in my case) and step to line 31 to verify that
    everything is setup properly. Here is some info on how to do
    this. I understand that this may be impossible for you with this
    being on production so you might skip this step. If at all possible
    though, I’d set this up on my local machine and verify that there is
    no issue connecting locally. If I get this error locally, then I
    have a better chance at fixing it.
  3. Verify that Provider=SQLNCLI10 is installed on the production
    server. I would follow this SO post, probably the answer posted
    by gbn.
  4. You have other working websites? Are any of them classic asp? Even
    if not, I’d compare the connection string in another site to the one
    that you are using here. Make sure there are no obvious differences.
  5. Fire up SQL Server Profiler and start tracing. Connect to the site
    and cause the error then go to profiler and see if it gives you an
    additional error information.
  6. If all of that fails, I would start going through this.

Sorry I can’t just point to something and say, there’s the problem!

Good luck!

Community's user avatar

answered Mar 5, 2013 at 14:08

Mike C.'s user avatar

Mike C.Mike C.

3,0042 gold badges20 silver badges18 bronze badges

5

Have you ever tried SQL Server OLE DB driver connection string:

"Provider=sqloledb;Data Source=(local);Initial Catalog=mysite_live;User Id=mysitec_Live;Password=mypass;"

or ODBC driver:

"Driver={SQL Server};Server=SERVERNAME;Trusted_Connection=no;Database=mysite_live;Uid=mysitec_Live;Pwd=mypass;"

At least this is what I would do if nothing helps. Maybe you will be able to get more useful error information.

answered Mar 8, 2013 at 0:23

Slava's user avatar

SlavaSlava

1,0555 silver badges11 bronze badges

Have you tried to use the server IP address instead of the «(local)»?
Something like «Server=192.168.1.1;» (clearly you need to use the real IP address of your server)

In case you try to use the server IP address, check in the «SQL-Server configurator» that SQL Server is listening on the IP address you use in your connection. (SQL Server Configurator screenshot)

Other useful thing to check / try:

  • And check also if the DB is in the default SQL Server instance, or if it is in a named instance.
  • Do you have checked if the firewall have the TCP/IP rule for opening the port of you SQL Server?
  • Have you tried to connect to SQL Server using other software that use the TCP/IP connection?

Community's user avatar

answered Mar 9, 2013 at 17:56

Max's user avatar

MaxMax

7,3882 gold badges26 silver badges32 bronze badges

The SQL Server Browser service is disabled by default on installation. I’d recommend that you enable and start it. For more information, see this link and the section titled «Using SQL Server Browser» for an explanation of why this might be your problem.

If you don’t wish to enable the service, you can enable TCP/IP protocol (it’s disabled by default), specify a static port number, and use 127.0.01,<port number> to identify the server.

answered Mar 10, 2013 at 16:41

Paul Keister's user avatar

Paul KeisterPaul Keister

12.8k5 gold badges45 silver badges75 bronze badges

In line 31:

cmd.ActiveConnection = Application("C2M_ConnectionString")

How are you instantiating cmd?

Rather than the ConnectionString being wrong, maybe cmd is acting differently in the new environment.

Edited to add:

I see that you’ve gone from IIS 7 to IIS 8. To run Classic ASP sites on IIS 7 required manual changes to server defaults, such as «allow parent paths.» Is it possible that some of the needed tweaks didn’t get migrated over?

If you’re not running with Option Strict On, you should try that — it often reveals the source of subtle problems like this. (Of course, first you’ll be forced to declare all your variables, which is very tedious with finished code.)

answered Mar 5, 2013 at 23:53

egrunin's user avatar

egruninegrunin

24.6k8 gold badges49 silver badges92 bronze badges

1

  • Remove From My Forums
  • Question

  • We have a SSIS package which fetches data from a SQl db and inserts the recrds to another sql db both on the same server, in the datasource we have specified the exact server instance name and also userid and password. We are able to connect to these databases
    from SSMS using the credentials mentioned in the dtsconfig file. But when its run through the SQL Job Agent it fails with the below error:

    Description: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.  An OLE DB record is available.  Source: «Microsoft SQL Native Client»  Hresult: 0x80004005  Description: «Login timeout expired». 
    An OLE DB record is available.  Source: «Microsoft SQL Native Client»  Hresult: 0x80004005  Description: «An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by
    the fact that under the default settings SQL Server does not allow remote connections.».

    Please help us to find whats exactly wrong and how we can resolve this.


    Vinish Viswanathan

  • Remove From My Forums
  • Вопрос

  • Hi Everyone,

    I have a package that loads data from SQL table to excel file which is in .xls format. I see below error. I would appreciate if someone can help me out on this.

    [Excel Destination [20]] Error: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.
    An OLE DB record is available.  Source: «Microsoft JET Database Engine»  Hresult: 0x80004005  Description: «Spreadsheet is full.».

    Regards

    Krishna

    • Изменено

      17 января 2018 г. 19:55

Ответы

  • Hi Krishna_ssis,

    Please have a look at this similar discussion: Using
    Excel 2012 file in the Excel Connection Manager

    Regards,

    Pirlo Zhang 


    MSDN Community Support
    Please remember to click «Mark as Answer» the responses that resolved your issue, and to click «Unmark as Answer» if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to
    MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Помечено в качестве ответа
      Krishna_ssis
      10 февраля 2018 г. 16:13

An effortless way to create dynamic website application involves Open Database Connectivity aka ODBC.

However, web apps can fail due to errors with ODBC database connection. And, they report ODBC error 80004005.

Finding the real reason behind the ODBC error can be tricky. That’s why, we regularly receive requests to fix odbc errors as part of our Server Management Services.

In this write-up, we’ll analyze the top 5 reasons for ODBC error 80004005 and how our Database experts fix it.

How does error 80004005 look like?

A vast majority of websites in internet use database as its back-end. These websites store the user details and related data in the databases. And, to make these details display on the website, we commonly use ODBC method.

Fortunately, this ODBC method is independent of website coding language. That is, it doesn’t matter whether your website uses PHP or ASP code.

It is the ODBC database drivers that hold the underlying database details and helps to connect to the database systems. And, if for some reason this database connection fails, it results in ODBC error 80004005. For example, a typical error page looks like:

ODBC error 80004005

In general, such ODBC errors show up with websites using Microsoft Access databases. These ASP websites generate these errors when having trouble accessing the database file. Again, these 80004005 errors occur in OLE DB Provider for ODBC or Microsoft Jet Database Engine too.

What causes ODBC error 80004005 ?

Now, its time to check on the causes for error 80004005. From our experience in managing websites, our Dedicated Engineers often encounter this message in various scenario.

1. Incorrect permissions

Basically, Windows websites should have access rights on the database files with extension .mdb, .ldb, etc.. If any of the read or write permissions are missing, website will show error 80004005. Essentially, the website user Need MODIFY permissions on the entire database directory. This allows the process to create a lock file (ldb) in the same directory as the mdb file.

The same error can happen if the website database .mdb file has a READ ONLY attribute set.

IIS7 supports classic ASP. But, for using ASP with an MS Access mdb database, it requires special settings. Often, the path to the database files create a problem here too.

2. Wrong DSN settings

Another common reason for ODBC errors attributes to Data Space Name aka DSN settings. In general, DSN holds the information of website specific database that ODBC driver connects to. Any wrong details will cause problems with ODBC connection.

At times, customers forget to create DSN, or add wrong path to the database file. Again, in servers with control panels, often DSN creation may not create necessary files on the server. This also create ODBC errors.

3. Corrupt database

Obviously, a corrupt database will always result in an error. And, in such cases, search query will not yield correct results and show up ODBC error 80004005.

4. Already running process

Microsoft access databases have trouble in handling multiple processes at a time. When a process still has a file handle open to the db, it can show ODBC connection error. This typically happens when users do not close the connection properly. For example, a partial upload of database file via FTP client can leave behind an open connection.

5. SQL server restrictions

Last and not the least, SQL server security restriction can also be a reason for ODBC error 80004005. When SQL Enterprise Manager has Integrated security turned on, the windows account should be mapped to the database account. Else, it will result in website errors.

How we fix ODBC error 80004005

Now that we know the typical reasons for the error 80004005, let’s check on how our Database Engineers resolve ODBC errors for our customers.

Recently, we received a request from customer where his website was not loading. He had trouble in making connection to the website’s database. The website showed the below error message:

Microsoft OLE DB Provider for ODBC Drivers error '80004005' [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified /LM/W3SVC/144/ROOT/global.asa, line 18

As the fist step, we verified the permissions and ownership of the database files. The IUSR account had proper permissions on the files. Additionally, ODBC driver did exist on the server too.

Then, we checked the DSN connection string. And, we found that the database connection string in his .asa file was set up incorrectly. Therefore, we corrected the settings and that fixed the website error.

Similarly, in cases where ODBC errors show up due to open connections, our Dedicated Engineers recycle the website’s application pool which will close any connections from the site. We also educate customers to log off or close any FTP clients after accessing the database file.

Generally, to troubleshoot DSN related errors, we always test the website code with a DSN-less connection. That easily helps to eliminate DSN errors.

And, in the worst event of database corruption, all we do is database restore from backup.

For security reasons, we always recommend customers to place the database files inside a directory in the private folder. For example, in IIS Windows servers with Plesk panel it can be (ftproot)/private/database.

[Do you get troublesome ODBC error on your websites? Our Database Experts can fix it in a jiffy.]

Conclusion

In a nutshell, ODBC error 80004005 can happen due to incorrect permission on database files, wrong connection string, corrupt database and many more. Today, we saw the top 5 reasons for the error and how our Support Engineers fix it.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = «owonCMyG5nEQ0aD71QM»;

  • Remove From My Forums
  • Question

  • I created a package that refreshes tables on one SQL Server to another SQL Server.  First, I use an ExecuteSQL task to truncate the tables.  Then I use a Data Flow task to copy the tables from one server to the other.  Finally I update a log table.  It was working fine with four tables.  I added another table to the refresh and now I get these error messages:

    [Source — RbcAcctSegment [1096]] Error: An OLE DB error has occurred. Error code: 0x80004005. An OLE DB record is available.  Source: «Microsoft SQL Native Client»  Hresult: 0x80004005  Description: «Unspecified error». An OLE DB record is available.  Source: «Microsoft SQL Native Client»  Hresult: 0x80004005  Description: «Communication link failure». An OLE DB record is available.  Source: «Microsoft SQL Native Client»  Hresult: 0x80004005  Description: «Communication link failure».

    [Source — RbcAcctSegment [1096]] Error: Opening a rowset for «[dbo].[RbcAcctSegment]» failed. Check that the object exists in the database.

    [DTS.Pipeline] Error: component «Source — RbcAcctSegment» (1096) failed the pre-execute phase and returned error code 0xC02020E8.

    RbcAcctSegment is the new table that I added.  The errors occur in the Data Flow task.  We have tried running this on a different workstation with the same results.

    What would cause this?

    Fred

Понравилась статья? Поделить с друзьями:

Не пропустите эти материалы по теме:

  • Яндекс еда ошибка привязки карты
  • Возникла ошибка illegalstateexception tivimate
  • Возникла ошибка http datasourceexception tivimate
  • Возникла ошибка 500 геткурс
  • Возникла ошибка 500 getcourse

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии