Re: External .mdb inside Forms

From: Henry (Henry_at_discussions.microsoft.com)
Date: 12/17/04


Date: Fri, 17 Dec 2004 15:49:02 -0800

That jutst worked perfectly ! I even opened a form with external data that way.

(I knew, one day I will be force to play with sql syntax ;-)

Now, when closing the form, I want to write the selected record back to the
external .mdb like:

Private Sub Form_Close()
If Me.Dirty Then
        DoCmd.RunSQL "UPDATE Employees.......

But how would I write a complete record ?

"Dirk Goldgar" wrote:

> "Henry" <Henry@discussions.microsoft.com> wrote in message
> news:E31EC62C-39B4-4980-A721-47DF60457916@microsoft.com
> > I would like to use the
> >
> > Set appAccess = CreateObject("Access.Application")
> > appAccess.OpenCurrentDatabase file, , pwd
> >
> > DAO method to view an external table inside a listbox and than open a
> > record in a form and manipulate the data.
> >
> > Of course I could just import the table, but for security I can't do
> > this, because this way you have unprotected access to passwd
> > protected .mdb files.
>
> You can set a form's recordsource or a combo box's rowsource to a SQL
> statement that selects data from an external MDB, specifying the
> database password. For example,
>
> SELECT * FROM SomeTable
> IN "" "MS Access;database=C:\Temp\SomeDB.mdb;pwd=foo";
>
> Note that this method can be used if the external database is secured
> using a database password, which is a much simpler form of security --
> and easier to crack -- than user-level (workgroup) security.
>
> Note also that, if you hard-code your password in a rowsource or
> recordsource, that password isn't going to stay secret very long. You
> may be able to encrypt the password in your local database, then decrypt
> it and build the record/rowsource on the fly for a *little* more
> security, but this is fundamentally insecure and I don't think there's
> anything you can do about it short of applying user-level security
> instead.
>
> --
> Dirk Goldgar, MS Access MVP
> www.datagnostics.com
>
> (please reply to the newsgroup)
>
>
>



Relevant Pages

  • Re: Which database should I use?
    ... > and alter the database. ... That is exactly what is possible with SQL server and for a fact with all ... other RDBMS systems but not with Access in combination with a Workgroup ... >only weak point is on security. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Multiple Database Security - How to handle
    ... There is no 'execute as' in SQL Server but you can simplify security ... Assuming the DM database contains tables that are accessed only by ...
    (microsoft.public.sqlserver.security)
  • Re: Microsoft Access Security Best Practices when linking to a SQL back end
    ... Before Access can verify the username and password in the SQL ... Access authenticates the user before the database actually opens. ... own security algorithm is not going to be an easy task. ... > was originally written to use access's own .mdw file for security. ...
    (microsoft.public.access.security)
  • Re: Putting/retriving files into a database
    ... Also, *never* put user-supplied input in an SQL ... attention to what it says about SQL Injection in the "Database ... Security" section. ... Study the "Handling File Uploads" chapter in the PHP ...
    (comp.lang.php)
  • Re: SetOption "Default Database Directory"
    ... As I have said, the SQL works Okay once I close and reopen the DataBase, ... > I'm having a hard time imagining why the rowsource for a list or combo box ... >> set the Default on the opening of the Database, instead of the Open form ...
    (microsoft.public.access.formscoding)