Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2004
    Posts
    2

    Question Unanswered: can ADO use prepared statements and bind variables?

    Hi,

    I would like to know if ADO can use prepared statements and bind variables.

    We currently have a VB6 app that builds all of it's SQL by inserting the datavalues into the SQL string, for example:

    select * from emp where name = "IAIN";

    I'm want to know if there is a way to do something like this:

    prepare "select * from emp where name = ?"
    setbind (1, "IAIN")
    execute

    There are a lot of reasons for wanting to do this, which I won't go into right now. I'm not a VB programmer (I'm more on the database side) and want to recommend that future work with ADO (and ADO.NET) work be done as I described as above.

    I've messed around with some VB code and searched the net but didn't come up with anything... hoping someone can fill me in.

    Thanks
    Iain

  2. #2
    Join Date
    Sep 2004
    Posts
    2
    I finally found something, though it's mostly related to .NET

    Here are some links that I found very helpful. Interestingly enough, Oracle gave me the specific info I needed, despite wasting quite a bit of time on the MS site. It seems that Oracle are the only ones who really care about all this bind variable bizzo. Still it seems that using stored procedures while not using "bind variables" as such, achieves the same effect, and more.

    http://osi.oracle.com/~tkyte/ResultSets/index.html

    http://asktom.oracle.com/pls/ask/f?=...:8015253775496

    http://msdn.microsoft.com/library/de.../html/daag.asp

    Regards
    Iain

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •