home

 

this level

Up
Book Reviews
HINTS & TIPS
PC Advice
Consulting

 

child level

Access Tips

 

UPDATED: 02/22/04          Visitors:  Hit Counter           Send Feedback
HINTS & TIPS
© January 2004, Roy Busdiecker, Woodbridge, VA, USA

from Roy Busdiecker, www.busdkr.com

directory
internet, web vb.net, asp.net, ado.net
windows vb/vba 6.0 & earlier
ms access  

internet, web

Publish individual pages quickly with Microsoft FrontPage

bullet

Make Web articles easier to read with "printer-friendly" versions

VB.NET, ASP.NET, ADO.NET

bullet

ADO.NET - Native Oracle drivers

bullet

ASP.NET: Create and restore versions of a project

bullet

Visual Studio .NET - see Design View, Code at same time in tabbed windows

bullet

Visual Studio.NET  - Option Strict permanently On

bullet

Restore an SQL Server version of the Adventure database (LT 505)

vb/VBA 6.0 & earlier

bullet

Easy and safe way to create an ADO Connection String

bullet

How to create a Visual Basic Template (VB 6.0 and earlier)

bullet

Use Microsoft Word to print a two-sided document

bullet

Supplemental exercises for Learning Tree course 304 (Word 2000)

windows

See ALL of your Recent Documents

bullet

Open Windows Explorer with folders collapsed

bullet

Add Microsoft Data Link to Windows "New Item" List

bullet

XP special features: create custom fonts, find and copy special characters

TOP

Make Web articles easier to read

Many magazines put valuable information in articles on their web sites, but advertisements, menu columns and the like make the articles more difficult and less pleasant to read.

When this happens, examine the page to see if it offers a "printer-friendly" version.  That version usually removes the ads and extra buttons and hyperlinks that distract from the article.

If you select the printer-friendly version, you can either read it more easily to your screen or print it for later reading, annotation, or permanent reference.

TOP

ADO.NET: Native Oracle drivers

There are three sources for native Oracle database drivers to use with ADO.NET:  Microsoft, Oracle and DataDirect Technologies.

Both Microsoft and Oracle drivers connect to the Oracle database through the Oracle Call Interface (OCI) and require use of the Oracle Client.  The Microsoft driver requires that the client be version 8.1.7 or higher.  Oracle's driver requires version 9.2 or higher.

The Oracle driver from DataDirect Techologies connects directly to the Oracle database, and therefore does not require use of the Oracle client.

Those without a native driver have the option of using either the OleDb provider (which supports versions 7.3.4 and 8.x of the client) or ODBC, which requires download of the Microsoft ODBC provider.

This information was provided by an article at Visual Studio Magazine's site, which contains more detail and background on the subject.

TOP

ADO Connection String

1.   Create a Microsoft Data Link file
a.      Click Start | Programs | Accessories | Notepad
b.      In Notepad click File | Save As
c.       In Files of Type select All Files
d.      Enter a filename with the extension .udl
e.      Save the empty file and close Notepad

2.   Customize the data link
a.      Double-click on the .udl file to open it
b.      In the wizard’s Provider tab select an appropriate Provider
c.       In the Connection tab select or enter the required information
d.      Click the Test Connection button
e.      When you get the successful connection message close the wizard

3.   Copy the connection string
a.      Click Start | Programs | Accessories | Wordpad
b.      Open the .udl file in Wordpad
c.       Third line of text is the connection string
d.      Copy the connection string and paste it where needed
e.      Close Wordpad

TOP

Add Microsoft Data Link to Windows "New Item" List

1.   Open Registry Editor and create new Key and Value
a.      Click Start | Run
b.      Enter “regedit” and press Return
c.       Press Control+F to open Find window and enter “.udl”, then press Enter
d.      Right-click on .UDL folder and select New | Key
e.      Type “ShellNew” and press enter
f.        Click on ShellNew to select it, then right click in the right pane of Registry Editor
g.      Select String Value and enter the name “NullFile”
h.      Close Registry Editor

2.   Check your work by creating a new Data Link
a.      Right-click on the desktop or in the right pane of Windows Explorer
b.      Click on Microsoft Data Link
c.       Double-click on the New Microsoft Data Link.UDL icon and follow the wizard

TOP

Visual Basic Template (VB 6.0 and earlier)

1.   Create the template
a.      Create a new VB project of the desired type
b.      Configure the project as desired (properties, controls, references)
c.       Save all files and the project with appropriate names in folder
        C:\Program Files\Microsoft Visual Studio\VB98\Template\Projects
