Connection error

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
alkjsdf
Posts: 3
Joined: Tue 25 Oct 2016 14:44

Connection error

Post by alkjsdf » Tue 25 Oct 2016 14:52

I have been using your dotConnect for Oracle for a few months, just recently went live with it. This morning, though (on my dev system fortunately), a connection string that has not changed is failing with this error "Cannot obtain Oracle Client information from registry. Make sure that Oracle Client Software is installed and that the bitness of your application (x86) matches the bitness of your Oracle Client, or use the Direct mode of connecting to a server.".

The message is very clear and helpful... but it is wrong. I am already using the Direct mode, just like I have been since I first tried a trial version of your product. (This is connecting to an old Oracle system from a Windows 10 box, OCI doesn't support what I need.) The connection string I am using is "User Id=myname;Password=mypassword;Server=192.168.9.45;Direct=True;Service Name=myservicename" and I generated it with your own OracleConnectionStringBuilder as shown here.

var oracleConnectionStringBuilder = new OracleConnectionStringBuilder
{
UserId = _credentials.User,
Password = _credentials.Password,
Server = _credentials.Server,
ServiceName = _credentials.Name,
Direct = true
};
var connectionString = oracleConnectionStringBuilder.ToString();

I cannot detect anything different in my code. I have had months of success with this and now this error is appearing. Any ideas about what might be broken here?

alkjsdf
Posts: 3
Joined: Tue 25 Oct 2016 14:44

Re: Connection error

Post by alkjsdf » Tue 25 Oct 2016 16:45

To simplify the demonstration of the problem, this is the tiniest example program that shows the failure. Also I have tried rebuilding the project, starting a new project from scratch, and rebooting the machine.

Code: Select all

    internal class Program
    {
        private static void Main(string[] args)
        {
            const string bhsDataConnectionString = "User Id=myuser;Password=mypassword;Server=192.168.9.34;Direct=True;Service Name=myservice";
            using (var connection = new OracleConnection(bhsDataConnectionString))
            {
                connection.Open();
            }
        }
    }

alkjsdf
Posts: 3
Joined: Tue 25 Oct 2016 14:44

Re: Connection error

Post by alkjsdf » Tue 25 Oct 2016 17:21

I resolved this on my own. The only thing I think Devart should look at is why I get such a specific error when it doesn't apply.

For the record, here's what I saw:
While attempting to see if an upgrade would fix it, I discovered that many files and folders in my project directory could not be overwritten. The permissions of my entire project directory were wrecked. (Something happened within Mercurial or Cygwin, I expect.) This also contaminated my new test project that I thought was clean. Whoops.

I have *no* idea why a local file permission problem would result in that particular error, but when I threw out that whole project directory and started over from a clean checkout from source control, everything works perfectly again. In retrospect, I would have done such a clean checkout sooner if I'd had any idea this was an environment problem.

Hope that's enough for someone to track this down. Thanks for a useful component!

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Connection error

Post by Pinturiccio » Fri 28 Oct 2016 09:12

You are right, the error message does not reflect the reason of the error. However, we cannot reproduce the issue. Please tell us what files and folders in your project cannot be overwritten. Please also tell us what other limitations are applied to these files and folders, and which permissions the user account, on behalf of which Visual Studio is started, has.

jeffblumenthal
Posts: 2
Joined: Wed 11 Jan 2017 19:41

Re: Connection error

Post by jeffblumenthal » Wed 11 Jan 2017 19:44

I fixed this by going into the root folder where my project artifacts reside and resetting the permissions at file level.

HTH.

Post Reply