Results 1 to 4 of 4

Thread: Running a Query

  1. #1

    Thread Starter
    Hyperactive Member parkes's Avatar
    Join Date
    Jan 1999
    Location
    Unitied Kingdom
    Posts
    303

    Post

    I'm using VB6 and Access 97.
    I want to run an Append query using VB.
    I've got a Query called Transfer which has a parameter called Refno.

    I want to be able to send the reference from VB into this query. Which will hopefully run this query and update another table. Could anyone please give me some help?

    ------------------
    Thanks in advance for any help provided.

  2. #2
    Lively Member
    Join Date
    Feb 1999
    Location
    Leicester, UK
    Posts
    123

    Post

    Hi parkes, try this:

    Dim qdf As QueryDef
    On Error GoTo ErrorHandler
    Set qdf = dbData.QueryDefs("Transfer")
    qdf.Parameters("Refno").Value = <ValueOfRefno>
    qdf.Execute dbFailOnError
    ...
    ErrorHandler
    ...

    where dbData is your (opened) database object.

    Hope this is of some use


    [This message has been edited by Michael (edited 07-30-1999).]

  3. #3

    Thread Starter
    Hyperactive Member parkes's Avatar
    Join Date
    Jan 1999
    Location
    Unitied Kingdom
    Posts
    303

    Post

    Thanks for that, it work. But how do you do the same thing using ADO.


    ------------------
    Thanks in advance for any help provided.

  4. #4
    Lively Member
    Join Date
    Feb 1999
    Location
    Leicester, UK
    Posts
    123

    Post

    Thats a good question! I'm still trying to get to grips with ADO myself. My company has decided that we will stick with DAO for the time being so I am not so familiar with ADO as I would like to be! I'm trying to learn it in my spare(?) time.

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