Mike,
First of all, the focus of this newsgroup is Macros in Access, and although VBA procedures are sometimes referred to as macros in other programs, this si not the case in Access.
I am not sure about the reason for the error you are experiencing. I would certainly recommend using DAO over ADO, but I don't think that is related to your problem.
However, it seems to me that you can achieve what you want here with a simple Update Query, in other words you are doing it the hard way. Please post back if you need more explicit help with this aspect.
-- Steve Schapel, Microsoft Access MVP
Mike Scirocco wrote:
[Quoted Text] > I'm using Office 2000, getting run-time error 429 (activex component > can't create object) which fails on this code: > > Dim rs As ADODB.Recordset > Set rs = New ADODB.Recordset > > I'm trying to read the text in one column of each row, send that text to > a function, and then enter the result returned by the function in > another column of the same row. I was using the approach below. > > I'm pretty good with VB6 but a complete beginner with Access. Is there > any way to read a table from within Access without using ADO? I mean, > are there any tricks the application provides that allows direct table > interaction? > > Thanks, > Mike > > Public Sub DoHostNameLookup() > Dim rs As ADODB.Recordset > Set rs = New ADODB.Recordset > 'Dim rs As Recordset > 'Set rs = New Recordset > 'Instantiate the Recordset -- provide memory for it on the heap > using New > 'This means that you have to remember to manually release that > memory when > 'you're don with the Recordset, or you'll get a memory leak > rs.Open "Select * from IPAddressList", CurrentProject.Connection > rs.MoveFirst > Do While Not rs.EOF > rs("HostName") = GetHostNameFromIP(rs("IPAddress")) > rs.Update > rs.MoveNext > Loop > Set rs = Nothing > End Sub
|