Microsoft KB Archive/92545

= Visual Basic 3.0 common questions and answers =

Article ID: 92545

Article Last Modified on 9/1/2006

-

APPLIES TO


 * Microsoft Visual Basic 3.0 Professional Edition
 * Microsoft Visual Basic 3.0 Professional Edition

-



This article was previously published under Q92545



SUMMARY
This single article answers the most-often asked questions about Visual Basic.



MORE INFORMATION
 Q. Where can I place an order or get upgrade and pricing information about Microsoft Visual Basic version 3.0 for Windows?

A. For information regarding product updates, prices, and sales, please call the Microsoft Sales Information Center (MSIC) at the following number. Note that no technical support is provided on this line.  In the United States, call 800-426-9400. In the United Kingdom, call 0734-270000.  Q. Where can I get information about support for the Crystal Reports Custom Control and associated features in Microsoft Visual Basic version 3.0 for Windows?

A. In the United States, obtain support for the Crystal Reports Custom Control from Crystal Services, a company separate from Microsoft. There is a detailed listing of all support options available to you from Crystal in the last 2 pages of the &quot;Microsoft Visual Basic version 3.0 Professional Features Book 2&quot; manual.

In the United Kingdom, obtain support for Crystal Reports from Contemporary Software, a company separate from Microsoft, at 0273-483979 '''Q. What is the Microsoft Developer Network? How do I get it?'''

A. The Microsoft Developer Network (MSDN) is a newsletter and CD-ROM available together or separately. The newsletter is published every other month and the CD is published quarterly. Both the newsletter and CD provide technical information for all developers who write applications using Microsoft operating systems or development tools. The CD contains code samples, technical articles, development tools, and the Microsoft Knowledge Base.

In the United States, call 800-227-4679 for more information, or call 800-759-5474 to join.

In the United Kingdom, call 0800-960279 for more information or to join.  Q. Where can I get information on available third-party custom controls or third-party books for use with Microsoft Visual Basic?

A. Included with Microsoft Visual Basic version 3.0 for Windows is a catalog called &quot;Custom Controls and Other Companion Products and Services for Visual Basic for Windows.&quot; This booklet has been updated since the original release of the product. You can purchase the new version of this booklet from Fawcette Technical Publications.

<pre class="fixed_text">        209 Hamilton Avenue Palo Alto, CA 94301-2500 Tel: 415-833-7100 for intl Tel: 800-848-5523 for Canada/USA Fax: 415-853-0230 Internet: http:\\www.windx.com MSN: Go WINDX </li> Q. Will Visual Basic version 3.0 for Windows work with the new Microsoft Access version 2.0 for Windows?

A. As it is currently shipped, Visual Basic version 3.0 for Windows does not have the ability to read or create a Microsoft Access version 2.0 database. However, Microsoft Access version 2.0 does have the ability to read and create both Microsoft Access version 2.0 and 1.1 databases.

To read and create Microsoft Access version 2.0 databases in Visual Basic version 3.0, you need to obtain the new Jet 2.0/Visual Basic 3.0 Compatibility Layer. In addition to the Compatibility Layer, you must own Microsoft Access version 2.0 to get the Jet 2.0 database engine. The following file is available for download from the Microsoft Download Center:

Comlyr.exe (Compatibility Layer)

For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:

119591 How to Obtain Microsoft Support Files from Online Services

Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file. If you are unable to access the source(s) listed above, use one of the following methods to obtain the file:  You can have COMLYR.EXE mailed to you by calling Microsoft Technical Support Monday through Friday at (425) 646-5105. If you are outside the United States, contact the Microsoft subsidiary for your area. To locate your subsidiary, go to the Microsoft Web site http://www.microsoft.com/worldwide/</li> Purchase the Microsoft Access Developer's Toolkit (ADT) version 2.0 available through resellers or direct from Microsoft. All the files you need are included.</li> Purchase the Microsoft Office Developer's Kit (ODK) and Microsoft Access version 2.0. Both products are available through resellers or direct from Microsoft.

