Error while connecting with QRemote using QODBC - sql

Getting this error in SQL Server at a time of connecting to QREMOTE using QODBC
OLE DB provider "MSDASQL" for linked server "QREMOTE" returned message "Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.

Please go to QODBC Setup screen --> Advanced tab --> Maximum Field Name Length --> Set " Maximum Field Name Length" to 70.
Also, Please Configure MSDASQL (Microsoft OLE DB Provider for ODBC Drivers)
[Note: MS SQL Express Edition do not have this setup options!!! ]
The OLE DB provider options for managing linked queries can be set in SQL Server Management Studio. In Object Explorer , right-click the provider name and select Properties for MSDASQL.
http://support.flexquarters.com/esupport/newimages/QRemoteSQLServer64Bit/image025.png
Dynamic parameter should be checked to allow parameter queries. Level zero only should be checked to allow four part naming to work. Allow InProcess should be checked to help performance.Non transacted updates should be checked if you want to be able to update QuickBooks data. Index as access path should be checked to help performance. Disallow adhoc accesses should be unchecked to allow OPENQUERY to function.
http://support.flexquarters.com/esupport/newimages/QRemoteSQLServer64Bit/image027.jpg
I would also like to suggest you to refer below mentioned link:
http://support.flexquarters.com/esupport/index.php?/Default/Knowledgebase/Article/View/2458/52/how-to-create-link-server-with-ms-sql-200520082012-64-bit-using-qodbcqremote
If you are still facing issue please create a support ticket at http://support.qodbc.com

Related

Multiple-step OLE DB operation generated errors...SSIS VS2005 Business Development Studio

When developing SSIS package using VS 2005, I set up the connection manager for oledb teradata provider and added a oledb source and destination. For oledb source, I used the data access mode as sql command and added sql command text. But when I tried to do column mapping, I'm getting an error message which is detailed below.
Error at All Transactions [OLEDB Source [1627]]:
An OLEDB error has occurred. Error code: 0x80040E21.
An OLE DB record is available. Source: "OLE DB Provider for Teradata" Hresult:
0x80040E21 Description: "Multiple-step OLE DB operation generated errors. Check
each OLE DB status value, if available. No work was done.".
ADDITIONAL INFORMATION:
Exception from HRESULT: 0xC0202009 (Microsoft.SqlServer.DTSPipelineWrap)
BUTTONS:
OK
Please let me know why such error throws. I have a workaround which is described as follows.
when you store the sql within ( and ) and alias the query and set the data access mode as table name or view name variable, then it works fine.
Without any more information on the SQL being used in the OLEDB Source component, I can try and guess. Maybe the issue is with the SQL that is returning columns with the same name or similar situation that leads to incorrect metadata.
I just got this error and I simply edited the provider to a different provider, tested, and then set it back to the original provider. In my case I was using OLEDB Native client 11 so I set it to 10 and then back to 11.
My guess is the XML got corrupted somehow as my package has been working forever.

Using linked server returns error - "Cannot obtain the schema rowset for OLE DB provider"

