VB6 connect to Oracle

Posted on 2006-05-01
Medium Priority
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

Carl Tawn earned 2000 total points
ID: 16578486
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;"

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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 Month16 days, 16 hours left to enroll

864 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