Solved

Why am I getting this ADO error in VB 6.0?

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

Industry Leaders: 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

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
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.

749 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