The error occurs on the highlighted line, and here is the error.
Beantown Boy
Please use [highlight=vb]your code goes in here[/highlight] tags when posting code.
When you have received an answer to your question, please mark it as resolved using the Thread Tools menu.
cn is a global connection object and adoRS is a global recordset object.
Beantown Boy
Please use [highlight=vb]your code goes in here[/highlight] tags when posting code.
When you have received an answer to your question, please mark it as resolved using the Thread Tools menu.
I have just used exactly the same code (with Excel 2000) and it works fine.
Is the recordset declared like this?
VB Code:
Public adoRS As ADODB.Recordset
Yes
Originally Posted by si_the_geek
Which version of ADO have you referenced, and which version of MDAC do you have? (see the MDAC link in my signature for a tool to find out).
Why would MDAC be an issue working between VB6 and Excel 2003?
Originally Posted by si_the_geek
Does it work if you use Range instead of Cells?
No.
Beantown Boy
Please use [highlight=vb]your code goes in here[/highlight] tags when posting code.
When you have received an answer to your question, please mark it as resolved using the Thread Tools menu.
Why would MDAC be an issue working between VB6 and Excel 2003?
MDAC contains several DB technologies, most notably ADO and database drivers. It is possible that whatever version of ADO you are using (or have available) is not compatible for some reason.
I would be surprised if it isn't compatible, but the only other thing that I can think of at the moment is the "Display Excel" part of your code should arguably be after the rest of the code - but I dont think that is the problem either.
On a side note, are you setting your object variables to Nothing after the code runs?
On a side note, are you setting your object variables to Nothing after the code runs?
Well, kinda yes and kinda no.
The code is there to close and set the objects to nothing, but the program never reaches that point. It blows up well before then
Beantown Boy
Please use [highlight=vb]your code goes in here[/highlight] tags when posting code.
When you have received an answer to your question, please mark it as resolved using the Thread Tools menu.