d.      Close the project

2.   Use the template
a.      Create a new project using the template that you created
b.      Add to and customize the project as desired 

TOP

ASP.NET: Create and restore versions of a project

1.   Create a new ASP.NET Web project with the desired project name

2.   Save and close  the project
a.      Two new folders will be created
    1) Under your web server's wwwroot folder a new subfolder with the project name
   
2) Under your Visual Studio project folder a new subfolder with the project name

3.   Create a new folder to hold one subfolder for each version of your project
a.      In each version subfolder create two folders named web and solution

5.   Develop an initial version of your project, then save and close it
a.      Copy files (.aspx, etc.) from the wwwroot project folder to the web subfolder of the version folder
b.      Copy files (.sln, .suo, etc) from the Visual Studio project folder to the solution subfolder of your version folder 

6.   To restore a previous version of your project, close Visual Studio and:
a.      Copy files (.aspx, etc) from the version web subfolder to the project folder under wwwroot
b.      Copy files (.sln, .suo, etc) from the solution subfolder of your version folder to theVisual Studio project folder  

TOP

Restore an SQL Server version of the Adventure database

1.   Create a new SQL Server database named Adventure

2.   Download this .mdb file (Access database) and import it into SQL Server

3.   Re-create Connection, DataAdapter and DataSet objects for your AdventureNET project.

TOP

Open Windows Explorer with folders collapsed

1.   Create a shortcut for Windows Explorer.
a.    In the Windows directory (usually C:\Windows or C:\Winnt), right-click on the file explorer.exe
b.   In the popup menu that appears, choose Create Shortcut
c.    Drag the shortcut to the desktop or Quick Launch tray (just to the right of the Start button)

2.   Add command-line keys to customize Explorer's appearance
a.      Right-click on the shortcut and select Properties. 
b.      Locate the Target box on the Properties dialog box.  It should contain C:\WINDOWS\EXPLORER.EXE, or something similar if your Windows folder was renamed. 
c.      At the end of the string in the Target box add a space followed by one of the strings below. 

Desired Appearance Shortcut String

