Solved

Why am I getting this ADO error in VB 6.0?

Posted on 2013-12-12
4
285 Views
Last Modified: 2013-12-12
I am in the process of converting my existing accounting software system written in VB 6.0 to use Microsoft ActiveX Data Objects instead of its current Pervasive Btrieve 6.15.  For the most part, I am making great progress, but I am stuck now on one small section of code that I just cannot figure out.  Below is the pasted code snippet:

90        With dtaGLChart
100         .CommandType = adCmdText
110         .ConnectionString = "Provider=" & strProvider & ";Data Source=" & strGLDataPath & "\GLData.MDB"
120         .CursorLocation = adUseClient
130         .CursorType = adOpenKeyset
140         .LockType = adLockOptimistic
150         .Mode = adModeShareDenyNone
160         If lngDept = 0 Then
170           .RecordSource = "SELECT AcccountNo, AccountTitle FROM ChartOfAccounts ORDER BY AccountNo;"
180         Else
190           .RecordSource = "SELECT AcccountNo, AccountTitle FROM ChartOfAccounts WHERE Department = " & _
                              CStr(lngDept) & " ORDER BY AccountNo;"
200         End If
210         .Refresh
220       End With

and below is the two error messages I am getting when the .Refresh command is executed on line 210 (virtually identical code works elsewhere).

Error message 1
Error message 2
0
Comment
Question by:DiscGolfDad
  • 2
  • 2
4 Comments
 
LVL 40

Expert Comment

by:Vadim Rapp
ID: 39714989
dtaGLChart - what object is that?

just as a note, if the decision was made to rewrite it, maybe it would make sense to rewrite in more or less current Visual Studio, rather than in VB6, thus making this rewrite already obsolete from day 1..
0
 
LVL 2

Author Comment

by:DiscGolfDad
ID: 39715062
I have and know how to program in .Net, but to convert 1/2 million lines of code and over 300 forms would be quite a bit of a job for one man.  For now, I'm just going to MDAC, but comment appreciated.

Also, dtaGLChart is merely an ADO data control.
0
 
LVL 40

Accepted Solution

by:
Vadim Rapp earned 500 total points
ID: 39715229
change AcccountNo to AccountNo in recordsource.
0
 
LVL 2

Author Closing Comment

by:DiscGolfDad
ID: 39715321
I can't believe I've read that line what feels like 1,000 times and did not pick up on that.  Thank you.  That did indeed solve the problem.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

758 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now