Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adodb.Connection

Status
Not open for further replies.

MarcelBeals

Programmer
Mar 29, 2000
18
CA
User Defined Type Not Defined<br><br>Can anyone help.&nbsp;&nbsp;I am trying to just open an Oracle D/B.<br><br>If you can shed some light on this error I would be grateful.<br><br>Marcel.
 
Constr = &quot;Provider=MSDAORA.1;Data Source=YourSource;Persist Security Info=False&quot;<br><br>'Be Sure not to leave any spaces as this will cause an error<br>'The function that I use to connect to an Oracle 8i database is below <br><br><b>Public Function</b>AdConnect(ConnStr As String) As <b>Boolean</b><br><br>'Creates the connection to the database<br><br><b>Set</b> cn = <b>CreateObject</b>(&quot;adodb.connection&quot;)<br><br><b>With</b> cn<br>'Open the connection<br>.ConnectionString = ConnStr<br>.Open<br><br>&nbsp;&nbsp;&nbsp;&nbsp;<b>If</b> .State = adStateOpen <b>Then</b><br>&nbsp;&nbsp;&nbsp;&nbsp;'Check if the connection has been opened correctly<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;AdConnect = <b>True</b><br>&nbsp;&nbsp;&nbsp;&nbsp;<b>Else</b><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;AdConnect = <b>False</b><br>&nbsp;&nbsp;&nbsp;&nbsp;<b>End If</b><br><br><b>End With</b><br><br><br><b>end Function</b><br><br><br>Hope that this is of some use to You
 
did you by any chance setup a DSN in the ODBC32 setup under control pannel, because then you cna select all your stuff there, and just call the DSN=yourdsnname, and should connect just fine without having to tell it its a Oracle all the time (which is what ODBC does), also make sure you have the propper ODBC drivers for oracle, oracle itself doesnt have drivers, but microsoft has something like ODBC for Oracle drivers. <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in , or have messed with : VC++, Borland C++ Builder, VJ++6(starting),VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML,Visual InterDev 6, ASP(WebProgramming), QBasic(least i didnt start with COBOL)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top