SQL connection to server with QlikView - qlikview

I want to connect to a server to obtain data with QlikView, unfortunately I have this error:
ErrorSource: Microsoft OLE DB Provider for ODBC Drivers, ErrorMsg: [Microsoft][Gestionnaire de pilotes ODBC] Valeur d'argument non valide OLEDB CONNECT TO [Provider=MSDASQL.1;Persist Security Info=False;Extended Properties="DRIVER=KISAM 32 bit driver;UID=wamr;SERVER=x.x.x.x,790;DBNAME=theName;SHCOL=Y;LUID=wamr;"]
Can you help me please ?

Putting my comment as an answer;
Did QV create that connection string? If not try to recreate the connection string in the script editor by selecting OLEDB, press connect and insert connection details.

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"

Connecting to integrated SQL Server in Visual Studio 2016

I'm trying to use OLE DB to connect to the SQL Server that shipped with VS2015 (this should be SQL Server Express I think). Actually I have problems getting my connection string set up. All my attempts resulted in a generic error message.
The errors occurred with this line of code afterwards:
oCon = New OleDbConnection(cConnectstring)
I tried following connection strings:
Server=localhost;Database=main_Table;Trusted_Connection=True;
As well as:
Provider=SQLNCLI11;Data Source=(localdb)\MSSQLLocalDB;DataTypeCompatibility=80;Initial Catalog=main_Table;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=True;ApplicationIntent=ReadWrite;MultiSubnetFailover=False
Or:
Provider = sqloledb;Data Source=(localdb)\MSSQLLocalDB; Initial Catalog = main_Table;Integrated Security=SSPI;
where main_Table is the table I try to start with. I used the connection string that I get via right click on that table in the DB explorer as well (that worked for my Access DBs flawlessly).
Does anybody know how to make this work with Ole DB and SQL Server 2016?
Thanks.

VBSCRIPT connection to Oracle failing due to driver

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>

ODBC Linked server in sql 2005 doesn’t work from remote box

I have a dev workstation with sql 2005 installed and in it I created a linked server to a odbc connection to a clarion database. I can run select statements against it inside sql Mgt studio. When I take a second workstation and connect to the sql on the first box using sql mgt studio, then try the exact same query I get
OLE DB provider "MSDASQL" for linked server "liveclarion" returned message "[SoftVelocity Inc.][TopSpeed ODBC Driver][ISAM]ISAM Table Not Found".
Any thoughts? It appears to have the same functionality on a second sql server. No remote sql mgt studio connect success in queries against my linked ODBC clarion DB.
All done with windows authentication and the same AD user.
The error returned by the ODBC driver is "SAM table not found".
So I'm assuming you have a table called SAM - presumably in a table called Sam.Tps?
I'm wondering if you need to set a path to that file - ie if there's some difference in path or file name validity between your two tests. One assumes not, but I'd look in that direction first.

how to import data from DBF to SQL using SQL script?

I am trying to import data from DBF file to SQL table using the following command -
select *
from openrowset('MSDASQL',
'Driver={Microsoft dBase Driver (*.dbf)};DBQ=E:\data\;',
'select * from E:\data\a.dbf')
But it is failing saying
OLE DB provider "MSDASQL" for linked server "(null)" returned message "[Microsoft][ODBC dBase Driver]General Warning Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x120 Thread 0x3084 DBC 0x303dfbc Xbase'.".
OLE DB provider "MSDASQL" for linked server "(null)" returned message "[Microsoft][ODBC dBase Driver] Disk or network error.".
Msg 7303, Level 16, State 1, Line 1
Cannot initialize the data source object of OLE DB provider "MSDASQL" for linked server "(null)".
Any clue why it is giving error? For the second error I have given full access to temp folder as suggested by some blog. Still it is showing both error.
If filename is a .dbf
Try this:
select * from
openrowset('MSDASQL',
'Driver={Microsoft dBASE Driver (*.dbf)};DriverID=277;Dbq=E:\Data;',
'SELECT * FROM a')
Your SELECT is specifying the path to the file - you should be specifying the table name instead, which is presumably 'a'.
To supplement CodeByMoonlight, the Driver information points to the path the data file is found, so then your subsequent query should only be "Select * should from a" since both the path and the .dbf extension should be implied
You are using 64-bit SQL Server which is looking to the 64-bit ODBC sources when the drivers are 32-bit. There is a workaround for FoxPro (also DBF) that should work for dBASE as well:
Open a new SqlDataSource in Visual Studio using the .NET Framework Provider for OLE DB then MS OLE DB Provider for VFP. The connection string should look like this (or with UNC)
Provider=VFPOLEDB.1;Data Source=h:\Programs\Data;Persist Security Info=True;User ID=Your_user;Password=your_password
The config wizard includes a part to test your SQL. You can use this run ad hoc SQL.