December 8, 1999

Finding the Calling Procedure

Question: Often I place a Break Point in a Function or Procedure for Debugging purposes.How I can find the immediate calling procedure?Or, better how I can find all the previous calling procedures? Answer: You can bring up the call stack window to see this information. This shows the procedures occurring

Access 97 vs. 2000 Databases

Question: I have a program in VB6 using an Access 97 database. The code I use for all my procedures is as follows: Dim db as DatabaseSet db = DBEngine.Workspaces(0).OpenDatabase(“biblio.mdb”, False, False) It works fine with an Access 97 .mdb, but with a 2000 .mdb it pops up an error.

Differences Between C++ and Java

Question: In C++, when a programmer intends to write: if (value == 1) { But, they often make the following mistake: if (value = 1) {…… Why doesn’t this problem exist in Java? Answer: In C and C++ a non-zero value evaluates to a true boolean expressionand a zero value

DSN-Less with ADO

Question: When I try to implement the code that is in MSDN, I receive Run-time error ‘446’ Object doesn’t support named arguments. Dim cn As New ADODB.ConnectionDim rs As New ADODB.RecordsetConst ConnectString = “uid=myname;pwd=mypw;driver={SQL Server};” & _ “server=myserver;database=pubs;dsn=””Private Sub Form_Load() With cn ‘ Establish DSN-less connection .ConnectString = ConnectString .ConnectionTimeout

Passing Command-Line Parameters

Question: I need to know how to pass a parameter from HTML to Standard EXE, and how to get these parameters in VB after you’ve passed them? Answer: Visual Basic EXEs can read the Command$ variable, which provides a list of all the command line arguments passed to the application.

App Not Running on Other Machines

Question: After compiling my VB app, and installing it on my machine, it will run. But, when I install it on my professor’s machine at school, it doesn’t work at all. What do I need to investigate in order to resolve this problem? Answer: Visual Basic EXE files can’t just

Replace Function

Question: I just started with VB6 programming and I need to write a short program doing the following: 1. Enter a sentence.2. From this sentence which was entered, pick any word.3. Enter a new word. This program has to print a new sentence but it must replace the new word

VB Class Module

Question: I have noticed that a termination event won’t be fired unless the class variable is out of scope, or I specifically set the class variable to Nothing (in earlier versions of VB). Is it still true for the current version 6.0? Answer: It still works the same way in

Cube Root Function

Question: Would you please tell me the code in Visual Basic for a cube root function on a basic calculator. Answer: It’s very simple, you just have to raise a value to the 1/3 power, like this:x = 5 ^ (1/3)

No more posts to show