I tried to move data aka ETL from one sql server to another as mentioned in a previous question - Copy data from one column into another column. Now, I get an error when I try to execute a query.
Query -
INSERT INTO [Target_server].[Target_DB1].[dbo].[Target_Table1](Target_Column1)
SELECT Source_Column222
FROM [Source_server].[Source_DB1].[dbo].[Source_Table1]
WHERE Source_Column1 = 'ID7162'
Error -
OLE DB provider "SQLNCLI" for linked server "MYLINKEDSERVER" returned message "Unspecified error".
OLE DB provider "SQLNCLI" for linked server "MYLINKEDSERVER" returned message "The stored procedure required to complete this operation could not be found on the server. Please contact your system administrator.".
Msg 7311, Level 16, State 2, Line 1
Cannot obtain the schema rowset "DBSCHEMA_TABLES_INFO" for OLE DB provider "SQLNCLI" for linked server "MYLINKEDSERVER". The provider supports the interface, but returns a failure code when it is used.
If your wrote that simple select is not working, the issue is in security configuration of the linked server and permissions which your user receive there.
Among this, when you execution your query, you don't need to specify the server name and DB name for both parts - source and target. You simply need to execute the query on target server and target database. In this case your query instead of
INSERT INTO [Target_server].[Target_DB1].[dbo].[Target_Table1](Target_Column1)
SELECT Source_Column222
FROM [Source_server].[Source_DB1].[dbo].[Source_Table1]
WHERE Source_Column1 = 'ID7162'
will looks like the following:
INSERT INTO [dbo].[Target_Table1](Target_Column1)
SELECT Source_Column222
FROM [Source_server].[Source_DB1].[dbo].[Source_Table1]
WHERE Source_Column1 = 'ID7162'
and you need your connection to be opened on server [Target_server] and database [Target_DB1]. Also the linked server security properties need to be checked on [Target_server] against the [Source_server].
If you are using loop back linked server (linked server refering to the same database in the same server) then refer the below mentioned link:
Transaction with loopback linked server - locking issues
If that is not the case, this is the solution provided by Microsoft.

Import Excel 2010 to Sql Server 2008

