• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4886
  • Last Modified:

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;

            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!
1 Solution
Daniel WilsonCommented:
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.
ShaneSQAuthor Commented:
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?
Daniel WilsonCommented:
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 http://guptaworldwide.com/onlinedocs/sb/books/connecting/index.htm )

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?
Network Scalability - Handle Complex Environments

Monitor your entire network from a single platform. Free 30 Day Trial Now!

Forced accept.

EE Admin
ShaneSQAuthor Commented:
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!
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)
Conrado ZAVALACommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now