Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4765
  • 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;

         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!
0
ShaneSQ
Asked:
ShaneSQ
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.
0
 
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
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?
0
 
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?
0
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 
Computer101Commented:
Forced accept.

Computer101
EE Admin
0
 
ShaneSQAuthor Commented:
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!
0
 
mommavalCommented:
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)
0
 
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
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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