A: 

Current Version


You might want to detect the current-version of Windows the system is running.

This will in turn help You in determining the correct PATH.

How to find windows version, build and revision numbers??

Read the the Registry keys –

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\CurrentBuildNumber
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\CurrentVersion
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\EditionID
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\ProductId HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\BuildLabEx

The CurrentBuildNumber is your Windows Build Number. Then CurrentVersion value is your windows version i.e. the version of your windows 7, windows vista, windows xp, etc. EditionID and ProductId to know the windows-edition and product-id.

The key BuildLabEx contains build number and revision number.

For example, in the value 6001.17387.x86fre.vistasp1_gdr.070927-1921,
the first four digits stand for build number i.e. 6001 and
the next five digits stand for windows revision number i.e. 17387.
x86 tells you that you are running a 32-bit operating system.

You might also be interested in this:
http://stackoverflow.com/questions/57124/how-to-detect-true-windows-version

GoodLUCK!!

CVS-2600Hertz
+1  A: 

Is this an Access database? You haven't specified.

For an Access database, you don't need to point your DSN to a specific database when you install it. You can modify the connection string to point to different databases at runtime (details). For instance

Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\mydatabase.mdb;Uid=Admin;Pwd=;

Can you simply read the installation path at runtime (in VB6 it is App.Path) and then send a different connection string to Crystal Reports?

MarkJ
I'll try. The problem is that App.Path will still point to C:\Program Files\MyApp even when data that is written to it will be reverted to the VirtualStore
Dabblernl
But won't your crystal reports ODBC connection also be redirected?
MarkJ
+2  A: 

New applications should have an application manifest that specifies requestedExecutionLevel. This declares your program "Vista aware" and bypasses attempts at virtualization.

During installation you should create a folder like [CommonAppData]\Company\App\Full and set security on this folder to allow Full Access by Everyone (or by Users). Put your database into this folder.

For an MDB you can drop the database right here. For a client/server database put a UDL file here. Also see Use Universal Data Link (.udl) Files.

ODBC and DSNs are pretty obsolete technologies.

Using the suggested approaches should work for almost anything but the oldest Win95 computer.

Bob Riemersma
+1  A: 

It seems that Virtual Store takes care of everything, so you can point the DSN blatantly at C:\Program Files\MyApp\Data\mydb.mdb even while the database has been relocated to the Virtual Store.

Dabblernl
+1 This is what I was trying to say in a comment on my answer. I guess it wasn't clear :)
MarkJ