Monday, February 13, 2012

attaching a ms access project file to SQL Server 2005 Express

I have some sample files from the Access Inside OUt 2003 book I want to
attach to my server. I can't figure out how to be able to connect to them
from the Server?
I can't connect to them from the SQL Server at all So I am trying to attach
them with this batch script.
I run this from the document window in SQL Server Management Studio :
sp_attach_db "ContactsSQL",
"C:\Microsoft Press\Access 2003 Inside Out\SQL\ContactsSQL.mdf",
"C:\Microsoft Press\Access 2003 Inside Out\SQL\ContactsSQL.ldf"
and I get this error message:
sg 5120, Level 16, State 101, Line 1
Unable to open the physical file "C:\Microsoft Press\Access 2003 Inside
Out\SQL\ContactsSQL.ldf". Operating system error 5: "5(Access is denied.)".
I changed the user account control to on so how can I read this access
project file from the SQL Server?
thanksHi
Have you checked that there is not a typing mistake in the batch file and
that you have the correct name for the log file? Check the file permissions
on each of these files. Alternatively you can rename the log file you have
and try sp_attach_single_file_db
John
"Janis" wrote:
> I have some sample files from the Access Inside OUt 2003 book I want to
> attach to my server. I can't figure out how to be able to connect to them
> from the Server?
> I can't connect to them from the SQL Server at all So I am trying to attach
> them with this batch script.
> I run this from the document window in SQL Server Management Studio :
> sp_attach_db "ContactsSQL",
> "C:\Microsoft Press\Access 2003 Inside Out\SQL\ContactsSQL.mdf",
> "C:\Microsoft Press\Access 2003 Inside Out\SQL\ContactsSQL.ldf"
> and I get this error message:
> sg 5120, Level 16, State 101, Line 1
> Unable to open the physical file "C:\Microsoft Press\Access 2003 Inside
> Out\SQL\ContactsSQL.ldf". Operating system error 5: "5(Access is denied.)".
> I changed the user account control to on so how can I read this access
> project file from the SQL Server?
> thanks|||Thanks for your answer. I tried some connections and then I ran the batch
and I get another response.
Msg 1801, Level 16, State 3, Line 1
Database 'ContactsSQL' already exists. Choose a different database name.
I don't understand what is going on here. So I have the contactsSQL
database supposed connected. I don't see any contact tables listed in the
database engine. I registered the connection. I have the Contacts access
project file open and the connection tested okay. I don't understand how
they are connected because there are no dbo.tables in the Access objects. I
am using Access 2008 and Vista.
"John Bell" wrote:
> Hi
> Have you checked that there is not a typing mistake in the batch file and
> that you have the correct name for the log file? Check the file permissions
> on each of these files. Alternatively you can rename the log file you have
> and try sp_attach_single_file_db
> John
> "Janis" wrote:
> > I have some sample files from the Access Inside OUt 2003 book I want to
> > attach to my server. I can't figure out how to be able to connect to them
> > from the Server?
> > I can't connect to them from the SQL Server at all So I am trying to attach
> > them with this batch script.
> >
> > I run this from the document window in SQL Server Management Studio :
> > sp_attach_db "ContactsSQL",
> > "C:\Microsoft Press\Access 2003 Inside Out\SQL\ContactsSQL.mdf",
> > "C:\Microsoft Press\Access 2003 Inside Out\SQL\ContactsSQL.ldf"
> >
> > and I get this error message:
> > sg 5120, Level 16, State 101, Line 1
> > Unable to open the physical file "C:\Microsoft Press\Access 2003 Inside
> > Out\SQL\ContactsSQL.ldf". Operating system error 5: "5(Access is denied.)".
> >
> > I changed the user account control to on so how can I read this access
> > project file from the SQL Server?
> > thanks|||One possibility:
Since you copied the *.mdf/*.ldf file from CD coming with the book, the
files are read-only. You need to clear the "Read ONly" bit first
(rigth-click the files and select "Properties").
"Janis" <Janis@.discussions.microsoft.com> wrote in message
news:5FA5913E-2B03-4756-88CB-FFC8AC8F27AB@.microsoft.com...
>I have some sample files from the Access Inside OUt 2003 book I want to
> attach to my server. I can't figure out how to be able to connect to them
> from the Server?
> I can't connect to them from the SQL Server at all So I am trying to
> attach
> them with this batch script.
> I run this from the document window in SQL Server Management Studio :
> sp_attach_db "ContactsSQL",
> "C:\Microsoft Press\Access 2003 Inside Out\SQL\ContactsSQL.mdf",
> "C:\Microsoft Press\Access 2003 Inside Out\SQL\ContactsSQL.ldf"
> and I get this error message:
> sg 5120, Level 16, State 101, Line 1
> Unable to open the physical file "C:\Microsoft Press\Access 2003 Inside
> Out\SQL\ContactsSQL.ldf". Operating system error 5: "5(Access is
> denied.)".
> I changed the user account control to on so how can I read this access
> project file from the SQL Server?
> thanks|||When I try to Use the database then I get this message:
Msg 911, Level 16, State 1, Line 1
Could not locate entry in sysdatabases for database 'contacts'. No entry
found with that name. Make sure that the name is entered correctly.
So it appears I haven't really connected to the database even though it
passed the connection test.
"John Bell" wrote:
> Hi
> Have you checked that there is not a typing mistake in the batch file and
> that you have the correct name for the log file? Check the file permissions
> on each of these files. Alternatively you can rename the log file you have
> and try sp_attach_single_file_db
> John
> "Janis" wrote:
> > I have some sample files from the Access Inside OUt 2003 book I want to
> > attach to my server. I can't figure out how to be able to connect to them
> > from the Server?
> > I can't connect to them from the SQL Server at all So I am trying to attach
> > them with this batch script.
> >
> > I run this from the document window in SQL Server Management Studio :
> > sp_attach_db "ContactsSQL",
> > "C:\Microsoft Press\Access 2003 Inside Out\SQL\ContactsSQL.mdf",
> > "C:\Microsoft Press\Access 2003 Inside Out\SQL\ContactsSQL.ldf"
> >
> > and I get this error message:
> > sg 5120, Level 16, State 101, Line 1
> > Unable to open the physical file "C:\Microsoft Press\Access 2003 Inside
> > Out\SQL\ContactsSQL.ldf". Operating system error 5: "5(Access is denied.)".
> >
> > I changed the user account control to on so how can I read this access
> > project file from the SQL Server?
> > thanks|||Hi Janis
In one post you call the database contacts and the other contactsSQL.
John
"Janis" wrote:
> When I try to Use the database then I get this message:
> Msg 911, Level 16, State 1, Line 1
> Could not locate entry in sysdatabases for database 'contacts'. No entry
> found with that name. Make sure that the name is entered correctly.
> So it appears I haven't really connected to the database even though it
> passed the connection test.
> "John Bell" wrote:
> > Hi
> >
> > Have you checked that there is not a typing mistake in the batch file and
> > that you have the correct name for the log file? Check the file permissions
> > on each of these files. Alternatively you can rename the log file you have
> > and try sp_attach_single_file_db
> >
> > John
> >
> > "Janis" wrote:
> >
> > > I have some sample files from the Access Inside OUt 2003 book I want to
> > > attach to my server. I can't figure out how to be able to connect to them
> > > from the Server?
> > > I can't connect to them from the SQL Server at all So I am trying to attach
> > > them with this batch script.
> > >
> > > I run this from the document window in SQL Server Management Studio :
> > > sp_attach_db "ContactsSQL",
> > > "C:\Microsoft Press\Access 2003 Inside Out\SQL\ContactsSQL.mdf",
> > > "C:\Microsoft Press\Access 2003 Inside Out\SQL\ContactsSQL.ldf"
> > >
> > > and I get this error message:
> > > sg 5120, Level 16, State 101, Line 1
> > > Unable to open the physical file "C:\Microsoft Press\Access 2003 Inside
> > > Out\SQL\ContactsSQL.ldf". Operating system error 5: "5(Access is denied.)".
> > >
> > > I changed the user account control to on so how can I read this access
> > > project file from the SQL Server?
> > > thanks|||You are right again. thanks, I thought they were all access files. I just
looked at the extensions and it is a SQL Server file which I attached to. I
still haven't gotten connected to the adp file yet but I thought I did.
Thanks for noticing it.
"John Bell" wrote:
> Hi Janis
> In one post you call the database contacts and the other contactsSQL.
> John
> "Janis" wrote:
> > When I try to Use the database then I get this message:
> > Msg 911, Level 16, State 1, Line 1
> > Could not locate entry in sysdatabases for database 'contacts'. No entry
> > found with that name. Make sure that the name is entered correctly.
> >
> > So it appears I haven't really connected to the database even though it
> > passed the connection test.
> >
> > "John Bell" wrote:
> >
> > > Hi
> > >
> > > Have you checked that there is not a typing mistake in the batch file and
> > > that you have the correct name for the log file? Check the file permissions
> > > on each of these files. Alternatively you can rename the log file you have
> > > and try sp_attach_single_file_db
> > >
> > > John
> > >
> > > "Janis" wrote:
> > >
> > > > I have some sample files from the Access Inside OUt 2003 book I want to
> > > > attach to my server. I can't figure out how to be able to connect to them
> > > > from the Server?
> > > > I can't connect to them from the SQL Server at all So I am trying to attach
> > > > them with this batch script.
> > > >
> > > > I run this from the document window in SQL Server Management Studio :
> > > > sp_attach_db "ContactsSQL",
> > > > "C:\Microsoft Press\Access 2003 Inside Out\SQL\ContactsSQL.mdf",
> > > > "C:\Microsoft Press\Access 2003 Inside Out\SQL\ContactsSQL.ldf"
> > > >
> > > > and I get this error message:
> > > > sg 5120, Level 16, State 101, Line 1
> > > > Unable to open the physical file "C:\Microsoft Press\Access 2003 Inside
> > > > Out\SQL\ContactsSQL.ldf". Operating system error 5: "5(Access is denied.)".
> > > >
> > > > I changed the user account control to on so how can I read this access
> > > > project file from the SQL Server?
> > > > thanksJoh

No comments:

Post a Comment