I am using Excel 2010 and sql server 2008 to import the data from excel to sql server. But am unsuccessful. Can you please check the way i am doing ?
sp_CONFIGURE 'show advanced options',1
RECONFIGURE
GO
sp_CONFIGURE 'optimize for ad hoc workloads',1
RECONFIGURE
GO
sp_configure 'Ad Hoc Distributed Queries', 1
GO
RECONFIGURE
SELECT * FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0','Excel 12.0;Database=C:\Users\anayak\AppData\Roaming\Microsoft\Templates\Book1.xlsx; HDR=YES;IMEX=1','SELECT * FROM [sheet1$]');
where i am getting this error
OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)" returned message "Unspecified error".
Msg 7303, Level 16, State 1, Line 1
Cannot initialize the data source object of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)".
I installed the Microsoft Access Database Engine 2010 Redistributable for Microsoft.ACE.OLEDB.12.0.
But when i use the command "ODBCAD32.EXE" to check the version of my excel then i am getting 14.00.4760.1000.
Then i tried my connection string to -
SELECT * FROM OPENROWSET('Microsoft.ACE.OLEDB.14.0','Excel 14.0;Database=C:\Users\anayak\AppData\Roaming\Microsoft\Templates\Book1.xlsx; HDR=YES;IMEX=1','SELECT * FROM [sheet1$]');
but again it didnt work.
Can you please suggest what i am doing wrong here ?
Thanks.
Re: 7303 error
Distributed Queries in SQL Server, data from XLS
So your main error is likely this;
OLE DB provider "MICROSOFT.JET.OLEDB.4.0" for linked server "(null)" returned message "Unspecified error".
Msg 7303, Level 16, State 1, Line 1
Cannot initialize the data source object of OLE DB provider "MICROSOFT.JET.OLEDB.4.0" for linked server "(null)".
I would check some permissions.
Check the permissions on the Temp folder
This is needed because the provider uses the temp folder while retrieving the data. The folder can be one of the below based on whether you use a local system account or network domain account.
For network accounts, folder is
\Windows\ServiceProfiles\NetworkService\AppData\Local\Temp
and for local system account its \Windows\ServiceProfiles\LocalService\AppData\Local\Temp
Right click on this folder and give it read write access to the account (or group) executing the code. That solved the error for me.
Also
http://blogs.msdn.com/b/spike/archive/2008/07/23/ole-db-provider-microsoft-jet-oledb-4-0-for-linked-server-null-returned-message-unspecified-error.aspx
This is because the SQL Server Service is trying to write the temp DSN to the temp folder for the login that started the service, in this case the Admin/Admin login.
The temp folder is something like: C:\Documents and Settings\Admin\Local Settings\Temp
.15 As mentioned, the OleDbProvider will always execute in the context of the user who initialized it, in this case User/User.
.16 User/User has no rights on this folder (C:\Documents and Settings\Admin\Local Settings\Temp).
If running FileMon when the SQL is executed, we can see the following:
(Actually, try using Process Monitor - http://technet.microsoft.com/en-us/sysinternals/bb896645)
sqlservr.exe:000 QUERY INFORMATION C:\DOCUME~1\Admini~1\LOCALS~1\Temp ACCESS DENIED Attributes: Error
So to summarize so far:
The SQL Server service is started as Admin/Admin, when the select is made, the OleDb provider is invoked by User/User.
Now the OleDb provider attempts to create a temporary DSN in the temp directory. This will be the temp directory for the SQL Server service (Admin/Admin)
but the user (in this case User/User) does not have write permissions on this folder. And the error occurs.
There are two ways to resolve this.
Option 1:
Log out of the machine and log in as the account that starts the SQL Server Service (in this case Admin/Admin) then start a command prompt
and type “set t” (no quotes), this will show something like:
TEMP=C:\DOCUME~1\Admin\LOCALS~1\Temp
TMP=C:\DOCUME~1\Admin\LOCALS~1\Temp
these are the environment variables set for %TEMP% and %TMP%, so go to that folder and right click and select Properties -> Security,
then add the user, in this case User/User, note that the default for the user is Read&Execute/List Folder Content/Read, this not enough, you have to select Write as well.
Log out, and log in again as User/User and rerun the command from SSMS. This time it should work.
Option 2:
Log on as Admin and change the TEMP and TMP variable to, for example, C:\Temp, basically this moves the Temp directory out of the Documents and Settings folder.
However, you must restart the SQL server for this to take effect.
So basically, what happens is that when SQL Server starts, it uses the Temp folder of the startup account (Admin/Admin) but the MICROSOFT.JET.OLEDB.4.0 will always execute
as the user who calls the SQL command (User/User) and this will fail unless this user does not have Write access to that temp folder.
Without knowing all setups out there, perhaps option 2 is the preferred solution since with option 1, you will have to add ALL the users that will invoke the provider which may not be practical.
Also, when changing the startup account for the SQL Server service, then the TEMP directory for that account will be used, and you will see the error again until you, again, give write permissions for all the users on this TEMP folder...or a user group (preferred).

what would cause a linked server to return a limited amount of data?

We are having an issue with a server that we linked to our sql server 2012 instance.
The server that we linked through an odbc or oledb connection is Pervasive SQL.
Selecting from the linked server this way works as long as the result set is small:
select * from linked_server.database..mytable
If the result set is more than around 2mb (might be slightly more or less) then we get this error:
Msg 7399, Level 16, State 1, Line 1
The OLE DB provider "MSDASQL" for linked server "KSLAP208" reported an error. The provider reported an unexpected catastrophic failure.
Msg 7330, Level 16, State 2, Line 1
Cannot fetch a row from OLE DB provider "MSDASQL" for linked server "KSLAP208".
However, the silly thing is that SSMS 2012 for instance displays all the columns that need to be returned and then immediatley errors out.
What would cause SSMS 2012 to produce an error on a result set that is too big? (more than 1-2mb)??
here's what i see in the odbc administrator:
Option 1, disable pre-fetch
Sometimes, disabling pre-fetch will solve problems like this.
You can disable the prefetch by clearing the "Enable pre-fetch of data
for queries" check box in the Performance tab when creating a DSN or
adding "PREFETCH=0" to the connection string when creating a DSN-less connection.
More on this:
In the ODBC Data Source Administrator panel on the server, configure
your linked server from System DSN. Under the Performance tab, uncheck
the box 'Enable pre-fetch of data for queries'. OK, OK. Delete and
re-create your linked server in SQL Management Studio.
Source
Option 2, Allow inprocess
Go to Linked Servers
Providers
MSOLAP (or similar)
Properties
Make sure "Allow inprocess" is enabled. Even if it is, turn it off. Save. And then turn it back on. Sometimes resetting this can help.

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.