The ODK will also be available as a standard component in all new packages of Visual Basic version 3.0 Professional Edition. The ODK comes on CD-ROM only.

The ODK includes all files in the Compatibility Layer except the main Microsoft Access version 2.0 database engine file, which is available in Microsoft Access version 2.0. Therefore to use the ODK edition of the Compatibility Layer, you need to purchase Microsoft Access version 2.0. The license in the ODK permits distribution of this file with Visual Basic version 3.0-based applications.

In the United Kingdom, you can get the Compatibility Layer by calling the Microsoft Upgrade centre on 081-614-8000.</li></ul> </li> Q. What is the Office Developer's Kit?

A. The Office Developer's Kit is designed to help developers take advantage of the hundreds of reusable components already on users desktops and to make it easier to integrate those tools with each other and enterprise data. The Office Developer's Kit contains more than 8,500 pages of documentation for Microsoft Office application, including the following:

 Microsoft Excel Developer's Kit</li> Microsoft Word Developer's Kit</li> Microsoft Workgroup Templates</li> Microsoft Access Advantage Topics</li> OLE Object Reference Charts (online and wall chart available)</li></ul>

It also includes more than 25 megabytes of new software files:

 Object Browser</li> Electronic Forms Designer (a $395 value)</li> <li>Ten sample applications that illustrate integrated solution programming techniques</li> <li>Microsoft Jet 2.0/Visual Basic 3.0 Compatibility Layer</li></ul>

