Q:What versions of Visual Basic are there? What's the difference between them?
Answer: There are three versions of Visual Basic, each of which meets different development needs.
1.VisualBasic Learning Edition enables programmers to easily develop Windows95 and WindowsNT (R) applications. This version includes all internal controls along with Grid, Tab and Data_Bound controls. The documents provided by the learning version include "Programmer's Guide", online help and Visual Basic "Online Manual".
2. The professional version provides professional programmers with a complete set of fully functional tools for development. This version includes all the features of the learning version together with ActiveX controls, Internet controls and CrystalReportWriter. The documents provided by the professional version include "Programmer's Guide", online help, and "Component Tool Guide".
3. The Enterprise Edition enables professional programmers to develop powerful distributed applications within the group. This version includes all the features of the Professional Edition along with the Automation Manager, Parts Manager, Database Management Tools, Microsoft Visual SourceSafe(TM) engineering-oriented control system, and more. The documentation provided by the Enterprise Edition includes all the documentation of the Professional Edition, as well as the Client/Server Application Development Guide and SourceSafeUser'sGuide.
Q: What hardware and software are required to install Visual Basic?
Answer: Different needs,
1. Microsoft Windows NT3.51 or later, or Microsoft Windows 95; 80486 or higher microprocessor.
2. If it is a full installation, at least 50MB of hard disk space is required.
3. A CD-ROM drive.
4. Microsoft Windows supports VGA or higher resolution screens.
5.16MBRAM.
6. Mouse or other pointing device.
Q: How to get technical support about CrystalReports?
Answer: If you have problems installing CrystalReports, please contact Microsoft.
If you need other technical support, please contact Seagate directly.
Seagate's website is http://www.crystalinc.com
or http://www.img.seagatesoftware.com.
Seagate's technical support phone number is: 01-604-669-8379 or 01-800-877-2340.
Q: Which databases can I communicate with in Visual Basic?
Answer: There are three types of databases that can be communicated with in Visual Basic. They are:
1.VisualBasic database - Also known as a local database, this type of database file uses the same format as Microsoft access. The Jet engine creates and operates these databases directly and provides maximum flexibility and speed.
2. External databases - These are Indexed Sequential Access Method (ISAM) databases using several popular formats, including Btrieve, dBASEIII, dBASEIV, Microsoft FoxPRoversions 2.0 and 2.5, and Paradoxversions 3.x and 4.0. Databases in all the above formats can be created and manipulated in Visual Basic. Text file databases and Microsoft Excel or Lotus 1-2-3 spreadsheets can also be accessed.
3. ODBC database - includes client/server databases that comply with ODBC standards, such as Microsoft SQL Server. To create a true client/server application in Visual Basic, you can use ODBCDirect to pass commands directly to the server for processing.
Question: How to communicate with the serial port in Visual Basic?
Answer: VisualBasic provides an MSCOMM control, which is responsible for receiving and sending data from the serial port. You can select the project in the Visual Basic development environment, select Components under the Project menu, select MicrosoftCommControl from the Components, and add the MSCOMM control to your toolbox. Then modify the serial port communication parameters such as communication port, baud rate, etc. by setting the properties of the MSCOMM control.
Question: How to call Win32 functions in VB?
Answer: In the WINAPI subdirectory of Visual Basic, you can find WIN32API.TXT, which contains all Win32 function descriptions, type descriptions and global constant values. You can use the Visual Basic plug-in program VBAPIViewer to select the Win32 function you need, and then put the description of the function into the Visual Basic project through simple copy and paste technology, so that you can call it like a normal Visual Basic function. .
Question: Visual Basic 5.0 cannot start normally, what should I do?
Answer: This may be caused by two reasons:
1. There is an error in the plug-in program. You can use Notepad to open the VBAddin.ini file in the system directory and change the value of each item to 0, that is, the plug-in program will not be started.
2. The saved data about the Office command bar is incorrect. In this case you can delete the HKEY_CURRENT_USER/SOFTWARE/MICROSOFT/VisualBasic/5.0 entry from the registry. After modifying the above content, you only need to restart Visual Basic.
Question: What should I do if some controls are damaged in Visual Basic?
Answer: You can find the response file from the VB installation disk and copy it to the system directory. Then use regsvr32 to manually register those controls. The method is: regsvr32xxxx.ocx
Q: In a multi-user environment, how does Microsoft Jet prevent other users from modifying your data?
Answer: Microsoft Jet provides three methods of locking data at different levels. It prevents multiple users from modifying data at the same time.
1. Exclusive mode prevents all other users from accessing the database. This is the most restrictive mode.
2. Recordset locking locks the basic table of the Recordset object, using read table locking, write table locking or both.
3. Page lock locks the page containing the data being edited, which is 2048 bytes (2K) long. This is the least restrictive mode
Q: What is the difference between conservative locking and open locking?
Answer: When using conservative locking, once the Edit method is called, the engine will lock the page containing the currently edited record. It will not release the lock until the changes to this record are explicitly committed or canceled. But its disadvantage is that it takes a long time to lock the record, and it not only locks the record that the user is editing, but also locks other records that reside in the locked page.
When using open locking, the engine only locks the page when trying to commit record changes using the Update method. Because locking occurs only when the application attempts to commit changes, the locking time is minimized. But the disadvantage of open locking is that when a user starts editing a record, there is no certainty that the update will succeed. Updates that rely on an open lock will fail if another user changes a record that the first user is editing.
Question: In VB5, when compiling an application into NativeCode, do you still need MSVBVM50.DLL when publishing the application?
Answer: Yes. All applications generated with VB5 require MSVBVM50.DLL, whether NativeCode or P-Code. Because MSVBVM50.DLL is needed to implement many functions such as Form, class modules, and languages. NativeCode refers to code that can run directly on the CPU without runtime interpretation, but it does not mean static connection. Applications generated by VB5 need to call library functions in the dynamic link library (DLL).
Question: How to access the VisualFoxPro database in VB?
Answer: It is recommended to set the PrimaryKey in the VfoxPro database table and access the VisualFoxPro database through the latest version of the VfoxProODBC driver. This can achieve better performance and avoid problems during Update.
Question: Which graphics file formats are supported by the PictureBox and Image controls of VB5?
Answer: PictureBox and Image controls are used to display graphics. It can display graphics in the following formats: bitmaps, icons, metafiles, enhanced metafiles, JPEG or GIF files. Newly supported JPEG or GIF files are useful for Web pages.
Question: What methods are provided in VB to access the Registry?
Answer: The GetSetting function returns the registry key setting value from the application item in the Windows registry. SaveSetting statement to save or create application projects in the Windows registry.
DeleteSetting statement, in the Windows registry, deletes a zone or registry key setting from an application item.
The GetAllSettings function returns all registry key settings and their corresponding values of the application project from the Windows registry (initially generated by SaveSetting).
Question: How to log an event in a VB5 application?
Answer: The LogEvent method records an event in the log in the log target of the application. On the Windows NT platform, this method will write the content to the NT Event log. On the Windows95 platform, this method will write the content to the file specified by the LogPath attribute. By default, if no file is specified, events are written to the vbevents file.
Q: How to detect whether a file exists? How to delete files?
Answer: Use the Dir function to check whether the file exists. If there is no eligible file, Dir will return a zero-length string ().
Files can be deleted using the Kill statement.
Question: How to optimize the display speed of VB applications?
Answer: Due to the graphics characteristics of Microsoft Windows, the display speed of graphics and other operations largely determines the perceived speed of the application. The faster the forms appear and draw, the faster the application will appear. Several techniques can be used to improve the display speed of your application:
·Set the container's ClipControls property to False.
·Use AutoRedraw appropriately.
·Use Image control instead of PictureBox control.
·Hide controls when setting properties to avoid multiple redraws.
·Use Line instead of PSet.
Often, the perceived speed of an application has little to do with how fast the code actually executes. Apps that launch quickly, draw quickly, and provide constant feedback appear fast to users; apps that seem to hang while completing tasks appear slow. Many techniques can be used to make an application appear fast:
·Hide the form without loading.
· Preload data.
· Work in the background using timers.
·Use progress indicators.
·Speed up application launch speed.
Q: What new content does VB5 have in supporting Internet/Intranet development?
Answer: Create an ActiveX document
Professional and Enterprise editions are as easy and intuitive as designing Visual Basic forms. ActiveX documents push Visual Basic applications into Internet browser windows.
Create your own ActiveX control
Professional and Enterprise editions combine existing controls or create your own controls from other controls. ActiveX controls created with Visual Basic have several Internet features, including asynchronous downloading of data and hyperlinks.
Multithreaded DLL
Professional and Enterprise editions mark DLL components that execute without user interface (that is, without user interaction) for efficient use in multi-threaded applications such as Internet browsers.
Internet transport controls
Professional and Enterprise editions offer new controls for HTTP and FTP support.
WinSock control
Professional and Enterprise editions allow connecting to remote computers and exchanging data with other computers using User Data Protocol (UDP) or Transmission Control Protocol (TCP).
hyperlink positioning
Professional and Enterprise Hyperlink objects control access to ActiveX hyperlink functionality. Using the properties and methods of the Hyperlink object, a control can request a hyperlink-aware container, such as Microsoft Internet Explorer, to jump to a given URL or navigate through a history list.
Asynchronous download
Professional and Enterprise editions asynchronously download files, byte arrays, or images through ActiveX controls and ActiveX documents created with Visual Basic.
Menu negotiation in ActiveX documents
Professional and Enterprise Editions Menus added to ActiveX documents can be seamlessly merged with Internet Explorer (or other browsers that support menu negotiation) menus when the document is displayed.
ActiveX Control Interface Wizard
Professional and Enterprise Editions Once a composed control is added to the UserControl Designer, the wizard can help map the properties, methods, and events of the new ActiveX control (that is, its interface) to the functions provided by the composed control and UserControl object.
Internet parts download
Professional and Enterprise editions can use the installation wizard to package components specifically for deployment on the Web. JPEG and GIF support
All versions of the PictureBox and Image controls, as well as the Picture object, now support .gif and .jpg files, which are useful for Web pages.
Access the web from a development environment
All versions jump directly to the latest information about Visual Basic and other development products.
Question: How to introduce traditional VB applications into the browser for execution?
Answer: The ActiveX Document Migration Wizard is designed to change existing forms into ActiveX documents. An ActiveX document is a specific type of ActiveX object that can be stored and activated in an ActiveX document container (such as Microsoft Internet Explorer).
Q: Comparison between DAO and RDO
Answer: DAO generally accesses databases through the Microsoft Jet engine (except for ODBCDirect mentioned below), and is suitable for accessing databases such as Microsoft Access;
RDO directly accesses the database through ODBC. It is suitable for Client/Server environment and will achieve better performance when accessing large databases such as Microsoft SQL Server.
The way to use Remote Data Objects (RDO) is basically similar to the way to use Microsoft Jet database engine Data Access Objects (DAO), and the RemoteData control is also similar to the Data control. Use RDO to submit queries, create result sets or cursors, and process query results with database-independent, object-oriented code.
Using the RemoteData control, you can use all bound controls that can be recognized by the Data control in the created form; you can also process the result set with little or no code.
By making some slight changes to the existing application using DAO and Data controls, you can convert it to using RDO and RemoteData controls. There are some differences between them, however, because RDO is implemented and designed for use with relational databases, RDO does not have its own query handler; it relies on the data source to handle all queries and create result sets. The data objects themselves are created from the result sets and cursors returned by the ODBC driver.
Sometimes it may not be necessary to convert an existing DAO/Jet application to RDO because ODBCDirect passes DAO through RDO, not Jet. If the application does not use DAOISAM objects and their methods (such as table-type Recordset objects and Seek methods) or other ISAM programming methods, then it can be converted to ODBCDirect with a few changes, and the changes required are even less than that of converting to ODBCDirect. There are still few RDOs.
The following table lists RDO2.0 objects and their equivalent DAO/Jet objects:
RDO object
Equivalent DAO/Jet object
RdoEngine
DBEngine
RdoError
Error
rdoEnvironment
Workspace
rdoConnection
Database
rdoTable
TableDef
Not implemented
Index
rdoResultset
Recordset
Not implemented
table type
keyset type
Dynaset type
static type(r/w)
Snapshot type(r/o)
dynamic type
(none)
Forward type only
Forward type only
(without cursor)
(none)
rdoColumn
Field
rdoQuery
QueryDef
rdoParameter
Parameter
Not implemented
Relation
Not implemented
Group
Not implemented
User
Remote data objects use the concepts of rows and columns rather than records and fields, which is typically the terminology of relational databases. A query returns data in the form of a result set, which can contain zero or more rows of data, and each row can contain one or more columns. DAO requires the use of cursors to access data, while RDO allows the creation of cursor-free result sets, requiring significantly less resources than cursors.
Some DAO objects, methods, and properties are designed to support and implement Jet's ISAM structure and installable ISAM databases. For example, you can use the Index object and the Seek method to manage ISAM indexes and use the index to locate rows. Because RDO and relational databases manage indexes in completely different ways, those objects and methods are not needed.
DAO also supports database schema creation, modification, referential integrity (RI), and security through DAO methods and properties. RDO does not support any form of RI, security or schema modification, as the tools and utilities provided by the server system are fully capable of supporting these functions.
You can also run RDO to generate table queries, or perform action queries to create, modify, and delete databases or tables using original SQL statements. It is also possible to execute complex stored procedures, thereby managing the database schema or performing maintenance operations, which is not possible with DAO.
->