Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 29th, 2003, 01:39 PM
Authorized User
 
Join Date: Sep 2003
Location: toronto, Ontario, Canada.
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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
__________________
Sam Gharnagh
Jr. Programmer Analyst at MOH
Comp Sci at UofW
Reply With Quote
  #2 (permalink)  
Old September 29th, 2003, 02:41 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , USA.
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts
Default

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



Reply With Quote
  #3 (permalink)  
Old September 30th, 2003, 02:09 PM
Authorized User
 
Join Date: Sep 2003
Location: toronto, Ontario, Canada.
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
Reply With Quote
  #4 (permalink)  
Old September 30th, 2003, 10:20 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , USA.
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts
Default

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


Reply With Quote
  #5 (permalink)  
Old September 30th, 2003, 10:23 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , USA.
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts
Default

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

Reply With Quote
  #6 (permalink)  
Old October 1st, 2003, 10:14 AM
Authorized User
 
Join Date: Sep 2003
Location: toronto, Ontario, Canada.
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
Reply With Quote
  #7 (permalink)  
Old October 1st, 2003, 11:59 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , USA.
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts
Default

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



Reply With Quote
  #8 (permalink)  
Old October 1st, 2003, 12:03 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , USA.
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts
Default

P.S.

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




Reply With Quote
  #9 (permalink)  
Old October 1st, 2003, 12:12 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , USA.
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts
Default

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.

;)

Reply With Quote
  #10 (permalink)  
Old October 1st, 2003, 12:15 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , USA.
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts
Default

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.



Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
migrating from access to SQL morphy VB Databases Basics 1 December 10th, 2004 04:12 PM
Coverting from Access 2000 to 97 timmaher Access 1 August 18th, 2004 08:47 AM
Select the correct version of Access 97/2000 setyna VB Databases Basics 2 August 16th, 2004 03:54 AM
Access 2000 to Access 97 happygv Access 5 April 23rd, 2004 10:06 AM
ADE file in Access 2000 <---> Access XP ginoitalo Access 3 April 14th, 2004 09:06 PM



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


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