ShaneSQ
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\\SQLBa se\\pay5wi n\\PAY4WIN .DBS;UserI d=SYSADMIN ;Password= master;";
SQLBaseConnection AdpCon = null;
try
{
AdpCon = new SQLBaseConnection(ConStrin g);
AdpCon.Open();
Console.WriteLine("The Connection Opened!");
}
catch (Exception e)
{
Console.WriteLine("Error: " + e + "- " + e.Message.ToString());
}
finally
{
AdpCon.Close();
}
}
}
}
The output:
ERROR: System.DLLNotFoundExceptio n: 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.SQLBase Connection ._loadAPI( )
at Gupta.SQLBase.Data.SqlBase Connection .Open()
at ConsoleApplication1.Class1 .Main(Stri ng[] args) in C:\Documents\Visual Studio 2005\Projects\SchedSQ\Cons oleApplica tion1\Clas s1.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!
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\\SQLBa
SQLBaseConnection AdpCon = null;
try
{
AdpCon = new SQLBaseConnection(ConStrin
AdpCon.Open();
Console.WriteLine("The Connection Opened!");
}
catch (Exception e)
{
Console.WriteLine("Error: " + e + "- " + e.Message.ToString());
}
finally
{
AdpCon.Close();
}
}
}
}
The output:
ERROR: System.DLLNotFoundExceptio
Please check your CLIENTRUNTIMEDIR entry inside INI file or check your environment variable path or system path.
at Gupta.SQLBase.Data.SQLBase
at Gupta.SQLBase.Data.SqlBase
at ConsoleApplication1.Class1
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!
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.SQLBase Exception: 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?
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.SQLBase
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Forced accept.
Computer101
EE Admin
Computer101
EE Admin
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!
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)
(no double backslashes)
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.