Database Module

R

Rick

How do I access a database with a module that is contained in the database? I
keep getting a message that the database is being used. I can access a
database from another database but not from the database that contains the
module. Thanks for your assistance.
 
R

Rick

Hi Alex,

Thanks for your reply. I set up a System DSN for database XYZ in ODBC using
Microsoft Access Driver. I go into XYZ and create a sub procedure to update a
table in XYZ and when I run the procedure I get: {Error: -2147467259 -
[Microsoft][ODBC Microsoft Access Driver] The database has been placed in a
state by an unknown user that prevents it from being opened or locked}. The
error occurs at the .ActiveConnection statement in the sub procedure. I can
run the sub procedure in XYZ against a table in database ABC (a copy of XYZ)
but not in XYZ. I hope this defines the problem a little more clearly.
 
A

Alex Dybenko

Hi,
could be that you have this database opened exclusively - try to check this.
Then you don't need to use ODBC, use instead:
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" currentdb.name & ";User
Id=admin;Password=;"

--
Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com


Rick said:
Hi Alex,

Thanks for your reply. I set up a System DSN for database XYZ in ODBC
using
Microsoft Access Driver. I go into XYZ and create a sub procedure to
update a
table in XYZ and when I run the procedure I get: {Error: -2147467259 -
[Microsoft][ODBC Microsoft Access Driver] The database has been placed in
a
state by an unknown user that prevents it from being opened or locked}.
The
error occurs at the .ActiveConnection statement in the sub procedure. I
can
run the sub procedure in XYZ against a table in database ABC (a copy of
XYZ)
but not in XYZ. I hope this defines the problem a little more clearly.

--
Rick


Alex Dybenko said:
No so clear what are you trying to achieve, try to post a code you are
using
here

--
Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com
 
R

Rick

Hi Alex,

I don't appear to opening the database with an open exclusive. Open
exclusive is not selected for this database..


--
Rick


Alex Dybenko said:
Hi,
could be that you have this database opened exclusively - try to check this.
Then you don't need to use ODBC, use instead:
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" currentdb.name & ";User
Id=admin;Password=;"

--
Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com


Rick said:
Hi Alex,

Thanks for your reply. I set up a System DSN for database XYZ in ODBC
using
Microsoft Access Driver. I go into XYZ and create a sub procedure to
update a
table in XYZ and when I run the procedure I get: {Error: -2147467259 -
[Microsoft][ODBC Microsoft Access Driver] The database has been placed in
a
state by an unknown user that prevents it from being opened or locked}.
The
error occurs at the .ActiveConnection statement in the sub procedure. I
can
run the sub procedure in XYZ against a table in database ABC (a copy of
XYZ)
but not in XYZ. I hope this defines the problem a little more clearly.

--
Rick


Alex Dybenko said:
No so clear what are you trying to achieve, try to post a code you are
using
here

--
Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com

How do I access a database with a module that is contained in the
database? I
keep getting a message that the database is being used. I can access a
database from another database but not from the database that contains
the
module. Thanks for your assistance.
 
A

Alex Dybenko

ok, so if you open connection with following connection string - will it
work at you?
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" currentdb.name & ";User
Id=admin;Password=;"


--
Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com


Rick said:
Hi Alex,

I don't appear to opening the database with an open exclusive. Open
exclusive is not selected for this database..


--
Rick


Alex Dybenko said:
Hi,
could be that you have this database opened exclusively - try to check
this.
Then you don't need to use ODBC, use instead:
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" currentdb.name & ";User
Id=admin;Password=;"

--
Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com


Rick said:
Hi Alex,

Thanks for your reply. I set up a System DSN for database XYZ in ODBC
using
Microsoft Access Driver. I go into XYZ and create a sub procedure to
update a
table in XYZ and when I run the procedure I get: {Error: -2147467259 -
[Microsoft][ODBC Microsoft Access Driver] The database has been placed
in
a
state by an unknown user that prevents it from being opened or locked}.
The
error occurs at the .ActiveConnection statement in the sub procedure. I
can
run the sub procedure in XYZ against a table in database ABC (a copy of
XYZ)
but not in XYZ. I hope this defines the problem a little more clearly.

--
Rick


:

No so clear what are you trying to achieve, try to post a code you are
using
here

--
Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com

How do I access a database with a module that is contained in the
database? I
keep getting a message that the database is being used. I can access
a
database from another database but not from the database that
contains
the
module. Thanks for your assistance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top