Results 1 to 4 of 4

Thread: Adodb

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2005
    Location
    Toronto, Canada
    Posts
    357

    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.

  2. #2
    Fanatic Member Dnereb's Avatar
    Join Date
    Aug 2005
    Location
    Netherlands
    Posts
    863

    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.

  3. #3
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Adodb

    Quote 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:
    1. Option Explicit
    2.  
    3. 'in a module
    4. Public cn As ADODB.Connection
    5. Public rs as ADODB.Recordset
    6.  
    7. 'or, on a Form
    8. Option Explicit
    9.  
    10. Private cn As ADODB.Connection
    11. Private rs as ADODB.Recordset
    To use them, the New keyword is required:
    VB Code:
    1. Set rs = New ADODB.Recordset 'the recordset object is now ready for use
    2.  
    3. 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
  •  



Click Here to Expand Forum to Full Width