Andyroo
January 31st, 2000, 04:13 AM
I have VB version 5 professional edition. I am trying to ultimately connect to an ORACLE database via ODBC, but an access database via ODBC would do for now.
Can this be done with DAO or do you have to use RDO.
This next bit of code works fine with an access file specified via a path, but what about ODBC?
'Dim db As Database
'Dim rs As Recordset
'Dim sSQL As String
OpenDatabase( _
"c:\ProgramFiles\DevStudio\Vb\Biblio.MDB")
sSQL = "Select * from Titles"
Set rs = db.OpenRecordset(sSQL, dbOpenDynaset)
rs.MoveFirst
While Not rs.EOF
List1.AddItem rs.Fields(0)
rs.MoveNext
Wend
rs.Close
Can this be done with DAO or do you have to use RDO.
This next bit of code works fine with an access file specified via a path, but what about ODBC?
'Dim db As Database
'Dim rs As Recordset
'Dim sSQL As String
OpenDatabase( _
"c:\ProgramFiles\DevStudio\Vb\Biblio.MDB")
sSQL = "Select * from Titles"
Set rs = db.OpenRecordset(sSQL, dbOpenDynaset)
rs.MoveFirst
While Not rs.EOF
List1.AddItem rs.Fields(0)
rs.MoveNext
Wend
rs.Close