cancel
Showing results for 
Search instead for 
Did you mean: 

Failed to open the connection - database vendor code 17

Former Member
0 Kudos

I'm upgrading a VB.net Windows Forms application from 1.1 to 4.0. In the reporting form, the list of reports you can choose are pulled from a folder where the .rpt files reside. Once the user chooses a report and executes it, vb code populates the current database connection information and displays the report in the report viewer control.

The following things are true:

- Version 1.1 works on my systems and my customers systems

- The code has not been changed, except that it now targets .Net 4.0 instead of 1.1

- The exact same .rpt files are being used

- Version 4.0 connects to the same database my customer is using, and I can run the reports just fine from here.

- Version 4.0 is able to connect to the database just fine from my customers systems (using the same connection information provided to the report)

- My customer installed this: http://downloads.businessobjects.com/akdlm/cr4vs2010/CRforVS_redist_install_32bit_13_0_2.zip

The only problem is that my customer encounters this error when trying to run any report from his systems:

Failed to open the connection.

Details: Database Vendor Code: 17

Failed to open the connection.

Orders.BOL.TaskDetail {393C9017-0ED1-4E1E-8824-E222F4B9D14C}.rpt

Details: Database Vendor Code: 17

I read all of the articles I could find, and they either don't describe this exact situation, or there is insufficient information for troubleshooting this issue. Are there steps that I've missed to make Crystal Reports for VS2010 work on my customer's systems?

Your help is appreciated,

Mark

Accepted Solutions (1)

Accepted Solutions (1)

former_member188030
Active Contributor
0 Kudos

Hi Mark,

More information required -

- Does this happen with all reports or few?

- What is the connection type used for the report to connect to the database (OLEDB,ODBC etc)

- Are you changing the database at runtime?

few things you could check

- Check if the database is accaessible from the client machine with proper permissions / rights.

- If its an ODBC connection check if the DSN with same name is created on the client machine.

- Check the driver / provided used by the report to connect to the DB, verify that the same is installed on the client machine. (SQL NAtive client, SQL Server etc)

Also take a look at below articles discussing the simillar issue.

[|]

[1474461 - Unknown Database Connector Error when connecting to a Dataset in a VS .NET application |http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333433373334333433363331%7D.do]

Hope this helps,

- Bhushan.

Former Member
0 Kudos

Thank you for your response, here is more information:

- Does this happen with all reports or few?

it happens when my customer opens any report.

- What is the connection type used for the report to connect to the database (OLEDB,ODBC etc)

OLEDB

- Are you changing the database at runtime?

the database connection information is set at run-time, the same way it does in the old version, which is still working

- Check if the database is accaessible from the client machine with proper permissions / rights.

my application is able to connect to the database with the same connection information that my code provides to the report

- Check the driver / provided used by the report to connect to the DB, verify that the same is installed on the client machine. (SQL NAtive client, SQL Server etc)

The old version of the application uses the same driver, and it is still working fine

I will take a look at the links you provided...

Thanks again,

Mark

Former Member
0 Kudos

Also take a look at below articles discussing the simillar issue.

1474461 - Unknown Database Connector Error when connecting to a Dataset in a VS .NET application

I checked those two articles and neither are relevant to my situation, however it was helpful that one pointed out that error code 17 is "SQL Server does not exist or access denied".

Any ideas why CR would not be able to access a server that my application can access just fine? Furthermore, CR can access this server from both a 32 and 64 bit system here using the same connection information, it is only not working on my customer's computer.

All of these facts make me think my customer's computer needs something more that I didn't need on my systems to get it working.

Thank you,

Mark

former_member188030
Active Contributor
0 Kudos

few things to try

- Compile the application targetting X64 bit mode and then deploy on the client machine using 64 bit runtimes.

- Run 'Process Monitor", 'fiddler' on the client machine and look for any access denied errors.

Also, does this happen only on one client environment? this could be an environment specific issue.

You can give it a try o sopme other client machine.

- Bhushan

Answers (1)

Answers (1)

0 Kudos

Hi Mark,

The error means exactly what is says, CR can log onto the server through your app. Check their user name and password, quite often they are not using the correct one or the DBA has not allow that user to access the tables the report uses. CR fully supports DB security.

Search for the error for your DB, it appears to be MS SQL Server but you never said.

If they are using MS SQL 2008 then you MUST use the MS SQL Native 10 client. It's also been found that if youa re using MS SQL 2005 and CR for VS 2010 it also resolves the issue by using the SQL Native Client. You can get the MSI from Microsoft or off the SQL CD. Install the Client Tools.

Be sure also that you set your Project to compile in x86 mode, don't use AnyCPU. If their OS is 64 bit it could be the app is trying to connect using the 64 bit client or ODBC DSN.

Don

Edited by: Don Williams on Jan 18, 2012 7:38 AM

Former Member
0 Kudos

Thank you for your response,

- Check their user name and password, quite often they are not using the correct one or the DBA has not allow that user to access the tables the report uses. CR fully supports DB security.

I can run the reports from here the same way that they are trying to - from a computer that I set up exactly the same way that I told my customer to set theirs up

- Search for the error for your DB, it appears to be MS SQL Server but you never said.

Yes, it is SQL 2008 Express

- If they are using MS SQL 2008 then you MUST use the MS SQL Native 10 client.

It is an OLEDB connection, which is what it says at the top of the connection dialog when I choose the MS SQL Native 10 client. The old reports still work on their systems, with the same database. Could upgrading the reports to 2010 cause them to use a connection type that isn't working? Are you suggesting that I open each report and redo the connection?

- Be sure also that you set your Project to compile in x86 mode, don't use AnyCPU. If their OS is 64 bit it could be the app is trying to connect using the 64 bit client or ODBC DSN.

My project is using Any CPU at the moment. If they do have a 64 bit system, could it fix the problem if they installed the 64 bit version of the CR redist? I'm not sure if they are 32 or 64 - I'll check on that... My development PC is 64 bit, and the reports work from that system also, but I have the whole CR for VS2010 installed on that system, so maybe that's why it works.

Best Regards,

Mark

Former Member
0 Kudos

- Search for the error for your DB

Ok, error 17 for SQL is "SQL Server does not exist or access denied."

The thing is, in order to even get to the report screen, they successfully accessed the same SQL Server from my application with the same credentials supplied to the report. It is only CR that thinks the server is inaccessible, and only from my customer's computer. Weird.

Thank you,

Mark

0 Kudos

Hello,

So set your project for what ever platform you want to use. DO NOT use ANYCPU. If they are a 64 bit OS then it will require the 64 bit runtime and that requires ALL components to be 64 bit also. Including Printer Drivers as well as the 64 bit SQL Client Tools to be installed.If your app is 32 then they need to use 32 bit client and 32 bit CR runtime.

As I said, if you are using MS SQL 2008 ( any version ) MS DOES NOT support the MDAC version of SQL Server. YOU MUST use the Native 10 client.

.NET IDE and debug mode is 32 bit only, so it's going to work on your PC. Unless you are compiling for 64 bit mode then you'll actually see both 32 and 64 bit runtime being loaded.

Are you using the MS OLE DB Provider in your reports or are you using the MS Native drivers in your original reports?

IF anything other than the Native 10 driver then you'll have to update your reports or using RAS you need to use the ReplaceConnection method to update your reports. Search on ReplaceConnection_click and you'll find sample code on how to.

Don