Thursday, March 8, 2012

Connecting to Access

Hello,
I am trying to connect to an Access database though Query Analyzer. The
help file is minimally helpful on this. This is what I have so far:
-- add the database as a linked server
execute sp_addlinkedserver Library,
'Access 2002',
'Microsoft.Jet.OLEDB.4.0',
'D:\today\Andrew\Library.mdb'
-- add a login to that server
execute sp_addlinkedsrvlogin Library,
false,
'EBSHQ\Andrew',
'Admin',
NULL
-- show servers
execute sp_linkedservers
-- do something
execute sp_tables_ex 'Library'
Here's where I get an error:
Bah, the server's out for a bit. I'll post the error when it comes back.
Without the error message, does anything above look wrong or out of
place?
Thanks,
AndrewHi
If you get something like:
Server: Msg 7399, Level 16, State 1, Procedure sp_tables_ex, Line 20
OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an error.
[OLE/DB provider returned message: Disk or network error.]
OLE DB error trace [OLE/DB Provider 'Microsoft.Jet.OLEDB.4.0'
IDBInitialize::Initialize returned 0x80004005: ].
0x80004005 indicates a permissions issue. You could have specified the wrong
file name as the linked server or the permission are such that you can not
see/open it.
John
"Andrew Clark" <lark047@.hotmail.com> wrote in message
news:1108168266. 8c16687f2eb892e2e3e7ff72d9cb5c72@.teranew
s...
> Hello,
> I am trying to connect to an Access database though Query Analyzer. The
> help file is minimally helpful on this. This is what I have so far:
> -- add the database as a linked server
> execute sp_addlinkedserver Library,
> 'Access 2002',
> 'Microsoft.Jet.OLEDB.4.0',
> 'D:\today\Andrew\Library.mdb'
> -- add a login to that server
> execute sp_addlinkedsrvlogin Library,
> false,
> 'EBSHQ\Andrew',
> 'Admin',
> NULL
> -- show servers
> execute sp_linkedservers
> -- do something
> execute sp_tables_ex 'Library'
> Here's where I get an error:
> Bah, the server's out for a bit. I'll post the error when it comes back.
> Without the error message, does anything above look wrong or out of
> place?
> Thanks,
> Andrew
>|||"John Bell" <jbellnewsposts@.hotmail.com> wrote in
news:eURHWJREFHA.1012@.TK2MSFTNGP14.phx.gbl:

> Hi
> If you get something like:
> Server: Msg 7399, Level 16, State 1, Procedure sp_tables_ex, Line 20
> OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an error.
> [OLE/DB provider returned message: Disk or network error.]
> OLE DB error trace [OLE/DB Provider 'Microsoft.Jet.OLEDB.4.0'
> IDBInitialize::Initialize returned 0x80004005: ].
> 0x80004005 indicates a permissions issue. You could have specified the
> wrong file name as the linked server or the permission are such that
> you can not see/open it.
> John
>
>
>
I think that might have been it, but I will have to check on monday
Andrew

No comments:

Post a Comment