Quantcast
Channel: Forum SQL Server Database Engine
Viewing all articles
Browse latest Browse all 15889

Declared path to databasefile and using it in query

$
0
0

Hallo all!

I declared path to databasefile and when i use it in query, it does not work, MSSQL Server Management Studio says: "OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)" returned message "Not a valid file name."." Script here:

DECLARE @baasitabel varchar(13)
set @baasitabel = 'c:\SY0413.MDB';

SELECT [Nimi],[Times],[Sum_Tim],[Kuup],[Remark] FROM OPENROWSET
('Microsoft.Jet.OLEDB.4.0','" + @baasitabel + "';'admin';'', KuutabelT) as kuuandmed
where [Osak NR]=2


When i use path in query, all works perfectly, but in other case i need use another databasefile... There is path in query:
('Microsoft.Jet.OLEDB.4.0','C:\SY0413.MDB';'admin';'', KuutabelT) as kuuandmed


Viewing all articles
Browse latest Browse all 15889

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>