error trying to use ADO to read table items

M

Mike Scirocco

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
 
M

Mike Scirocco

Mike said:
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
<snip>

Sorry, I ran componenet checker and it couldn't find a valid version of
MDAC! Tried installing version 2.8 but I'm getting errors (see below),
same with 2.7 and 2.5, Safe Mode doesn't help. At least I know what the
problem is now.

Mike

Advanced INF Installer
Error registering the OCX
c:\program files\common files\system\ado\msado15.dll
c:\program files\common files\system\ole db\sqlxmlx.dll
c:\program files\common files\system\ole db\sqloledb.dll
 
S

Steve Schapel

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top