question

LawrenceChewJianShin-1430 avatar image
0 Votes"
LawrenceChewJianShin-1430 asked ErlandSommarskog commented

Cannot initialize the data source object of OLE DB provider "MSDASQL" for linked server "xxxx".

Hi, i try to create linked servers in sql server 2014 to get the data from sqlite, but it showing this error messages.

Msg 7399, Level 16, State 1, Line 10
The OLE DB provider "MSDASQL" for linked server "SYNCUSERSINFO" reported an error. The provider did not give any information about the error.
Msg 7303, Level 16, State 1, Line 10
Cannot initialize the data source object of OLE DB provider "MSDASQL" for linked server "SYNCFROMSQLITE".


Below is my ODBD configuration
114429-image.png


Below is my sql server linked server configuration
114389-image.png


sql-server-general
image.png (22.4 KiB)
image.png (113.8 KiB)
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

And how does the DSN for SQLite look like? Does it work on its own outside SQL Server?

Where is the database file for SQLite located? On the same machine as SQL Server, or on a network drive?

Rather than using the UI, run a query against the linked server from a query window. You will get the same error message, but there may be additional informational messages that gives more details about what is going wrong.

0 Votes 0 ·

Hi Erland,

the database file for sqlite is located in documents folder and it's same machine as sql server.
114450-image.png


i have used an alternative way to created the linked server from query window, it's success. but failed to retrieve data.
114456-image.png


0 Votes 0 ·
image.png (46.1 KiB)
image.png (107.2 KiB)

1 Answer

ErlandSommarskog avatar image
0 Votes"
ErlandSommarskog answered ErlandSommarskog commented

Unfortunately the were no additional error messages. This means that we are in the dark of what is going wrong. But an obvious guess is permissions. That is, the service account for SQL Server needs to have permission to your Documents folder and on the file itself.

I would put the database somewhere outside C:\Users, but that's me.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks a lot Erland! I have locate my sqlite database to another path, it's working now with select statement!

0 Votes 0 ·
ErlandSommarskog avatar image ErlandSommarskog LawrenceChewJianShin-1430 ·

Great to hear that it worked out!

0 Votes 0 ·