Solved

Why am I getting this ADO error in VB 6.0?

Posted on 2013-12-12
4
290 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

948 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

20 Experts available now in Live!

Get 1:1 Help Now