p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Access (http://p2p.wrox.com/forumdisplay.php?f=18)
-   -   Migrating from access 97 to access 2000 (http://p2p.wrox.com/showthread.php?t=4415)

Khalifeh September 29th, 2003 01:39 PM

Migrating from access 97 to access 2000
 
Hi there,
this is the first time for m on this forum!
I have been trying to convert this database in access 97 to access 2000 (that is my front-end) and I have read on the library issues with DAO and ADO. So i ve decided to use ADO. Can anyone please tell me what are the steps i need to take to convert to access 2000 using ADO?
maybe i can tell you what i have done so far:
i ve created a new mdb file and imported all the object and tables from the previous version. i ve referenced to DAO 3.6 library, since it wont work with ADO at the moment. And my modules all compile but i have problem with a few of the forms. for example, run-time error 5: invalid call to procedure
and thats occurs due to
Set CmdBar = CommandBars("correspondence log")

thanks!

Sam Gharnagh
Jr. Programmer Analyst
Comp Sci at UofW

Bob Bedell September 29th, 2003 02:41 PM

Hi Sam,

If you decide to convert your DAO to ADO you'll need to do it manually. The conversion is, of course, completely unnecessary as you've already discovered, unless you just want the practice of working with ADO, or you are planning on upgrading to a SQl Server backend someday. If you have a copy of VB6 lying around, here is a project you can download that does a side-by-side comparison of all the major DAO/ADO objects, and demonstrates how to convert between them. Go to:

http://msdn.microsoft.com/library/ and search for "Migrating From DAO to ADO."

Finally, if you're trying to create a custom commandbar named "correspondence log", try using:

Set CmdBar = CommandBars.Add("correspondence log")

The Add method will create the new commandbar by adding it to the commandbars collection.

HTH,

Bob




Khalifeh September 30th, 2003 02:09 PM

Hey there,
looks like my problems have just started!
Im trying to convert a protected access 97 database to access 2000. I wanted to know if anyone has any experience in this area (working with system.mda and system.mdw security files) for example, when do i use them? and do i need to convert the access 97 security file seprately or do i need to create a new one?
if anyone knows a good online tutorial on this or has any advice, that would be appreciated!

Sam

Bob Bedell September 30th, 2003 10:20 PM

You remembered to carefully record, and keep in a secure place, your original workgroup files WID and PID numbers, right?........me neither. :(

Assuming you did, you could create a new A2K work group file using those exact ID’s, then convert your Access 97 db and use it. Or, you can use your old .mdw file with an A2K db and just not have new A2K security features available.

In any event, the document to start with is probably the “Access Security FAQ” which you can download at:

http://support.microsoft.com/default...b;en-us;207793.

Its 31 pages of answers to all kinds of questions about Access security. For example, it will walk you through the process of “de-securing” your 97 db prior to conversion to A2K, and then “re-securing” the converted db if you need to recreate your security settings.

System.mdw is simply Access's default security database (it was called system.mda in Access 2.0), and is the same for every initial installation of Access. Check Tools -> Security -> Workgroup Administrator to find its location. Also be sure and back it up in its original state before modifying it. Generally, it lives in a shared folder on a server with read-only permissions granted to users. Its presence is required by Access to open a .mdb file. At a minimum, it contains information on the default Admin account. You can use the User-Level Security Wizard or the Workgroup Administrator utility to modify it or create a new workgroup file, if you have a reason to.

The Security FAQ will address a lot of this stuff for you, though its not exactly a "good tutorial" (I don't know of any). Also, Access - being a file-based database and all - is really (by definition) unsecurable: the file can always be copied. If security is a big concern, seriouly consider SQL Server.

HTH,

Bob



Bob Bedell September 30th, 2003 10:23 PM

The link to the Security FAQ I posted seems to be busted. Its KB article 207793 if you want to search for it.


Khalifeh October 1st, 2003 10:14 AM

Hey Bob,
thnx alot for the article and the help! that helps alot! I ll present the idea of making a new security file but they might not have the PID's to recreate. we r prolly using the access 97 mdw file i think.

on the other hand, i ve been trying to convert the DAO code to ADO and I ve ran into some problems. I tried the CommandBars.Add method but that gives me error somewhere else in the program!
i get an out of range error for this line of code!
Set SubCmdBar = CmdBar.Controls(2)

any ideas on the commandbar??? i know it uses ms office library and ms word library for it and i have those referenced so thats not the problem.
thnx, Sam

Bob Bedell October 1st, 2003 11:59 AM

Hi Sam,

Here's the scoop on custom command bars:

First, the command bar object is not part of the Access object model, its part of the Office object model, so make sure you have a reference set to the most recent version of the "Microsoft Office x.0 Object library" installed on your system (probably 10.0).

Second, to create a custom command bar, you need code like the following:

Sub CreateCustomCommandBar()
   On Error Resume Next
   Dim cbr As CommandBar
   Dim btn As CommandBarButton
   Set cbr = CommandBars("Open A Form")
   If Err <> 0 Then
      Set cbr = CommandBars _
      .Add(Name:="Open a Form", Position:=msoBarTop)
   End If

   Set btn = cbr.Controls("Open a Form")

   If Err <> 0 Then
      ' Custom button doesn't already exist, so create it.
      Set btn = cbr.Controls.Add(msoControlButton, , , , True)
   End If
   With btn
      .Caption = "Open a Form"
      .BeginGroup = True
      .OnAction = "OpenAForm"
      .Style = msoButtonCaption
   End With
End Sub

After running this code, go to View -> Tools -> Open a Form and you'll be able to select your new comman bar and add it to your interface.

Third, to make the command bar do something when clicked, you need one more procedure. Notice above that the .OnAction property of the control button is set to "OpenAForm". This is a procedure call. Here's the procedure:

Sub OpenAForm()
    DoCmd.OpenForm "Form1"
End Sub

So, clicking on your new command bar button will open a form called Form1. Of course, Form1 needs to be created first.

That's about all there is to it. :)

HTH,

Bob




Bob Bedell October 1st, 2003 12:03 PM

P.S.

The DAO -> ADO migration issue has no bearng on your command bar issue. They are seperate matters involving completely different object libraries.





Bob Bedell October 1st, 2003 12:12 PM

P.S.S

Come to think of it, I guess 10.0 is the A2K2 version of the office library and 9.0 is the A2K version. Anyway, there should only be one version (the latest) of this particular library listed in your references dialog. Just be sure and add it to your app.

;)


Bob Bedell October 1st, 2003 12:15 PM

P.S.S.S

Quote:

quote:
there should only be one version (the latest) of this particular library listed in your references dialog
Unless of course you have multiple versions of Access installed.

[8)]



All times are GMT -4. The time now is 02:20 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.