Re: ADO Recordset
- From: Kirk P. <KirkP@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 20 Sep 2007 10:32:00 -0700
Thanks - I like the 2nd option much better!
"Douglas J. Steele" wrote:
You have to loop through the recordset..
rs.Open strSQL, cn
MsgBox rs.RecordCount
Do While Not rs.EOF
MsgBox rs.Fields(0)
rs.MoveNext
Loop
rs.Close
However, if what you've got as the connection string is working for you, you
should be able to use
ODBC;Driver={Microsoft ODBC for Oracle};SERVER=penprd0;uid=myuid;pwd=mypwd;
as the Connect string for your pass-through query. (It has the added benefit
that you won't need a DSN)
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"Kirk P." <KirkP@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:493CB8AA-BBE3-40E9-AF09-E0143BC6F1AD@xxxxxxxxxxxxxxxx
I'm retrieving records from a back end Oracle database. Normally I set up
a
DSN and use the Microsoft Oracle ODBC driver and get what I need via a
pass
through query. For whatever reason, setting up this DSN isn't working, so
I'm pursuing another option.
This code gets me into the Oracle database (the number of records returned
is correct), but how do I get it to actually display the records in a
query?
Sub ConnectTest2()
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim strSQL As String
strSQL = "SELECT * FROM ec_currencies"
cn.CursorLocation = adUseClient
cn.Open "Driver={Microsoft ODBC for Oracle}; " & _
"SERVER=penprd01; uid=myuid;pwd=mypwd;"
rs.Open strSQL, cn
MsgBox rs.RecordCount
rs.Close
cn.Close
End Sub
- References:
- Re: ADO Recordset
- From: Douglas J. Steele
- Re: ADO Recordset
- Prev by Date: Re: ADO Recordset
- Next by Date: Re: Changing Combobox to text box
- Previous by thread: Re: ADO Recordset
- Next by thread: Re: ADO Recordset
- Index(es):
Relevant Pages
|
Loading