Solved

VB6 application in Vista

Posted on 2007-11-27
8
2,688 Views
Last Modified: 2008-12-03
When I compile my VB6 program, will it run on a Windows Vista platform?  Has anyone run into any problems?
0
Comment
Question by:al4629740
8 Comments
 
LVL 15

Expert Comment

by:spprivate
ID: 20361584
as long as you have the runtime ,there is no problem
0
 

Author Comment

by:al4629740
ID: 20361622
what does that mean?
0
 
LVL 15

Expert Comment

by:spprivate
ID: 20361642
When you want to deploy the application ,create a package using setup wizard and then install it in Vista.The setup will take care of all the dependencies (dlls need to run VB app) and thats it
0
 
LVL 15

Accepted Solution

by:
spprivate earned 500 total points
ID: 20361656
Just got it.Some more considerations to make your app run in Vistal



Application Changes

Remove SendKeys calls and replace them with API code.
Use the HKEY_CURRENT_USER in the registry for the settings of your application. Do not write to HKEY_LOCAL_MACHINE.
If you are using ADO use 2.8 and above in your application.
If you are using XML use XML version 3.0 and above in your application
If you are using the PlaySound API, if your wave files are not PCM but mpeg layer-3 make sure your mpeg wave files are Stereo and not Mono.
If you need the Printer Setup dialog either using the Common Dialog Control, or by using the API functions, the dialog will not return the correct number of copies. The dialog will always return 1 on Vista. The way around this bug is to create your own Printer Setup dialog box and when you get the correct number of copies you will have to send to the printer multiple times to print out multiple copies. Here is a link that discusses this issue in details.
Relocate settings files, data files etc into "Common Files" (C:\Users\Public) instead of "Program Files". You should use the API calls to locate these folders because the folders are in different paths for different machines and OSs. Here is a link that discusses this issue in details.
Per-user settings should be in a separate file located under "Application Data" and this should also be requested of the OS in the same manner.
For "Common Files" ask for ssfCOMMONDATA (or CSIDL_COMMON_APPDATA).
For "Application Data" ask for ssfAPPDATA (or CSIDL_APPDATA). To properly use these filesystem locations you are supposed to create a subdirectory for your "company name" and under that another for your "application name." Then put your settings or data under that.
Any working "document" files that are meant to be found and manipulated by the user (i.e. via Explorer) should be placed into CSIDL_PERSONAL ("My Documents") or CSIDL_COMMON_DOCUMENTS ("All Users\Documents").
DeleteSetting no longer works without a key. e.g. DeleteSetting "Mytestprogram, "General" fails to delete anything and gives an error. but DeleteSetting "Mytestprogram, "General","keyname" works fine. It seems that key is no longer Optional in: DeleteSetting appname, section[, key] as in documentation. Credit: roylow

Setup Package Changes

Administrator Account running your Setup Package

Require users to "Run as Administrator" directly in your setup package.
Inform users to right-click the setup package and click "Run As Administrator".

Non-Administrator Account running your Setup Package

Remove the VB6 Runtime files, MDAC and any of these files from your setup package.

Visual Basic IDE Changes

If you are using Visual Basic 6.0 on Vista, you will notice a latency in speed. This can be solved by using "Windows Classic Theme" or "Windows Vista Basic theme" instead of the new Vista Theme with the Aero effect.

Useful Links

Teach Your Apps To Play Nicely With Windows Vista User Account Control
Understanding and Configuring User Account Control in Windows Vista
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 20361689
you have to execute your installer "as administrator", if not, it won't work at all due security protections of Vista.
0
 
LVL 22

Expert Comment

by:danaseaman
ID: 20362228
'See this link for a list of Vb6 Ocx/Dll that ship with Vista.
Also a second list of Ocx/Dll that have been tested but do not ship with Vista and need to be included in your deployment package.

'Read Support Statement for Visual Basic 6.0 on Windows® Vista™
http://msdn2.microsoft.com/en-us/vbrun/ms788708.aspx

0
 

Author Comment

by:al4629740
ID: 20363358
I installed my program on Vista and this is the error I got:

Run time error '214746259 (8004005)':
[DBNETLIB]
ConnectionOpen (Connect ().] SQL server does not exist or access denied.


0
 
LVL 15

Assisted Solution

by:spprivate
spprivate earned 500 total points
ID: 20365744
it has to do with your connection string with sql server details.
http://support.microsoft.com/kb/328306
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

758 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

21 Experts available now in Live!

Get 1:1 Help Now