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!

VB 6 And Oracle 7.3 - Opening the Oracle database 1

Status
Not open for further replies.

koz

Programmer
Jan 12, 2000
31
US
I'm trying to connect to an Oracle database using ODBC (Oracle 8.00.04.00 driver).<br><br>I get a connect error:<br>[Microsoft][ODBC Driver manager] Driver's SQLSetConnectAttr Failed<br><br>When I use this same ODBC definition with Microsoft Access and import a table from the Oracle database into the Access database it works without any errors.
 
koz --<br><br>What connect string are you using?&nbsp;&nbsp;Oracle has an additional parameter called &quot;DBQ&quot;, which is the name of the SQLNet (Net8) entry.<br><br>Look for a file in your System (System32) directory called SQORA.HLP, which should list the connection string parameters.<br><br>Chip H.<br>
 
Thanks for looking at my problem...<br><br>I couldn't find the hlp file on either of my drives.<br><br>Here is all the code I'm trying to use:<br><br>Dim cnDB As ADODB.Connection<br>Dim rsRecord As ADODB.Recordset<br><br>Set rsRecord = New ADODB.Recordset<br><br>strSelectStmt = &quot;select course,course_start_dt,session_nbr from PS_CRSE_SESSN_TBL&nbsp;&nbsp;where course = 'IECPIE' order by session_nbr&quot;<br><br>Set cnDB = New ADODB.Connection<br>With cnDB<br>&nbsp;&nbsp;&nbsp;&nbsp;.ConnectionString = &quot;DSN=psd0;UID=sysadm;PWD=syseve;DATABASE=psd0;&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;.Open<br>End With<br>If cnDB.Errors(0) &gt; &quot;&quot; Then<br>&nbsp;&nbsp;&nbsp;&nbsp;MsgBox cnDB.Errors(0)<br>End If<br><br>rsRecord.Open strSelectStmt, cnDB<br>If Not rsRecord.EOF Then<br>&nbsp;&nbsp;&nbsp;&nbsp;Do While Not rsRecord.EOF<br>&nbsp;&nbsp;&nbsp;&nbsp;<br>MsgBox rsRecord(0) & &quot;_&quot; & rsRecord(1) & &quot;_&quot; & rsRecord(2)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rsRecord.MoveNext<br>&nbsp;&nbsp;&nbsp;&nbsp;Loop<br>End If<br><br>rsRecord.Close<br>cnDB.Close<br>
 
My connect string is a bit different....<br><br><FONT FACE=monospace>&nbsp;&nbsp;&nbsp;&nbsp;ConnectString = &quot;ODBC;DSN=&quot; & Trim$(gDSN) & _<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;;UID=&quot; & Trim$(gUserID) & _<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;;PWD=&quot; & Trim$(gPassword) & _<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;;DBQ=&quot; & Trim$(gService)<br></font><br><br>I noticed that you originally said that you were trying to connect via ODBC, yet your code has ADO stuff in it.&nbsp;&nbsp;OK, OK, a purist would say that ADO runs on top of ODBC, but the connect strings are very different for them.<br><br>Don't forget that PWD and DBQ parameters are case-sensitive for Oracle.<br><br>Chip H.<br>
 
Chip,<br><br>Thanks for the assistance. Your pointing out I was using ADO not ODBC Direct was the help I needed As soon as I set up my acxcess using ODBC Direct everything is working fine. <br><br>Thanks again...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top