
Help! VB5 and Oracle Object For OLE:
I am trying to convert programatically from Access to Orcle 8.05. The means by which I
am doing so is by creating a script from an Accces Table which essentially creates my
Oracle tables trough a script. I now have an empty Oracle table where I would like to
populate them by using repetitive loop from Access and then into Oracle. The problem I
am having is that I am using Oracle Objects for OLE and my program crashes at the
Set OraDynaset = OraDatabase.CreateDynaset("COLLAPSED")
line because it cannot find an Object. The reason, I think, that it cannot find an
object is because there are no records in my Oracle table. Can someone please help me
out here?
Begin sub ()
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set OraSession = CreateObject("OracleInProcServer.XORaSession")
Set OraDatabase = OraSession.OpenDatabase("Test", "vdesai/welcome", 0)
Set OraDynaset = OraDatabase.CreateDynaset("collapsed")
Set db = DBEngine.OpenDatabase("C:\PROJ1\SAMPLES.MDB", 0, 1, ";pwd=crustacians")
Set rs = db.OpenRecordset("Collapsed")
rs.MoveLast
rs.MoveFirst
For i = 0 To 10 - 1
OraDynaset.AddNew
For j = 0 To rs.Fields.Count - 1
OraDynaset.Fields(j).Value = rs.Fields(j).Value
Next j
OraDynaset.Update
rs.MoveNext
Next i
End Sub()