|
-
Jul 27th, 2006, 04:32 PM
#1
Thread Starter
Hyperactive Member
Adodb
Hi all,
I am trying to create some variables as data type ADODB.Connection and ADODB.Recordset but when I actually run the program, I seem to get an error message saying Visual Basic 6.0 does not recognize the variable type. Could someone help me with this.
Do I have to go to Project --> References or
Project --> Components
Whichever one it is, could you please tell me? I don't know which reference or component to select?
Is it Microsoft.Jet.OLEDB.3.51 .... something like that?
Anyways, thanx for your help in advance.
Khanjan
Hey... If you found this post helpful please rate it.

-
Jul 27th, 2006, 04:43 PM
#2
Re: Adodb
Try Microsoft Active(X) data objects with tyhe highest number
 why can't programmers keep and 31 Oct and 25 dec apart. Why Rating is Useful
for every question you ask provide an answer on another thread.
-
Jul 27th, 2006, 04:53 PM
#3
Re: Adodb
Add a reference to "Microsoft ActiveX Data Objects 2.x Library"
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jul 28th, 2006, 07:31 AM
#4
Re: Adodb
 Originally Posted by RobDog888
Add a reference to "Microsoft ActiveX Data Objects 2.x Library"
Once the reference has been added, you can create the variables. Depending on the scope of your project, they should either be declared as Private in the declaration section of your form, or declared Public in the declarations section of a module.
VB Code:
Option Explicit
'in a module
Public cn As ADODB.Connection
Public rs as ADODB.Recordset
'or, on a Form
Option Explicit
Private cn As ADODB.Connection
Private rs as ADODB.Recordset
To use them, the New keyword is required:
VB Code:
Set rs = New ADODB.Recordset 'the recordset object is now ready for use
Set cn = New ADODB.Connection 'the connection object is now ready for use
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|