Running an SQL statement with owner's permissions

G

Guest

Declan

Create a parallel workspace and open the current database
in it.

Set Owner_Ws = DBEngine.CreateWorkspace _
("WS100", "MyID", "MyPWD", dbUseJet)
Set Owner_Db = CurrentDb
Set is_Db = Owner_Ws.OpenDatabase(Owner_Db.Name)

Have a query already defined, eg qryMyQuery

Create your new SQL string in code, then overwrite the
queries SQL string and execute in your own workspace

is_db.QueryDefs.qryMyQuery.SQL = "SELECT ....."

As you created the original query. you own it. Therefore
you can run it.
-----Original Message-----
What code can I write that will run an SQL statement that
updates records in a table that the user of the database
program doesn't have permissions to update? Can I supply
my user name and password in code in order to run the SQL
statement?
 

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