Solved

Why am I getting this ADO error in VB 6.0?

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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

691 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