Folder list collapsed to minimum, showing only My Computer, Network Neighborhood, My Documents (plus any other top-level folders you have added.

/e,/select,/root,C:\

As above, but with My Computer expanded to show all drives on the PC, but no folders

/e,/select,C:\

Show a particular folder on a specific drive expanded.  For example, if you wanted to see all the files and subfolders in a file named "Files" on Drive F:, use the string at right

/n,/e,F:\files

TOP

Visual Studio .NET - see Design View, Code at same time in tabbed windows

1. Normally Visual Studio presents a set of tabbed pages that are viewed one at a time
a.  If you double-click on a design form, its code window appears
b.  To see the design view again, you have to click its tab at the top of the screen

2. To view any two windows at the same time
a.  Make sure that the two windows are open (you should see two tabs at the top) 
b.  Right-click on one of the tabs
c.  Select New Vertical Tab Group from the popup menu

3. To recombine two tab groups
a.  Right-click one of the tabs
b.  Select Move to Next Group

TOP

Use Word to make a double-sided printer

If you want to print a Word document with the second page on the back of the first, and so on, it is easy to create a pair of macros that will do the job for you.  Just look at the way your printer works, then choose the set of steps below to follow.

A.  If you use a printer like the HP LaserJet that has blank pages face up in the feed tray and delivers them face down in the output tray, use these steps.

1.  With your document open in Word, click on the Tools men, then Macro, then Record New Macro.
a.  In the dialog box that appears, enter the Macro Name "Step1", then click OK.  This will start the Macro Recorder.  You will see a floating toolbar that has the word Stop at the top and a small black square below (there will also be a circle and two vertical lines, but don't worry about them).  Be careful not to hit a wrong key ... if you do, you will have to start over.
b.  Carefully cllick the File menu and select Print.  In this dialog box, look in the lower left corner and find the dropdown control labelled "Print:".  Click the dropdown arrow and select Even Pages.
c.  Now click the Options button below the dropdown and put a checkmark in the box next to "Reverse Print Order", then click OK.  If your printer is turned on, one side of your document will be printed.  Take the pages out, turn them over, and place them in the feed tray.
d.  Click the dark square in the floating toolbar to stop the recorder.

2.   Create a second macro using the steps above, but this time name the macro "Step2".
a.  In the Print: dropdown, select Odd pages.  In the Options dialog, un-check the box next to "Reverse Print Order".  When you click OK, the second sides of you document will print.

3.  Inspect the finished print job to make sure that the pages are printed properly.

4.  See Final Steps below.

B.  If you use a printer like the Epson inkjet that has blank pages face up in the feed tray and delivers them face up in the output tray, use these steps.

1.  With your document open in Word, click on the Tools men, then Macro, then Record New Macro.
a.  In the dialog box that appears, enter the Macro Name "Step1", then click OK.  This will start the Macro Recorder.  You will see a floating toolbar that has the word Stop at the top and a small black square below (there will also be a circle and two vertical lines, but don't worry about them).  Be careful not to hit a wrong key ... if you do, you will have to start over.
b.  Carefully cllick the File menu and select Print.  In this dialog box, look in the lower left corner and find the dropdown control labelled "Print:".  Click the dropdown arrow and select Odd Pages.
c.  Now click the Options button below the dropdown and make sure that the box next to "Reverse Print Order" is not checked, then click OK.  If your printer is turned on, one side of your document will be printed.  Take the pages out, turn them over, and place them in the feed tray.
d.  Click the dark square in the floating toolbar to stop the recorder.

2.   Create a second macro using the steps above, but this time name the macro "Step2".
a.  In the Print: dropdown, select Even  pages.  In the Options dialog, put a checkmark in the box next to "Reverse Print Order".  When you click OK, the second sides of you document will print.

3.  Inspect the finished print job to make sure that the pages are printed properly.

4.  See Final Steps below.

FINAL STEPS

Now that you have created the macros, put them on the toolbar so you can use them easily.

1.  Right-click on the toolbar and select Customize.

2.  Click the Commands tab at the top of the dialog box.  In the left pane find and select Macros. b.

3.  In the right pane of the dialog box find your Step1 macro and drag it to the menu bar.  Drag the Step2 macro next to Step1, then close the Customize box.

4.  The next time that you are ready to print a two-sided document, just turn on your printer and click the Step1 macro.  When the first side has been printed, turn the paper over and place it in the input tray, then click Step2.

TOP

XP special features

These features have been verified in Windows XP Professional.  They may be in Home Edition, but you will need to confirm that they work there.

1. Create custom fonts
a.  Click Start | Run
b.  Type
eudcedit
c.  Press enter, then follow directions
in Help.

2. Find and copy special characters, and find their key-codes
a.  Click Start | Run
b.  Type
charmap
c.  Press enter to run the program.  Select and copy your characters, or select a character and read its key-code.

TOP

See ALL of your Recent Documents

The Start menu has a selection that allows you to see up to ten of your most recent documents.  It is called "My Recent Documents" in XP and simply "Documents" in Windows 98.

You can see a list of All of your most recently used documents by following the steps below.  HINT:  You may not want to see ALL of the documents for one reason or another.  Using the procedures below, you can simply delete the shortcuts to the items that you do not want to appear on the list.

1. In Windows XP
a.  Open My Computer
b.  Navigate to C:\Documents and Settings\<your username>\

c. 
Locate the folder named "Recent" in the right-hand window.
d.  Position the mouse pointer on the Recent folder, then hold down the right mouse button and drag the folder onto the Start button.  DO NOT release the right mouse button yet.
e.  When the Start menu opens, drag the Recent folder to the top section of the Start menu and release the right mouse button.
f.  A popup menu will appear.  Select the choice that says, "Create Shortcut here".
g.  If you want to rename the shortcut in your Start menu, just right-click on it and select Rename.
h.  When you open the Start menu and click on your new shortcut, a separate one-folder explorer window will open, showing all of the documents you have used recently.  You can sort it by name, date, size or type by clicking on the appropriate column heading.  Delete the shortcuts that you do not want on the list ... the files that they point to will remain in place.

2. In Windows 98 and 98SE
a.  Open My Computer
b.  Navigate to C:\
Windows
c.  Follow the directions for Windows XP paragraphs c - h.

TOP

Publish individual pages quickly with Microsoft FrontPage 2002

1.  Click File | Publish Web... on the FrontPage menu bar and log onto your host site.
2.  In the left-hand window, select the first file that you want to publish, then add others using Control-Click.
3.  When all desired files are highlighted, right-click on one of them and select "Publish Selected Pages" from the popup menu.

Your selected pages will be published immediately, without the usual checking of pages on the host site.

TOP