Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Legacy VB6 program

Status
Not open for further replies.

BigTG

Programmer
Jul 3, 2023
3
0
0
GB
Many many years ago I developed a VB6 program accessing an Access db running on Windows XP. I am now trying to convert the application to run on Windows 10.
Have had partial success but now really stuck and wondering if anyone could help.
What I have done so far is:
- changed the program so that any references to the access database point to the location where I will place it on the Windows 10 desktop.
- copied executable and Access database from XP desktop to Windows 10 desktop. Obviously gave an error on execution.
- had to register 2 ocx files: mscomct2.ocx, msadodc.ocx
- application now runs with no runtime errors but the main form, which accesses the access database, does not display any data from the database (the fields are empty but no error displayed)

The main form uses an ADODC object, Adodc1, on the form to specify the database properties
CommandString: Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Trevor\Labels\Label.mdb;Persist Security Info=False
RecordSource: SELECT * FROM address ORDER BY recno

I assume the syntax of the CommandString is OK as I select the access database in other subroutines using the same definition assigned to a string with no problems.
It is just the form itself, where the text boxes DataSource property are assigned to Adodc1, are not filled in with the database data when the main form loads.
It's as though the SQL Select command is not being activated.

Is there anything else I need to do? It's just frustrating as the VB6 program works just fine under Windows XP.

Any suggestions would be greatly appreciated.

An update to my question above.

I edited the main form (this in fact is the only form) and deleted all code and form fields associated with the functions you can perform.
What is left are just labels, the textboxes associated with the database fields plus the Adodc1 property.
Still the same problem, no access database data is displayed when I run the program. That is the textboxes are not being populated.
Tried same program in Windows XP pointing to database on that machine and it works fine. The 1st record is displayed.
I also display the number of records in the database which is correct.
My conclusion is there is something strange with the Windows 10 environment. Any known faults or other suggestions would be appreciated.


 
Questions

1) Which version of access are you using?
2) Is it 32 or 64 bit access
3) Is it possible to convert your .mdb to .accdb?

The jet engine is still the original from 20+ years ago. Some bits may not be compatible with W10. It might be better to switch to the accdb driver. The web page on it is here
 
I don't remember the exact situation but I remember we had to add a reference to "Microsoft ActiveX Data Objects 6.0 BackCompat Library" when we upgraded Windows.
 
Hi xwb

Thanks for your help.
Now getting to my out-of-date knowledge of VB6 which I haven't used for about 15 years.

But to answer your questions:
1) on the Windows 10 machine I have Microsoft Office Access 2007 installed
2) my desktop is 64 bit
3) yes I can convert from .mdb to .accb
Before the conversion, and I open the .mdb access database, it informs me it is in Access 2000 file format.
After the conversion, and I open the .accb access database, informs me it is in Access 2007 file format.
So conversion seems OK.

I need to change the VB6 program on my Windows XP machine to point to the .accb database and copy the .exe over to my Windows 10 machine.
I guess I will also have to change to the accb driver at the same time (or is the jet driver compatible with an .accb database?)
(fyi I do not have the VB6 development environment installed on the Windows 10 machine so all changes and recompile needs to be done on the XP machine).

I'll try that 1st to see if any difference.

Thanks also to SallyTheFrog. I will look into your suggestion once I have tried the above.
 
Are the records still empty when you run your select clause?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top