Explicitly declare the variable

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

My database is ODBC linked to an SQL database the DSN is QMSPRD.
I use Option Explicit, then in my code I add "QMS.addQMSPRD"

The error message tells me I need to "Explicitly declare the variable"

How do I do that????

Thanks
 
Dear Dan:

In your apparent function call:

QMS.addQMSPRD

there are two things to resolve. The initial QMS would be an object, so it
is a reference to an object variable. This should be both declared and
initialized.

addQMSPRD would be a method of that object class. Do you have that declared
somewhere as well.

Are you the author of the software including the QMS object and its methods?
If not, talk to the one who did, or read the manual he wrote.

Tom Ellison
 
Dear Dan:

In my previous post, I stated that you must declare it. That would be done
using the DECLARE keyword.

It remains essential that you also initialize it. If you don't you'll just
get a different error message.

The advice about reading the manual on this function, or consulting the
person who wrote it, still stands.

When you declare the QMS object, you must declare it as being an object of a
certain type. No one unfamiliar with the custom software you are addressing
could know what that is. You cannot declare it, or initialize it, without
instructions on the custom object it addresses.

Take my advice or leave it.

No one is going to know how to declare and initialize a custom object unless
they are familiar with the object. That's why manuals and documentation are
essential.

Tom Ellison
 
Guess I'm a little on edge about taking over someone elses database.
The person is no longer with the company and did not document very well.

My concern is that the program runs fine without "QMS.addQMSPRD"

Let me explain: I re-linked all the tables to a new SQL Server Database
(for security reasons) I had to change the DSN name.
The old program runs fine with this code to the old SQL db. But when I
change the connections to the new SQL db I cannot include "QMS.addQMSPRD"..

I realise that does not give you much information to help, but it's all I
have.
 
Dear Dan:

That's not good news. You may need to read, understand, and document
everything you have before you can proceed to use it and maintain it, let
alone proceed with new development. You're going to need considerable
expertise in SQL Server T-SQL coding.

Tom Ellison
 
Back
Top