Showing posts with label sqloledb. Show all posts
Showing posts with label sqloledb. Show all posts

Monday, March 26, 2012

query from different sql servers

how can i get data from different sqlservers in tsql.
is there anyway different from below
Select * from opendatasource('SQLOLEDB','Data Source=...;User
ID=...;Password=...').dbname.dbo.tblname
Sabri,
From the SQL BOL:
This example accesses data from a table on another instance of SQL Server.
SELECT *
FROM OPENDATASOURCE(
'SQLOLEDB',
'Data Source=ServerName;User ID=MyUID;Password=MyPass'
).Northwind.dbo.Categories
HTHJerry"Sabri AKIN" <SabriAKIN@.discussions.microsoft.com> wrote in message
news:29DFD275-8D2B-438C-8BFF-9C9B743EFC76@.microsoft.com...
> how can i get data from different sqlservers in tsql.
> is there anyway different from below
> Select * from opendatasource('SQLOLEDB','Data Source=...;User
> ID=...;Password=...').dbname.dbo.tblname
>
sql

query from different sql servers

how can i get data from different sqlservers in tsql.
is there anyway different from below
Select * from opendatasource('SQLOLEDB','Data Source=...;User
ID=...;Password=...').dbname.dbo.tblnameSabri,
From the SQL BOL:
This example accesses data from a table on another instance of SQL Server.
SELECT *
FROM OPENDATASOURCE(
'SQLOLEDB',
'Data Source=ServerName;User ID=MyUID;Password=MyPass'
).Northwind.dbo.Categories
HTHJerry"Sabri AKIN" <SabriAKIN@.discussions.microsoft.com> wrote in message
news:29DFD275-8D2B-438C-8BFF-9C9B743EFC76@.microsoft.com...
> how can i get data from different sqlservers in tsql.
> is there anyway different from below
> Select * from opendatasource('SQLOLEDB','Data Source=...;User
> ID=...;Password=...').dbname.dbo.tblname
>

Wednesday, March 7, 2012

Query cannot be updated because the FROM clause

Hi everybody,

I have a problem. My provider(ISP) is supporting SQL Native Client driver and my forum supplier is only supporting SQLOLEDB. I am trying to access our sql2005 DB located at our ISP.

I have changed this line:

strCon = "Provider=SQLOLEDB;Connection Timeout=90;" & strCon

To:
strCon = "Driver={SQL Native Client};Connection Timeout=90;" & strCon

Now I can access the database, but when I am trying to loging I get this error:

Server Error in Forum Application
An error has occured while writing to the database.
Please contact the forum administrator.

Support Error Code:- err_SQLServer_loginUser()_update_USR_Code
File Name:- functions_login.asp

Error details:-
Microsoft OLE DB Provider for ODBC Drivers
Query cannot be updated because the FROM clause is not a single simple table name.

What can I do? I am stuck in between and need a solution.....

Regards Gerry!



This is usually because you created an ADODB.Recordset, grabbed a query that JOINed two or more tables, and then attempted to perform an AddNew or Update through the recordset object. To resolve this issue, use an INSERT or UPDATE statement directly against the connection object, and if using SQL Server, use a stored procedure call.|||

"SQL Native Client" contains both a new ODBC driver and OLEDB provider for SQL 2005.

My guess is that the problem is caused by chaning from a straight OLEDB provider to OLEDB for ODBC + SQL Native client ODBC driver. Can you try changing your connect string as follows:

strCon = "Provider=SQLNCLI;Connection Timeout=90;" & strCon

Query cannot be updated because the FROM clause

Hi everybody,

I have a problem. My provider(ISP) is supporting SQL Native Client driver and my forum supplier is only supporting SQLOLEDB. I am trying to access our sql2005 DB located at our ISP.

I have changed this line:

strCon = "Provider=SQLOLEDB;Connection Timeout=90;" & strCon

To:
strCon = "Driver={SQL Native Client};Connection Timeout=90;" & strCon

Now I can access the database, but when I am trying to loging I get this error:

Server Error in Forum Application
An error has occured while writing to the database.
Please contact the forum administrator.

Support Error Code:- err_SQLServer_loginUser()_update_USR_Code
File Name:- functions_login.asp

Error details:-
Microsoft OLE DB Provider for ODBC Drivers
Query cannot be updated because the FROM clause is not a single simple table name.

What can I do? I am stuck in between and need a solution.....

Regards Gerry!



This is usually because you created an ADODB.Recordset, grabbed a query that JOINed two or more tables, and then attempted to perform an AddNew or Update through the recordset object. To resolve this issue, use an INSERT or UPDATE statement directly against the connection object, and if using SQL Server, use a stored procedure call.|||

"SQL Native Client" contains both a new ODBC driver and OLEDB provider for SQL 2005.

My guess is that the problem is caused by chaning from a straight OLEDB provider to OLEDB for ODBC + SQL Native client ODBC driver. Can you try changing your connect string as follows:

strCon = "Provider=SQLNCLI;Connection Timeout=90;" & strCon