Home » questions » Visual Basics for Application programming question?

Visual Basics for Application programming question?

2006-08-07 02:14:26, Category: Programming & Design
I run a program and get a complier error following statement. Dim c As ADODB.Connection It notices that ADODB have not been defined. How can i fix it? Thanks!!!

Answers

  1. pra25283

    On 2006-08-07 02:46:02


    Well there are two causes for this problem. 1. The variable "c" which in your case is of the Connection datatype might not have been defined. This can be overcome by the following code: Dim c as new ADODB.Connection or Dim c as ADODB.Connection Set c = new ADODB.Connection 2. If you had already defined the variable correctly but still get the "Object not defined" error, then this might be because the ADODB Object Library might not have been included in the references. To overcome this, do the following: a. Goto "Tools" Tab in VBA Editor b. Click on References c. Make sure that the " Microsoft ActiveX Data Object 2.1 Library" checkbox is checked. >>> This includes the objects and methods for the ADODB Connection I guess this should resolve your problem. Enjoy
  2. fa2a38

    On 2006-08-07 02:20:05


    not to sound like a prick but it seems as if you have to define ADODB, I would really need to see a tidbit of source code but maybe you're not linking to it how many header files have you made etc. its either not defined or you're not linking to it w/o any source code for me to look it its going to be hard for me to find out whats going on. a programmer should know better than that. go over to Cprogramming.com too and try to get help there, might not be enough room for you to print out your source here.
  3. CHANDAN S

    On 2006-08-07 02:18:17


    use Dim c As new ADODB.Connection
  4. Sunny

    On 2006-08-07 03:20:49


    This problem is coming because you have not included the ADO Library in your project. To do that, you have right click on the toolbox, and select the option Add Reference and from there you can select the ADO library whichever version is there on your system.
  5. kryptonboy22

    On 2006-08-07 02:23:56


    in VBA editor go to tools then look for References then check MS ADO 2.5 library or whatever ado version library you want to use. good luck!