Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Базы";
Текущий архив: 2002.09.23;
Скачать: [xml.tar.bz2];

Вниз

Перкачка данных из SQL Server в Access с пом. SQL-запросов (2)   Найти похожие ветки 

 
Nikolai_S   (2002-08-30 18:26) [0]

В SQL-server есть системная процедура sp_addlinkedserver для подключения других СУБД. Но если нету достаточных прав на SQL-сервере, то данный метод не годится.

Поэтому вопрос: можно ли подобным образом из MS Access подключиться к SQL Server"у, чтобы с пом. SQL-запросов считывать и вставлять из него данные?


 
kig   (2002-08-30 18:56) [1]

Может это подойдет

OPENROWSET
Includes all connection information necessary to access remote data from an OLE DB data source. This method is an alternative to accessing tables in a linked server and is a one-time, ad hoc method of connecting and accessing remote data using OLE DB. The OPENROWSET function can be referenced in the FROM clause of a query as though it is a table name. The OPENROWSET function can also be referenced as the target table of an INSERT, UPDATE, or DELETE statement, subject to the capabilities of the OLE DB provider. Although the query may return multiple result sets, OPENROWSET returns only the first one.


Use the Microsoft OLE DB Provider for Jet
This example accesses the orders table in the Microsoft Access Northwind database through the Microsoft OLE DB Provider for Jet.

USE pubs
GO
SELECT a.*
FROM OPENROWSET("Microsoft.Jet.OLEDB.4.0",
"c:\MSOffice\Access\Samples\northwind.mdb";"admin";"mypwd", Orders)
AS a
GO


Use OPENROWSET and another table in an INNER JOIN
This example selects all data from the customers table from the local SQL Server Northwind database and from the orders table from the Access Northwind database stored on the same computer.


USE pubs
GO
SELECT c.*, o.*
FROM Northwind.dbo.Customers AS c INNER JOIN
OPENROWSET("Microsoft.Jet.OLEDB.4.0",
"c:\MSOffice\Access\Samples\northwind.mdb";"admin";"mypwd", Orders)
AS o
ON c.CustomerID = o.CustomerID
GO





 
Nikolai_S   (2002-09-02 12:12) [2]

Я попробовал этот способ. Под sa работает, а под другими пользователями пишет:
"Ad hoc access to OLE DB provider "Microsoft.Jet.OLEDB.4.0" has been denied. You must access this provider through a linked server."


 
Nikolai_S   (2002-09-02 17:15) [3]

Потом, я подумал, что все же правильнее цеплять данные из Access, т.к. чтобы из SQL-server"а данные записывать в Access"скую базу, которая находится где-то в сети и нужно делать директорию, где она хранится, c доступной по сети. А это лишние извращения. Из Access будет логичнее



Страницы: 1 вся ветка

Форум: "Базы";
Текущий архив: 2002.09.23;
Скачать: [xml.tar.bz2];

Наверх




Память: 0.45 MB
Время: 0.008 c
3-73529
bib
2002-09-02 18:37
2002.09.23
Помогите!


3-73500
RDA
2002-09-01 13:01
2002.09.23
AutoCommit в TpFIBDataSet


1-73736
iNew
2002-09-11 16:33
2002.09.23
Ругается на uCallbackMessage:=wm_user+1; говорит undeclared


14-73872
AL2002
2002-08-29 13:42
2002.09.23
Как расшифровывается УБОП?


6-73789
DrKot
2002-07-19 16:47
2002.09.23
Тунелирование трафика через HTTP proxy





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский