VBSCRIPT connection to Oracle failing due to driver - sql

I am using a vbscript which connects to SQL.
My connection String look like
connectionString = "DRIVER={Microsoft ODBC for Oracle};SERVER=convcsd;User Id=sysman;Password=csaadmin;"
Set connection = CreateObject("ADODB.Connection")
It is working on one server but not on another. it gives an error :
The oracle(tm) and networking components were not found. These
components are supplied by oracle corporation..
You will be unable to use this driver until these components have been
installed.
Please let me know how to add ODBC driver. I researched but not able to get through.

SQL Plus is an Oracle client yes but that is not enough to be able to use your script. You need an ODBC driver and prefable an OleDb driver (is faster) for Oracle on each pc you're going to use your script.
Compare the ODBC drivers between two 2 pc's with the Microsoft ODBC administrator (type ODBC in your startmenu searchwindow) and you will notice the difference. Use your Oracle installpackage and check the option to install the OleDb driver.
There is a Microsoft and an Oracle version, again it is best to use the Oracle driver. The connection string for Oracle OleDb is
Provider=OraOLEDB.Oracle;User ID=<user name>;Password=<password>;Data Source=<data source>

Related

Excel-VBA to SQLite3 through ODBC Driver: primary database + attached database

I'm trying to connect from Excel-VBA to SQLite3 database through ODBC (Windows 10 x64).
I use Christian Werner's SQLite ODBC driver v 0.9999 (http://www.ch-werner.de/sqliteodbc) - as manual says I've installed both install both 32 and 64Bit versions of the driver.
Connecting to one database is ok:
ConnectionString = "DRIVER=SQLite3 ODBC Driver;Database=c:\first.db;"
Connecting to 2 databases (SQLite provides ability to connect to primary database + attached database) is also ok:
ConnectionString = "DRIVER=SQLite3 ODBC Driver;Database=c:\first.db;Attach=c:\second.db;"
but looks like VBA don't see tables from attached database - the following query fails:
SELECT * FROM [second].[table_name_in_second_db];
Does that SQLite ODBC driver supports attach database in connection string?
Or maybe I use incorrect syntax?
You don't handle attachments thru the connection. The primary database is handled in the connection properties. Once you have a valid connection you're essentially using sqlite engine. (the driver is a wrapper for sqlite.dll) Therefore you can attach databases as sql statements.
cn.execute "attach database 'C:\filename.db' as db"

Configuration file in Netezza

Is there a configuration file in Netezza like tnsnames.ora in Oracle which contains database names and their connect string names?
If so, what is the default location of the file?
I'm using Informatica PowerCenter to load to target Netezza table. I want to know the Database details of the connect string Informatica uses to connect with Netezza DB. In Oracle, I could have got the informatica from tns file.
Netezza doesn't have an equivalent to Oracle TNSNames.
ODBC Connection String Example:
Driver={NetezzaSQL};servername=myServerAddress;port=myPortNumber;
database=myDataBase;username=myUsername;password=myPassword;
ODBC ConnectionStrings.com
ODBC Configuration IBM
JDBC Configuration IBM
You can check the dsn entry (connect string name in Informatica connection) in the odbc.ini file in the LD_LIBRARY_PATH which is defined at the time of Netezza ODBC driver installation
In PowerCenter, a developer can check the connection details only if a dedicated connector is used. For ODBC, the only information available in Workflow Manager is the name of ODBC. The details can be checked in ODBC definition on the server.
A small addition to #Marciejg:
We have only a few odbc connections compared to powercenter connections. Each odbc points to the ‘system’ database and in the powercenter connection pointing to a specific database on that server, we run a ‘set current_catalog PROD_EDW’ in the pre sql. That way things are mostly visible and manageable in powercenter, and the odbc only points to the server.
And slightly off topic: the pre sql has additional ‘set CLIENT_*_NAME’ statements that enters the powercenter workflow/session etc dynamically based on powercenter build in variables (they are named $PMWorkflowname and similar)
That way we can trace back to the powercenter code immediately from a planfile, the pg.log or most interestingly, the HISTDB
Follow these links if you want to play with it:
- https://www.ibm.com/support/knowledgecenter/SSULQD_7.2.1/com.ibm.nz.dbu.doc/r_dbuser_set.html
and
http://dwhlaureate.blogspot.dk/2012/09/built-in-variables-in-informatica.html

Moving SAS dataset into SQL Server WITHOUT using SSIS packages

I have a vb.net 2010 project that would remotely run a prepared SSIS package that exports a SAS 9.3 dataset into a SQL Server 2012 database. As far as I can tell, the process tested fine.
However, I was told not to use it (because SSIS packages are unreliable?), so are there alternatives to doing this?
I have looked up SAS ODBC to see if I can do this from the SAS end, but I am not sure of the DSN argument, the example I looked up is like this:
LIBNAME SQL ODBC DSN='sqlsrv_nt' schema=MSSQLTips;
Besides not being sure that the DSN is applicable for me, I am not administrator on my workstation so I can't play with ODBC settings much - I'm not certain that's the way to go.
You can either use a driver or DSN (customized shortcut data source connection object with all configurations/settings set). Once connected, append your data from local to remote source.
* WITH DSN;
libname mssqldata odbc datasrc="DSN Name" user="username" password="password";
* WITH DRIVER;
libname mssqldata odbc complete="driver={SQL Server}; Server=servername; user=username; pwd=password; database=databasename;";
** APPEND TO DATABASE TABLE;
proc datasets;
append base = mssqldata.DBTable
data = Work.SASdataset
force;
quit;
** UN-ASSIGN ODBC LIBRARY;
libname mssqldata clear;
Be very careful with assigning library to database as it is a live connection and not copies. Hence, modifying/adding/deleting will reflect immediately to server.
You don't need to be administrator. Set up a DSN connection under user profile. Then assign your libname and you can upload or update data in SQL server as permissions allow.
Your libname statement looks correct.

Oracle SQL Query Returns Different Results via OLEDB Provider as Opposed to ODBC 10/11g Driver

I have written a small application in the AutoIT scripting language which uses ADO to connect to both Oracle and MSSQL databases and run queries, alerting on their results.
Most of the time I can connect to an Oracle DB using ODBC and the standard 10/11g driver however on one of my client's servers this can't be done so I'm using the OLEDB provider as the connection method.
The query I'm using seems to return no results via OLEDB however via ODBC it works absolutely fine.
Select Submission_Session_ID,Acquirer_ID,TO_CHAR(Submission_Date,'DD Mon YYYY HH24:MI'),Total_Records,Status,round(Total_Net_Debit-Total_Net_Credit/100.0,2) FROM customer.SubmissionHistory WHERE Submission_Date >= (sysdate-1/24)
Does anyone have an understanding of why this could be the case? At the very most I seem to be able to return one row from this query.

Windows 7 remote ODBC connection to Sybase 11

I'm using windows7 32bit, and connection to remote sybase databse using odbc
the connection goes fine, but when I'm retrieving arabic data I get unreadable characters
Any suggestion please.
By "Sybase 11", are you talking about Sybase SQL Anywhere 11? AFAIK, Sybase ASE doesn't have a version 11 so I'm guessing here.
Make sure the character set you are using to connect to the database matches the character set the data is stored in. Try select db_property('charset'), which will tell you the character set. Then disconnect and reconnect using the charset connection parameter, documented here.