SQLBase .NET DataProvider Connection Problem

Posted on 2007-07-27
Last Modified: 2013-11-16
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;

            AdpCon = new SQLBaseConnection(ConString);

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


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!
Question by:ShaneSQ
    LVL 32

    Expert Comment

    by:Daniel Wilson
    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.

    Author Comment

    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

    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?
    LVL 32

    Accepted Solution

    Shane, let's look back at your connection string.

    The example Gupta gives is:
    conn = New SQLBaseConnection("data source=island; uid = sysadm; pwd= sysadm; ini=D:\Gupta\SQLBase 8.5\sql.ini ")

    (this from )

    I think that suggests your connection string should look more like:

    string ConString = "DataSource=ServerName;UserId=SYSADMIN;Password=master; ini=C:\\ADP\\SQLBase\\pay5win\\SQL.INI";

    (correcting, or course, your server name & INI location.)

    Does that get it for you?
    LVL 1

    Expert Comment

    Forced accept.

    EE Admin

    Author Comment

    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!

    Expert Comment

    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)

    Expert Comment

    by:Conrado ZAVALA
    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.

    C# .NET Source Code
    System Variables

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
    Many companies are looking to get out of the datacenter business and to services like Microsoft Azure to provide Infrastructure as a Service (IaaS) solutions for legacy client server workloads, rather than continuing to make capital investments in h…
    Video by: Steve
    Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    755 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

    19 Experts available now in Live!

    Get 1:1 Help Now