Results 1 to 3 of 3

Thread: VB6 not recognizing OLEDbCommand

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2008
    Posts
    5

    VB6 not recognizing OLEDbCommand

    I'm trying to use the command object 'OLEDbCommand' but each time I type in the syntax I get the error 'User-defined type not defined'
    Can someone tell my why VB is doing this? Do I need to add a componet and if so which one?
    Here's the syntax I'm using:

    Dim cmd As New OleDbCammand(InsertString, OleConn).

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: VB6 not recognizing OLEDbCommand

    OLEDbCommand is part of .Net, so is not supported by VB6 - instead you should be using an ADODB.Command

    To be able to use it you need a reference to "Microsoft ActiveX Data Objects Library X.X", and the kind of code shown in "method 3" of the article How can I add a record to a database? from our Database Development FAQs/Tutorials (at the top of the Database Development forum)

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2008
    Posts
    5

    Re: VB6 not recognizing OLEDbCommand

    That would explain it. Thanks for you help...

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