?
Solved

Why am I getting this ADO error in VB 6.0?

Posted on 2013-12-12
4
Medium Priority
?
308 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
[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
  • 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 2000 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

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

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
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…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

765 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