Thanks for your help... hopefully the powers that be will make it easier for
us in the next release.
news:6h7vguoh2kucbe93fk8ikqj56kcr3julbp@4ax.com...
> A friend at microsoft pointed out how to open the unbound adp
> disconnected, which is kind of a neat trick. When the app opens and
> when it closes, write a (function or sub) that consists of the
> following:
> CurrentProject.OpenConnection "Provider="
> This kills that stupid dialog box next time you open. Apparently this
> is part of the sample code in NorthwindCS.adp that i never looked at
> in the StartSQLServer function.
> Re: no Sub Main in Access -- you could always name your startup form
> SubMain and open it hidden to achieve the same effect <g>.
> --Mary
> On Tue, 18 Jun 2002 20:33:47 GMT, "Geoffrey Barnes"
> <spambus...@earthlink.net> wrote:
> >Well, there's a difference between us, my friend. While I hate macros in
> >general, and wish there was a way to start directly from a VBA procedure
(as
> >you can with Sub Main() in straight VB), I hate using startup forms more.
I
> >would rather kick off the code, and then let the code control which form
> >opens first. After all, it may not be the same form every time!
> >Since there is no way to define a startup procedure, I am forced to use
the
> >decrepit, old AutoExec marco, with only a single RunCode command in it.
And
> >I have to call it Function Main() instead of Sub. But that's how Access
> >developers get by in this world... we find ways around things to get what
we
> >want.
> >Thanks for your help...
> >"Mary Chipman" <mc...@nomail.please> wrote in message
> >news:4f4vgusdvl1r1fs5c79d4vo7e725hfkakm@4ax.com...
> >> No, never did update the darn book. IMO they totally messed up the UI
> >> for ADP's in 2002 and didn't deliver on unbound ADO recordsets, so we
> >> had little interest in updating the book. Maybe the next release will
> >> be better. That stupid dialog is just a case in point of the messed-up
> >> UI. The user basically is forced to press cancel or OK, and then your
> >> code can run. FWIW, don't use an autoexec macro--just put your code in
> >> your startup form.
> >> -- Mary
> >> Microsoft Access Developer's Guide to SQL Server
> >> http://www.amazon.com/exec/obidos/ASIN/0672319446
> >> On Tue, 18 Jun 2002 15:31:22 GMT, "Geoffrey Barnes"
> >> <spambus...@earthlink.net> wrote:
> >> >Your book focused on Access 2000, but did you ever update it for
Access
> >> >2002/XP? The reason I ask is that the ADP startup behavior has
changed
> >in
> >> >Access XP. It now throws up that native login dialog immediately upon
> >ADP
> >> >startup, well before the AutoExec macro could initiate a RunCode
> >procedure.
> >> >So I can't think of anyway to close any connections at startup,
becuase
> >> >Access XP gets there first, before any VBA code can run.
> >> >Any ideas?
> >> >"Mary Chipman" <mc...@nomail.please> wrote in message
> >> >news:rveuguskopdqcdq1sig998s2k0e9gv4bpb@4ax.com...
> >> >> Yeah, it's a PITA. I've gotten around it by closing any lingering
> >> >> connections in code at startup and then re-connecting. I think the
> >> >> code in the book does this (it's been a while), but if not, let me
> >> >> know and I'll post what I've got.
> >> >> -- Mary
> >> >> MCW Technologies
> >> >> http://www.mcwtech.com
> >> >> On Tue, 18 Jun 2002 04:21:55 GMT, "Geoffrey Barnes"
> >> >> <spambus...@earthlink.net> wrote:
> >> >> >Mary,
> >> >> >This problem is similar to one that I posted a few weeks ago, but I
> >never
> >> >> >got a response to it. Yes, you can create an unbound ADP by
pressing
> >> >cancel
> >> >> >in the initial connection dialog, and I have done so. Once and
Access
> >XP
> >> >> >ADP gets a connection to a SQL Server, however, it doesn't want to
> >forget
> >> >> >about it. Even if you create it "unbound", it becomes a "bound"
> >project
> >> >> >once somebody gets a SQL Server connection with it.
> >> >> >From that point on, everytime you fire up your ADP, it thows up a
> >> >> >native-Access login dialog. This native dialog is nowhere near as
> >good
> >> >as
> >> >> >the one that I created myself when I was still using Access 2000.
> >What I
> >> >> >need is someway to keep an XP project unbound forever more so that
I
> >can
> >> >> >control the logins myself. From what Brian said, I could (I guess)
> >> >execute
> >> >> >a ...
> >> >> >Application.CurrentProject.OpenConnection ""
> >> >> >as the application quits every time, but the application could, of
> >> >course,
> >> >> >quit unexpectedly and that would prevent this unbindng code from
> >running.
> >> >> >Any ideas that you (or Brian) have would be most welcome.
> >> >> >Love your book, by the way...
> >> >> >"Mary Chipman" <mc...@nomail.please> wrote in message
> >> >> >news:q3cpguctavth6en0acegu9raps99v76jhb@4ax.com...
> >> >> >> Why go to all that trouble? I assume you don't want users to
> >directly
> >> >> >> modify tables. That is easily remedied by creating views using
the
> >> >> >> WITH VIEW_METADATA option, denying all permissions on the base
> >tables,
> >> >> >> and granting permissions on the views you want the users to have.
> >> >> >> Access caches connection information, and any time a user goes
into
> >> >> >> the connection dialog it gets saved. You can create an "unbound"
ADP
> >> >> >> by pressing Cancel on the initial connection dialog box when the
ADP
> >> >> >> is created, writing code to connect and disconnect. However, I'd
> >also
> >> >> >> remove the built-in menus and only provide custom menus without
the
> >> >> >> connection menu item or a user can easily undo all your work.
> >> >> >> -- Mary
> >> >> >> Microsoft Access Developer's Guide to SQL Server
> >> >> >> http://www.amazon.com/exec/obidos/ASIN/0672319446
> >> >> >> On Fri, 14 Jun 2002 12:06:23 +0800, "Guy Horton"
> >> >> >> <guy.hor...@microscienta.com> wrote:
> >> >> >> >Hi Support,
> >> >> >> >Ideally I would like use an application role, however, the
> >limitations
> >> >> >> >documented in Q308312 prevent me from doing so. To get around
this
> >I
> >> >> >allow
> >> >> >> >the users to connect to the database using their individual
> >accounts,
> >> >but
> >> >> >> >with minimal permissions, and then behind the scenes
> >programmatically
> >> >> >> >reconnect to the database using an account that does have
> >permission
> >> >to
> >> >> >view
> >> >> >> >and modify data.
> >> >> >> >This all works fine except that the Login dialog, presented at
> >> >> >application
> >> >> >> >startup, remembers the credentials of last connected database
user
> >> >which
> >> >> >> >isn't the individual account the user logged on with, but the
> >> >privileged
> >> >> >> >account.
> >> >> >> >Can anyone advise on how to prevent the user name connection
> >> >information
> >> >> >> >from being retained, or alternatively, suggest how the
information
> >> >might
> >> >> >be
> >> >> >> >amended, perhaps on application exit, as the application
maintains
> >> >> >details
> >> >> >> >of the original individual account used to connect.
> >> >> >> >TIA
> >> >> >> >Guy