Link to home
Start Free TrialLog in
Avatar of iskhchan
iskhchan

asked on

Run-time error

Hello,

I'm programming with VB6 and SQL server 7.0. When the user are doing enquiry on something in SQL server, run-time error occur:

<
  Run-time error '-2147467259 (80004005)':

  Unspecified error
>

As from microsoft website, it may occurs when 'Creating Fabricated Hierarchical Recordset Fails Using MDAC 2.1SP2'. Actually, I didn't do that at all.

Does anybody encounter such problem before? Please help.

Reference from microsoft: http://support.microsoft.com/default.aspx?scid=KB;en-us;q240341

Avatar of twalgrave
twalgrave

try changing the .CommandType to adCommandText.
Avatar of iskhchan

ASKER

What I'm trying to do is to post some sql to get a recordset and fill in some text fields and datagrid.

<
  Dim rs As New Recordset
  sql = "select xxx from yyy....."
  setrecordset rs, MainDef.Connection, sql, true

  If Not rs.Eof Then
     .
     .
     .
  End If
  rs.Close
  .
  .
  .
>

Is there any possibility to get such error?
upgrade MDAC version may help you.

You can download from miscrosoft.
First of all, I recommend using error handling in the code.  Then go to Tools...Options...General tab and select "Break on all errors.  This will give you the exact line the error occurred on.  I notice you are using a subroutine you wrote called setrecordset.  The error could be happening in there and if it does, the code will stop right there.  Then when the code breaks, go to immediate window (Ctrl-G) and ? err.description.  Also try looking at err.lastdllerror.  When the code breaks, do a "? sql" (or whatever variable contains the SQL statement in the setrecordset routine.  Then copy and paste that into SQL server Query analyzer.  If you get a failure there, you can troubleshoot the sql.  If you don't get an error there, it probably is in code.

How to check my MDAC version? Is it from VB -> project -> Reference?

Then how to check user's MDAC version since NO VB is installed in their machine.

If I upgrade my MDAC to 2.7 for deployment, do I need to upgrade the client's machines as well?

Thanks.
How to check my MDAC version? Is it from VB -> project -> Reference?

Then how to check user's MDAC version since NO VB is installed in their machine.

If I upgrade my MDAC to 2.7 for deployment, do I need to upgrade the client's machines as well?

Thanks.
How to check my MDAC version? Is it from VB -> project -> Reference?

Then how to check user's MDAC version since NO VB is installed in their machine.

If I upgrade my MDAC to 2.7 for deployment, do I need to upgrade the client's machines as well?

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of twalgrave
twalgrave

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
How to check my MDAC version? Is it from VB -> project -> Reference?

Then how to check user's MDAC version since NO VB is installed in their machine.

If I upgrade my MDAC to 2.7 for deployment, do I need to upgrade the client's machines as well?

Thanks.
Try not to refresh the page, it results in multiple same postings.  Use the Reload This Question at the top left.
I'm sorry.
see my comment above for how to check the MDAC version.

I've got it, thanks a lot!
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in Community Support that this question is:
- points to twalgrave
Please leave any comments here within the
next seven days.
answer force-accepted

DigitalXtreme
CS Moderator