?
Solved

ADO control refresh error 2147467259

Posted on 2003-03-06
4
Medium Priority
?
351 Views
Last Modified: 2012-06-22
Hi,

Can anybody help?  I have a VB6 program with Access 97 database.  One screen has a number of ado controls.  I use a couple of routines to set the properties of the ado controls when the screen loads up.  The screen opens up fine the first few times but then it fails with the error 2147467259 Unspecified error.  The line of code it is stopping on is the ado control refresh.  It's not always the same control it fails on.  Here is the code:

Private Sub set_ADO(ByVal sql As String, ByVal ctl As Control)
ctl.ConnectionString = sConstr
ctl.CommandType = adCmdText
ctl.RecordSource = sql
ctl.CursorType = adOpenKeyset
ctl.LockType = adLockPessimistic
ctl.CommandTimeout = 30
ctl.Refresh
End Sub

Thanks
0
Comment
Question by:tattie
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 4

Accepted Solution

by:
TomLaw1999 earned 150 total points
ID: 8083530
You will probably find that  the error code is -2147467259 (note the minus sign) and it often seems to pop up when you have a data entry error. This can be caused by:

1) A duplicated index (where duplicates are not allowed)
2) A Missing or corrupted data file
3) Probably one or two other things that I hav'nt come accross yet.

I suggest that you catch the error then check the specific record that is causing the problem. It may be that you need to prevent users from entering inappropriate information into fields, i.e. text into a numeric field or over long text fields (or duplicate index fields).
0
 

Expert Comment

by:CleanupPing
ID: 8900572
tattie:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Experts: Post your closing recommendations!  Who deserves points here?
0
 
LVL 4

Expert Comment

by:TomLaw1999
ID: 8904826
tattie - You posted a grade 'C'. Were you unhappy with my answer ?.
0
 

Author Comment

by:tattie
ID: 8905421
TomLaw99 - No, I wasn't unhappy with your answer but in the end I found the cause of the problem was neither of the first 2 points in your email, although I'm sure they are also potential causes.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month11 days, 18 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question