VB6 connect to Oracle

Posted on 2006-05-01
Last Modified: 2012-08-14
I'm trying to connect to an oracle db (10) with vb6.  I have the following code in my form_load(). Note: This is basically code I took from an ASP program I wrote that works fine.

Dim Conn As Connection
Dim rs As Recordset
Dim strDB As String, strTable As String, strMsg As String, strSQL As String

strlogin = "eee"
strpass = "fff"

Set Conn = server.CreateObject("ADODB.Connection")
Conn.Open = ("Driver={Microsoft ODBC for Oracle};Server=AAA.BBB.CCC.DDD;User Id=eee;Password=fff;")

strSQL = "select prsn_univ_id from dss_rds.sr_bl_hlth_cntr_gt where prsn_ntwrk_id=ggg"
Set rs = Conn.Execute(strSQL)

Set rs = Nothing


When I run it I get a compile error with the Conn.Open line highlighted with an error message of "Method or Data Member Not Found"

What am I doing wrong?
Question by:ssalter2004
    1 Comment
    LVL 52

    Accepted Solution

    You are using Open like a property rather than a method. It should say:

        Conn.Open "Driver={Microsoft ODBC for Oracle};Server=DSS1PRD.UCS.INDIANA.EDU;User Id=cjaeckel;Password=rothdove;"

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Suggested Solutions

    Introduction In a recent article ( for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
    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 Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

    779 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

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now