The Office Developer's Kit will be included on CD-ROM at no additional charge with Visual Basic, Professional Edition.</li> <li> '''Q. I successfully installed Microsoft Visual Basic version 3.0 for Windows with no error messages, but all the help file icons in the Visual Basic group in Program Manager are gray MS-DOS icons. When I choose these icons, why do I get a the following error message?'''

Cannot Run Program. There is no application associated with this file. Choose Associate from the File menu to create an association.

A. This is a known problem with The Setup program in the Professional edition of Visual Basic version 3.0 for Windows. The Setup program adds the following problem line to the extensions section of the WIN.INI file if no association for .HLP files currently exists: HLP=D:\WINDOWS\SETUPWIZ.INI ^.HLP To fix the problem replace the line with this line: HLP=WINHELP.EXE ^.HLP For additional information, please see the following article in the Microsoft Knowledge Base:

100191 BUG: VB Pro Setup Fails to Correctly Associate .HLP File

</li> <li>Q. When using the Setup Wizard tool that comes with Microsoft Visual Basic version 3.0 for Windows, why do I get the following error message during the compression process?

Sharing violation on drive C:

A. There is a known limitation of using the SHARE.EXE utility in Microsoft Windows version 3.1. To avoid this problem, copy the files SETUPKIT.DLL and VBRUN300.DLL from the \WINDOWS\SYSTEM directory to the directory where the SETUPWIZ.EXE file is located. This way SETUPWIZ.EXE and COMPRESS.EXE will not try to use the same files at the same time.

People using Windows for Workgroups do not encounter this problem because Windows for Workgroups uses VSHARE.386 (an alternative file sharing utility) instead of SHARE.EXE. If you use Windows version 3.1, you too can install and use VSHARE.386. You can get VSHARE.386 by downloading SETUPK.EXE or WW1000.EXE from the Microsoft Download Center. For details, please see the answer to question 12.</li> <li>'''Q. I am having trouble with the Setup Wizard & Setup Kit that comes with Microsoft Visual Basic version 3.0 for Windows. At various times, it reports trouble copying files as well as other errors. Is there a known problem with the Setup Wizard?'''

A. Yes, there are a number of known problems with the Setup Wizard and the Setup Kit files that it uses. There are updates available for these Setup Wizard and Setup Kit files: SETUPWIZ.EXE, SETUP.EXE, and the SETUP1 project files.The following file is available for download from the Microsoft Download Center:

Setupwiz.exe

For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:

119591 How to Obtain Microsoft Support Files from Online Services

Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file.</li> <li>Q. What updates are available for Microsoft Visual Basic version 3.0 for Windows?

A. There are several files, including dynamic link library files, that were updated after Visual Basic for Windows shipped. For a complete list of these files, please see the following article in the Microsoft Knowledge Base:

104863 UPD: List of Updated Files for Visual Basic

To obtain this article by Fax, please call 800-936-4300 and request item number 104863.</li> <li>'''Q. I wrote an application that connects to a Microsoft Access database. I can run the application from the Visual Basic environment with no problem, but when I make an .EXE file and try to run it, why do I receive the following error message?'''

Could not find Installable ISAM

A. When using any of the database features with any of the installable ISAMs, you must have an &quot;Installable ISAM&quot; section within an .INI file that has the same name as your .EXE file. For more information on the contents and purpose of this .INI file, please see page 148 in the &quot;Microsoft Visual Basic version 3.0 Professional Features Book 2&quot; manual.</li> <li>'''Q. I am having difficulty with the ODBC Setup and Installation. Is there any information on how this should be done for various databases?'''

A. There are several help files and text files that deal specifically with ODBC setup and connections issues. You can find a list of these and other information files by following three steps: <ol> <li>Open the Visual Basic help file.</li> <li>Choose the Contents button.</li> <li>Select &quot;Other Information sources.&quot;</li></ol> </li> <li>'''Q. I use the picture control to group other controls. However when I select the picture control, the other controls do not remain on top of the picture control. How can I correct this problem?'''

A. This problem occurs if you place the controls on the form in the same place as the picture control but not in the picture control itself. To group the controls in a picture control, you must first select the Picture control, and then draw the desired control within the Picture control. For more information, please see Chapter 3 of the &quot;Microsoft Visual Basic version 3.0 Programmer's Guide.&quot;</li> <li>Q. How can I make calls from Visual Basic to the functions in the Windows Application Programming Interface (API) or other dynamic link libraries (DLLs)?

A. To call a subroutine or function from the Windows API or any other DLL, you need to first provide a Declare statement for that subroutine or function in your Visual Basic application. The exact syntax for the declaration for each Windows API function can be found in the WIN31API.HLP help file included with the Professional Edition of Visual Basic. For more information, please see Chapter 24 of the &quot;Microsoft Visual Basic version 3.0 Programmer's Guide.&quot;</li> <li>Q. Is there a reference available that lists the correct Visual Basic declarations for the Multimedia API functions?

A. Yes, the file is called WINMMSYS.TXT, and it comes with the Professional edition of Visual Basic. You can find it in the \VB\WINAPI directory.</li> <li>Q. Is there a reference available that lists the correct Visual Basic declarations for the Windows for Workgroups API functions?

A. No, at this time such a file is not available from Microsoft.</li> <li>'''Q. I want to sort the records referenced by the Data Control in my application. I tried to use the Index Property as described in the example in the manual and in the help file. Why do I receive the following error message?'''

Property 'Index' not found

A. The examples provided in the Index Property are incorrect. The Index property does not apply to the Data Control. To sort the records referenced by the Data Control, use the ORDER BY Clause within an SQL Statement in the RecordSource property of the Data Control.</li> <li>Q. Is there a better way than the Print Form method to print Forms and Controls in a program?

A. Yes, it is possible to print forms and/or controls and specify the printed size by using various Windows API function calls. For information on how to do this, please see the following article in the Microsoft Knowledge Base:

85978 Print Form or Client Area to Size on PostScript or PCL Printer

You can also find this article in the top 10 Microsoft Knowledge Base articles that are in the Visual Basic help file. To view these articles, select &quot;Technical Support&quot; from the Contents screen in the Visual Basic help file. Then select &quot;Knowledge Base Articles on Visual Basic.&quot;</li> <li> '''Q. How can I use a variable in a SQL string? I tried the following, but it will not work:''' X$ = &quot;Smith&quot; &quot;Select * From Biblio Where Author = X$&quot; A. The problem with your statement is that the variable X$ is within the quotation marks (&quot;), so it is seen as the item you are equating with the field author. Take the variable X$ out of the literal string. In addition, place single quotation marks around the string within the SQL statement so that your statement now would look like the following if it was hard coded: &quot;Select * From Biblio Where Author = 'Smith'&quot; With the variable, the code would look like this: X$ = &quot;Smith&quot; &quot;Select * Form Biblio Where Author = '&quot; & X$ & &quot;'&quot; See how the hard coded SQL string is being broken apart and concatenated together with the string variable?

Note that with a numeric variable, you don't need the single quotation marks: Y% = 10 &quot;Select * From Biblio Where Au_Id = &quot; & Y%      </li> <li> Q. What is the quickest way to search my database for a particular record?

A. Use the 'opentable' method for Access and the ISAMs databases and use the Index property. Note, that there is a sample similar to this on page 75 in the Professional Features Book 2.

Sample:  Dim db as DataBase Dim tbl as Table Set db = opendatabase(&quot;biblio.MDB&quot;) Set tbl = db.opentable(&quot;Publishers&quot;) tbl.Index = &quot;Name&quot; tbl.Seek &quot;>=&quot;, &quot;M&quot; If tbl.NoMatch then Msgbox &quot;No records found&quot; Else List1.Additem tbl(&quot;Name&quot;) End If                tbl.Close db.Close If you connect to a database trough ODBC, the quickest way to search the database is to first attach the table or tables you wish to search to an access database, and then follow the instructions above. </li> <li>Q. How do I set up a Multiuser scenario of accessing my database program?

A. You will need to trap for certain multiuser related errors and have code that checks for when a table is locked at a certain point in time in your program. The following articles will help you in this process:

109218 Using Table Objects Versus Dynaset/Snapshot Objects in VB

113953 How to Use the Three Levels of Database Locking in VB 3.0

To obtain these articles by Fax, please call 800-936-4300 and request item numbers 100003, 109218, and 113953.</li> <li>Q. What is a way to minimize the amount of network traffic in my Visual Basic client/server program?

A. Set up your program to bring back only the records needed to work on at one specific point in time. Looking at the articles listed in question 24 may help. Also, read Chapter 11 in your Programmer's Guide and Chapters 1-4 in the Professional Features Book 2.</li> <li>Q. What would be a good way to design my database?

A. To start, look at the following article:

100139 INF: Database Normalization Basics

To obtain this article by Fax, please call 800-936-4300 and request item number 100139

Look for books on database design. For example, the Microsoft Access User's Guide discusses good database design techniques. There are also many books describing good database design techniques that are available in bookstores.</li> <li>Q. What are some good books on Visual Basic?

A. Microsoft cannot recommend any specific books. However you can call 800-MSPRESS (800-677-7377) to get a list of available books published by Microsoft Press or check at your local book or computer store.</li> <li>Q. How can I program and control the printer object, as other Microsoft applications do from my Visual Basic application?

A. The best way to control the printer is to call the Windows API ExtDeviceMode function, but you cannot call this API function directly from Visual Basic because the function requires a callback. Visual Basic does not provide callback functionality.

To use this API function in your Visual Basic program, you need to buy or create a DLL that calls the ExtDeviceMode function. Then call the DLL from your Visual Basic program.

We have available a small sample that demonstrates how to create a DLL in Microsoft C or C++ that uses the API ExtDeviceMode function and exposes a function that can be used by a Visual Basic application to manipulate the ExtDeviceMode API function call. The following file is available for download from the Microsoft Download Center:

Vbextdev.exe

For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:

119591 How to Obtain Microsoft Support Files from Online Services

Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file.</li></ol>

<div class="references_section">