The Linux Page

Visual Basic

MS-Access variable types that do not exist?!

Problem

I worked on a project with many functions that access the database. These functions will generally have a Recordset variable. Yet, when I tried to run a script with the recordset declaration, it would fail with the error Undefined variable type.

  Dim rcd As Recordset

Since that definition was not required for the software to work, I ignored the error for a long time.

MS-Access and variables set to Nothing

In VB and MS-Access, whenever a variable referencing an object is set to Nothing, you cannot access any field since the variable does not actually point to a physical object.

This, code like this breaks:

	Dim r Is Object 
	r = Nothing 
	...
	r.Field = 5  ' Breaks if r is still Nothing

Thus, you need to test whether the variable r is defined.

MS Access classes

As most people know, all of the MS-Office macros are written in Visual Basic.

Visual Basic is for sure a huge whole lot better than the BASIC I had on my Apple //c. For one thing, it does not require line numbers and you can declare functions, procedures, and have local variables (FOR loops that use the variable I do not overwrite the variable I of the FOR loop from the calling function!)

Since MS-Access 2007, we have the possibility to create classes!

RETURN not working in Visual Basic & Arrays...

RETURN statement in BASIC

Like many programmers, I switch between languages quite often.

I have worked with BASIC before since I had an Apple //c and used other Apple ][ computers that had some (really bad, early) BASIC language in their ROM.

At the time, the worst part was the line numbers. You had to write in BASIC as if you were writing assembly language. And I'll skip the numerous problems with memory...

Syndicate content Syndicate content

SMS From Me Logo

SMS From Me

To automatically start one on one conversations with your online leads.

     

   

Terms of Site Index

Find the page/content you are looking for with our index.

  • Solaris
  • exception
  • height
  • router
  • scan

    In software, scanning means checking the content of memory or a disk for something. In hardware, you have scanners that read the colors on a piece of paper. In the C language, you have a function called sscan() (String Scan,) which I recommend you avoid, but is used to scan the content of a string.