Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Using bind variables with Oracle and VB

Posted on 2006-06-08
Medium Priority
Last Modified: 2012-08-13
Could someone please provide examples of how to submit select, update, and insert SQL to an Oracle database using bind variables?   (All my Google inquiries keep leading me to VB.NET code.)  

Since this is an select/update that takes place every five minutes against a huge table, bind variables are essential.  And I have a feeling the ADO method I used wasn't the best.

It would also be great if the examples included some error checking.

Thanks in advance for your kind response.
Question by:codefinger
1 Comment

Accepted Solution

junglerover77 earned 1500 total points
ID: 16866824
Using ADO you can create a Command Object. Basically it's a temporary store query on the clietn side, that allows parameters. Please try the following code:

Private cmMyQry as ADODB.Command

    Set cmMyQry = New ADODB.Command
    Set cmMyQry.ActiveConnection = cnMyDB

    With cmMyQry
        .CommandText = "SELECT * FROM TABLE WHERE Field = ?"
        .Parameters.Append .CreateParameter(...)
    End With


Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month14 days, 15 hours left to enroll

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question