Link to home
Start Free TrialLog in
Avatar of ShaneSQ
ShaneSQFlag for Canada

asked on

SQLBase .NET DataProvider Connection Problem

I'm having difficulty connecting to an SQLBase database (1-user Licence SQLBase v. 7.5.1). I'm trying to use the latest .NET DataProvider (from Gupta, installed "typically") to no avail. I have referenced the Gupta.SQLBase.Data dll.

The following is my code:

using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using Gupta.SQLBase.Data;

namespace ConsoleApplication1
{
   class SQLConnect
   {
      static void Main(string[] args)
      {
         string ConString = "DataSource=C:\\ADP\\SQLBase\\pay5win\\PAY4WIN.DBS;UserId=SYSADMIN;Password=master;";

         SQLBaseConnection AdpCon = null;

         try
         {
            AdpCon = new SQLBaseConnection(ConString);
            AdpCon.Open();

            Console.WriteLine("The Connection Opened!");
         }
         catch (Exception e)
         {
            Console.WriteLine("Error: " + e + "- " + e.Message.ToString());

         }
         finally
         {
               AdpCon.Close();
          }
      }
   }
}

The output:

ERROR: System.DLLNotFoundException: Unable to load SQLBASEUTIL.dll driver library.
Please check your CLIENTRUNTIMEDIR entry inside INI file or check your environment variable path or system path.
    at Gupta.SQLBase.Data.SQLBaseConnection._loadAPI()
    at Gupta.SQLBase.Data.SqlBaseConnection.Open()
   at ConsoleApplication1.Class1.Main(String[] args) in C:\Documents\Visual Studio 2005\Projects\SchedSQ\ConsoleApplication1\Class1.cs:line 20- Unable to load SQLBASEUTIL.dll driver library..
Please check your CLIENTRUNTIMEDIR entry inside INI file or check your environment variable path or
system path.


SqlBaseUtil.dll is in the folder it was installed to. What am I doing wrong?

Thank you!
Avatar of Daniel Wilson
Daniel Wilson
Flag of United States of America image

What you're doing sounds right ...

Suppose you work a little more with the details that are in the error message.

Is there an INI file in the folder containing SqlBaseUtil.DLL?  What does its ClientRunTimeDir entry say?

Does your PATH system variable include that ClientRunTime folder?

I'll admit I'm doing some guessing here, but hope to get you closer to a solution.
Avatar of ShaneSQ

ASKER

Thanks DanielWilson!

To start, I checked sql.ini, and it contains a ClientRunTimeDir entry matching the installation directory of the DataProvider, where SQLBaseUtil.dll is.

I changec the PATH system variable as you suggest, and the output has changed to the following:

Error: Gupta.SQLBase.Data.SQLBaseException: Failed to initialize SQLBase API.
Please check location of your INI file in the connection string.
Also please check your CLIENTRUNTIMEDIR inside INI file.
    at Gupta.SQLBase.Data
etc..

SO, I looked up the connection string on a Gupta website, and there is no place for an INI file-location.
i even  tried "INI = <path>" to no avail.
I have also tried copying the INI file from the DataProvider's install directory to the same directory as my build.

Any ideas?
ASKER CERTIFIED SOLUTION
Avatar of Daniel Wilson
Daniel Wilson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Forced accept.

Computer101
EE Admin
Avatar of ShaneSQ

ASKER

Ok,
Firstly, let me appologize for the delay in responding, and thank DanielWilson for his help.

Secondly, I gave up on this issue since each time I tried to connect, I needed to reinstall the database and the application that runs from it. Since I require this app to be accessible for me to do my job, I could not continue trying to connect. The front-end application has the ability to accept CSV data, and ReportSmith to output CSV data. I will be using these interface files from now on to communicate with this, troublesome database.

Thanks again Daniel!
Avatar of mommaval
mommaval

the connection string that solved the problem  is ("data source=island; uid = sysadm; pwd= sysadm; ini=D:\Gupta\SQLBase 8.5\sql.ini ")  while substituting your own values for database, directory, etc.

(no double backslashes)
I know this issue is already solved but I found that this is caused by a missing entry in the System Variable "Path".  

For details please look at the attached screenshots that I have added to this thread.

User generated image
User generated image