
Since 1998, DevX has helped people start businesses, build websites, and provide enterprise technology to people globally. Interviewing the likes of Microsoft’s co-founder, Steve Ballmer, the publication brings comprehensive, reliable, and accessible insights to the Internet.
The Microsoft Access engine will maintain a persistent connection onan ODBC connection in order to be more efficient, even after using a Closemethod on a database opened with ODBC. The
With the release of VB4 and the new development environment for32-bit operating systems, I use three versions of Visual Basicin developing VB applications. Some of my clients won’t acceptapps built
There is a list of our new functions in Visual Basic 4.0 for workingwith an application’s Windows registry entries (or .INI file on16-bit Windows platforms): GetSetting(appname, section, key[, default]) GetAllSettings(appname,
The problem? You want to print a single sub but VB always prints allthe subs that are in the current form. You could copy it to the clipboardand print it
LenLongestWord finds the length of the longest word in a stringwhere a word is defined to be bounded by spaces or the ends ofthe string. It also illustrates a case
Note that in writing in VB3.0, Visual Basic’s AppActivate statementfails to make a 32-bit application the active window under Windows NT.For example: Sub Form_Load () AppActivate “Notepad – (Untitled)”End Sub
Many times when I code similar syntax with slight modifications on each line, I like to make a template of thecore syntax, quickly paste a copy of it however many
When you get a cool sample of a VB component and you simply can’t recreate all of its characteristics inyour app, don’t go nuts. Most of the time, you can
After a call to a DLL, the return value often contains a null.One way to eliminate the null is to look for Chr$(0), as in theexample: Dim CheckForNull As IntegerCheckForNull
There is a simple way to get Monitor resolutions through a WinAPIcall. Declare this in a module: Declare Function GetsystemMetrics Lib “User” (ByVal _ nIndex As Integer) As Integer And
Public Sub UnloadAll()Dim f As Integerf = Forms.CountDo While f > 0 Unload Forms(f – 1) ‘ If form isn’t unloaded exit (User had canceled…) If f = Forms.Count Then
You say you want to use a tab control, but you have so many topics thetabs will be unreadable? Try using a list box in conjunction with a controlarray of
When you are looking at code that calls a function or procedure andyou are not sure in which module the function or procedure is defined,you can highlight/procedure name and press
This code is reusable and small enough to paste into whatever you’redoing and instantly have a form that has no need for a title bar. In thegeneral declarations section, insert
You would think that the following code would change the current fontof the default printer, but it doesn’t under VB4: Printer.FontName = “Arial”Printer.FontSize = 11Printer.Print “This is a test.” An
Creating a new project with a lot of old components? In VB 4.0 you candrag and drop files into the project window to add them to the project.Use File Manager
This code, which works fine under VB3, may generate runtime error 3426–“Theaction was canceled by an associated object”–in the 16-bit versionof VB4: Private Sub cmdUpdate_Click() ‘ Save contents of bound
The documentation for the DBGrid in VB4’s Professional and EnterpriseEditions states that the control’s Text and Value properties allow youto read or set the contents of a cell. This would
Because of customer complaints and confusion, Microsoft Office applicationswill begin to implement this strategy for programmatically closing Officeapplications. First, hide the object by setting Object.Visible to false.Then let the object
When you try to set the MatchEntry property of a DBCombo control to”1 – Extended Matching”(at run time or design time), VB may reportthat the “Property is read-only.” The problem
VB 4.0 lets you pick the font you want for your editor. You can do thesame thing in VB 3.0 as well, but you’re font choices are limited, andit’ll involve
The strings related to the registered user of a particular copy of Windowsare stored in a string inside USER.EXE. You can retrieve them with code.In the general declarations section, insert:
Take a few moments to memorize these keystroke combinations and you’llfind yourself rocketing through your project! Key combinations separatedby commas mean they’re to be performed sequentially. VB 3.0 Keyboard Shortcuts
The new version of Visual Basic will compile only those portions ofcode it expects to run. This speeds load time, but the code may not befully checked. To fully compile
Early binding can be done with Excel 5.0 and 7.0 by taking advantageof two bugs in Excel. The first bug cannot do direct early binding. Thesecond bug is an unexposed
The on-line documentation on using the RichText control to print tellshow it is supposed to work. It does not mention two basic problems. First,the RichText control doesn’t work with the
The benefit of early binding is that performance improves and code doesnot need to be localized for each international version of Word. This istrue only for the function that is
In VB3, you call GetModuleUsage() to determine when an app you startedwith the Shell command was complete. However, this call does not work correctlyin the 32-bit arena of Windows NT
You can use the code window to see the events for an OCX, and the propertieswindow to see the properties of an OCX. To see the OCX’s methods, use theObject
To use numeric strings as keys in a treeview control, the keys mustbe strings containing a non-numeric character, not just digits. A handyworkaround is to append the string “_” to