Solved

VB Application - Package and Deployment Wizard Woes

Posted on 2002-04-30
26
853 Views
Last Modified: 2013-11-23
Hello.

I've been working on an application. Today, I decided to try and package it into a Setup.exe, a .CAB and Setup.lst files, in order to test the deployment of this "jewel" and see if everything works.

Not all of the stuff works. Mainly, the interaction amongst the different databases (kinda important).
All of these work off of a menu_Click event to load their respective Forms.
I developed this using Visual Basic Pro, Service Pack 5 from within Windows 2000 Professional.
Here are the problems; many seem to be related:

I have a Data Environment object, deSQLAny_1, which was built with a DSN in WIN2K | Control Panel | ODBC. As a standalone .EXE, this ran beautifully (after some work). Now, after being packaged in VB in WIN2K, and deployed within Windows XP Home, I clicked on the menu and I got:

"Run-time error -2147220992 Data Provider could not be initialized." THIS ends my application - down in flames.

Another database example uses the Northwind database. The connection uses the ADODC control with the MS Jet 3.51 OLEDB provider. Standalone - great!
After P&Deploy, I get:

"Provider cannot be found. It may not be properly installed. OK.
"Data Source name not found and no default driver specified." OK
The Form loads, but there is no data to be found.

Another database example uses the ADODC control, this time, connecting to a Personal Oracle8i database. Once again, standalone works great. But after P&D, I get the *longest* message I have ever seen:

"Data Source name not found and no default driver specified. Run-time error -2147467259" Click 'OK'.
"Oracle client and networking components are supplied by Oracle Corporation and are part of the Oracle version 7.3.3 or later client software installation. Provider is unable to function until these components are installed."
Whew!

I have sample connections to Sybase's SQL AnyWhere databases which don't give me any errors, but they also don't fetch any data either.
I got a second run-time error -2147220992.
I can't remember which one caused that one.

So, it seems to me that I don't have a good present knowledge of dependencies at all (for sure) and how to get these DSNs and /or providers and/or connection strings into this package, this bundle of files. I even have a menu which, when clicked, runs a small PowerBuilder application, connecting to a small (but working) SQL Anywhere database. That ALSO uses a DSN to work. It works fine, by itself and when included into this VB application. Click on it to run after P&D, and the code on the application 'Open' event appropriately works and says, "Unable to Connect to database." OK and it ends right there.


Somehow, there must be a way to include these required DSNs, providers, etc. into this thing.

Once again, I appologize for this being so wordy.
But,
could someone please shove me in the right direction? I've spent a great deal of time on this app and there's more tweaking to be done in design.

Jim Nowlin
0
Comment
Question by:jnowlin
  • 12
  • 6
  • 4
  • +2
26 Comments
 
LVL 6

Expert Comment

by:xSinbad
ID: 6982666
Have you considered DSNless conections.
Like this:-
strConnect = "ODBC;Driver=SQL Server;Server=  ServerName ;DATABASE=DatabaseName;UID=Login;PWD=Password"

.OpenDatabase("", False, False, strConnect)
0
 
LVL 1

Expert Comment

by:falconew
ID: 6982780
What database product are you using? If you use Oracle I think you should install Oracle Client driver on the client computer.
occosionally the MDAC has some problems when deploying the application to a later version of MDAC. In your case of Northwind database, you develop using MS Jet version 3.51, It might be when you deploy your application, the newer version of MDAC was found on the deployed computer. It might be the Msjet version 4.01. To resolve the problem you should add the MDAC of your version to your package, so it will be installed along with your applicaiton.

Falconew.
0
 
LVL 3

Expert Comment

by:n_narayanan
ID: 6982823
In windows 2000, MS Jet 4.0 OLEDB, will be there, you are trying to use MS Jet 3.51 OLEDB, this may not be installed using P&D Wizard.

First change this in your code and try installing.

I had this kind of problems with P&D.

Why don't you use inno setup, Which is very comprehensive and easy to customize.

I started using this, now I am able to do the deployment without any problem.

Reference: http://www.bhenden.org/istool/

http://www.jrsoftware.org/isinfo.php

If you want I will send the Setup.ISS also for your reference.

Narayanan
0
 

Author Comment

by:jnowlin
ID: 6983286
xSinbad,
I've never done DSNless connections. It sounds like it's worthwhile to look into.
.OpenDatabase()
What object is that method associated with?

faclonew,
MDAC - Are you referring to the executable file:
MDAC.EXE? I think my VB or WIN2K has version 2.5 or 2.6.

n_narayanan ,

"In windows 2000, MS Jet 4.0 OLEDB, will be there, you are trying to use MS Jet 3.51 OLEDB, this may
not be installed using P&D Wizard."

"First change this in your code and try installing."
What coding change are you suggesting if I can't include MS Jet 3.51 OLEDB using P&D?

Jim

0
 
LVL 3

Expert Comment

by:n_narayanan
ID: 6983354
'Make reference to Microsoft ActiveX Data Objects 2.0 Library
Dim Con as new adodb.connection
con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=" & App.Path & "\LocalDB.mdb"

Narayanan
0
 
LVL 6

Expert Comment

by:xSinbad
ID: 6984756
This is an example of one I use;

Dim dbsData As Database, strConnect As String
Dim strSQL As String
On Error GoTo err_handle

strConnect = "ODBC;Driver=SQL Server;Server=Server;DATABASEDatabase;UID=login;PWD=Password"

Set dbsData = OpenDatabase("", False, False, strConnect)
   
    dbsData.QueryTimeout = "600"
    dbsData.Execute strSQL, dbSQLPassThrough
    dbsData.Close
0
 

Author Comment

by:jnowlin
ID: 6984876
Also, the database connections with SQLAnyWhere are not working properly after P&D. Is *that* also a MS OLEDB provider problem since I use a DSN?

xSinbad, I am still having trouble understanding your code.
It's just that I've never seen this approach before.

n_narayanan, I'll give the MS Jet4.0 OLEDB a try first. I don't have a lot of time and consequently, I won't have enough time to learn Inno Setup as you've suggested earlier.
Jim
0
 

Author Comment

by:jnowlin
ID: 6987521
Well n_narayanan,


"In windows 2000, MS Jet 4.0 OLEDB, will be there, you are trying to use MS Jet 3.51 OLEDB, this may
not be installed using P&D Wizard.

First change this in your code and try installing."

I changed the provider to MS Jet 4.0 OLEDB and re-packaged the app. I installed it and when I clicked on the Northwind database, I still got the message saying the "Data Source Name not Found and No Default Driver Specified", but....

I got data from the database displayed!!!     :)
So, you've helped immensely with the first part of this mystery. THANK YOU! I looks as though I will need to post another question to get more help with xSinbad's DSNless connection. I appologize for my brain. I've never packaged a VB program before (could you tell?) and my first one is trying to conquer what seems to me to be a taboo subject in the programming world.

I have also posted a question, dealing with a similar issue regarding retrieval of data (or lack thereof) from a SQL AnyWhere database (Sybase).

Jim

Jim
0
 
LVL 3

Expert Comment

by:n_narayanan
ID: 6987724
Why don't you try the above link and create the installation using InnoSetup?

Narayanan
0
 

Author Comment

by:jnowlin
ID: 6988561
OK. I'll give it a try tonight and this weekend.
Jim
0
 

Author Comment

by:jnowlin
ID: 6988786
"If you want I will send the Setup.ISS also for your reference."

I downloaded INNO Setup version 2.0.19 from the site. After work today, I hope to extract it.
Do you have this 'Setup.ISS' file?
Jim
0
 

Author Comment

by:jnowlin
ID: 6990113
Hi Narayanan,

I launched Inno setup and I guess I need some additional help. I added my VB .vbp and a second try I added my executable. All I get when I use this compiler is "Welcome to MyProgram". I click on it and I'm presented with the next MsgBox, "To Remove this, Go to Control Panel"

I will need to work with the help file and any sample scripts if I am to get this program to work.

Hi xSinbad,

In lieu of being succesful with the abovementioned setup program, I will need to re-code my VB DataEnvironment sample Forms in order to get them to work in a Microsoft Visual Basic Package & Deployment world.

Please, stay tuned...

James
0
 
LVL 6

Expert Comment

by:xSinbad
ID: 6990643
Ok
This is the conection string, you need to fill in the info like database name, server, login and password;
strConnect = "ODBC;Driver=SQL Server;Server=Server;DATABASEDatabase;UID=login;PWD=Password"
This opens the connection;
Set dbsData = OpenDatabase("", False, False, strConnect)

This bit just sets a long timeout;
   dbsData.QueryTimeout = "600"
Here you can place a SQL into the variable strSQL and it will be executed;
   dbsData.Execute strSQL, dbSQLPassThrough

This close the conection;
   dbsData.Close
set dbsData = Nothing



intead of the dbsData.Execute strSQL, dbSQLPassThrough, you can use something like dbsData.openrecordset(TableName, dbOpenDynaset) this will return you a recordset to work with.

Cheers
Marcus
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 3

Accepted Solution

by:
n_narayanan earned 400 total points
ID: 6992826
James

Here is a sample script for you,

; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

[Setup]
AppName=Bulk Loan Processing System
AppVerName=Bulk Loan Processing System 1.0
AppPublisher=Equity One Inc.
AppPublisherURL=http://www.equityone.com
AppSupportURL=http://www.equityone.com
AppUpdatesURL=http://www.equityone.com
DefaultDirName={pf}\Bulk Loan Processing System
DefaultGroupName=Bulk Loan Processing System
OutputDir=D:\EquityPD
OutputBaseFilename=BLPS_SETUP
DontMergeDuplicateFiles=true
DisableStartupPrompt=true
EnableDirDoesntExistWarning=true
WizardImageFile=D:\EquityPD\installwiz2.bmp
AdminPrivilegesRequired=true

[Tasks]
Name: desktopicon; Description: Create a &desktop icon; GroupDescription: Additional icons:
Name: quicklaunchicon; Description: Create a &Quick Launch icon; GroupDescription: Additional icons:; Flags: unchecked

[Files]
; START DCOM
Source: Redist\DCOM\dcom95.EXE; DestDir: {tmp}; CopyMode: alwaysoverwrite; MinVersion: 4.0,0; OnlyBelowVersion: 4.1,0
Source: Redist\DCOM\dcom98.exe; DestDir: {tmp}; CopyMode: alwaysoverwrite; MinVersion: 4.1,0
Source: Redist\DCOM\dcm95cfg.exe; DestDir: {tmp}; CopyMode: alwaysoverwrite; MinVersion: 4.0,0
; END DCOM
; START MDAC
Source: Redist\MDAC\mdac_typ.exe; DestDir: {tmp}; CopyMode: alwaysoverwrite; MinVersion: 4.0,4.0; OnlyBelowVersion: 0,5.0
; END MDAC
Source: Redist\STDOLE2.TLB; DestDir: {sys}; Flags: restartreplace uninsneveruninstall regtypelib; CopyMode: alwaysskipifsameorolder
Source: Redist\MSVBVM60.dll; DestDir: {sys}; Flags: restartreplace uninsneveruninstall regserver; CopyMode: alwaysskipifsameorolder
Source: Redist\OleAut32.dll; DestDir: {sys}; Flags: restartreplace uninsneveruninstall regserver; CopyMode: alwaysskipifsameorolder
Source: Redist\OlePro32.dll; DestDir: {sys}; Flags: restartreplace uninsneveruninstall regserver; CopyMode: alwaysskipifsameorolder
Source: Redist\AsycFilt.dll; DestDir: {sys}; Flags: restartreplace uninsneveruninstall; CopyMode: alwaysskipifsameorolder
Source: Redist\ComCat.dll; DestDir: {sys}; Flags: restartreplace uninsneveruninstall regserver; CopyMode: alwaysskipifsameorolder
Source: Support\MSSTDFMT.DLL; DestDir: {sys}; Flags: regserver sharedfile uninsneveruninstall; CopyMode: alwaysskipifsameorolder
Source: Support\Msmask32.ocx; DestDir: {sys}; Flags: regserver sharedfile uninsneveruninstall; CopyMode: alwaysskipifsameorolder
Source: Support\RICHED32.DLL; DestDir: {sys}; Flags: uninsneveruninstall; CopyMode: alwaysskipifsameorolder
Source: Support\Richtx32.ocx; DestDir: {sys}; Flags: regserver sharedfile uninsneveruninstall; CopyMode: alwaysskipifsameorolder
Source: Support\Comdlg32.ocx; DestDir: {sys}; Flags: regserver sharedfile uninsneveruninstall; CopyMode: alwaysskipifsameorolder
Source: Support\Mscomctl.ocx; DestDir: {sys}; Flags: regserver sharedfile uninsneveruninstall; CopyMode: alwaysskipifsameorolder
Source: Support\Mscomct2.ocx; DestDir: {sys}; Flags: regserver sharedfile uninsneveruninstall; CopyMode: alwaysskipifsameorolder
Source: Support\Tabctl32.ocx; DestDir: {sys}; Flags: regserver sharedfile uninsneveruninstall; CopyMode: alwaysskipifsameorolder
Source: Support\mfc42.dll; DestDir: {sys}; Flags: regserver uninsneveruninstall; CopyMode: alwaysskipifsameorolder
Source: Support\msvcrt.dll; DestDir: {sys}; CopyMode: alwaysskipifsameorolder
Source: Support\SPR32X30.ocx; DestDir: {sys}; Flags: regserver sharedfile uninsneveruninstall; CopyMode: alwaysoverwrite
Source: Support\Excel8.olb; DestDir: {sys}; Flags: sharedfile uninsneveruninstall; CopyMode: alwaysoverwrite
Source: Support\scrrun.dll; DestDir: {sys}; CopyMode: alwaysoverwrite; Flags: regserver sharedfile uninsneveruninstall
;Source: Support\MSXML.DLL; DestDir: {sys}; CopyMode: alwaysoverwrite; Flags: regserver sharedfile uninsneveruninstall
Source: Support\Msscript.ocx; DestDir: {sys}; CopyMode: alwaysoverwrite; Flags: regserver sharedfile uninsneveruninstall
Source: Support\Msado20.tlb; DestDir: {sys}; Flags: sharedfile uninsneveruninstall regtypelib; CopyMode: alwaysskipifsameorolder
Source: ..\EquityOne\BLPS.exe; DestDir: {app}
Source: ..\EquityOne\usermanual\BulkLoanProcess.chm; DestDir: {app}\usermanual; CopyMode: alwaysoverwrite
Source: ..\EquityOne\BLPS_TM_CITY.txt; DestDir: {app}
Source: ..\EquityOne\LocalDB.mdb; DestDir: {app}
Source: Support\hh.exe; DestDir: {sys}; CopyMode: alwaysskipifsameorolder
Source: Support\Mscomct2.dep; DestDir: {sys}; CopyMode: alwaysskipifsameorolder
Source: Support\Scrrun.dep; DestDir: {sys}; CopyMode: alwaysskipifsameorolder
Source: ..\LoanProcess\LoanProcess.exe; DestDir: {app}
Source: ..\EquityOne\Backup\Transfer.mdb; DestDir: {app}\Backup
Source: ..\EquityOne\Master.mdb; DestDir: {app}
; END VISUAL BASIC
; START VISUAL BASIC 6.0

[Icons]
Name: {group}\Bulk Loan Processing System; Filename: {app}\BLPS.exe
Name: {group}\Off-Line Process; Filename: {app}\LoanProcess.exe; IconIndex: 0
Name: {group}\User Manual; Filename: {app}\usermanual\BulkLoanProcess.chm; WorkingDir: {app}\usermanual; IconFilename: {sys}\hh.exe; IconIndex: 0
Name: {group}\Uninstall Bulk Loan Processing System; Filename: {uninstallexe}
Name: {userdesktop}\Bulk Loan Processing System; Filename: {app}\BLPS.exe; Tasks: desktopicon
Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\Bulk Loan Processing System; Filename: {app}\BLPS.exe; Tasks: quicklaunchicon



[Run]
; START DCOM
Filename: {tmp}\dcom95.EXE; Parameters: /r:n /q:u; WorkingDir: {tmp}; Flags: skipifdoesntexist; MinVersion: 4.0,0; OnlyBelowVersion: 4.1,0
Filename: {tmp}\dcom98.exe; Parameters: /r:n /q:u; WorkingDir: {tmp}; Flags: skipifdoesntexist; MinVersion: 4.1,0
Filename: {tmp}\dcm95cfg.exe; Parameters: /r:n /q:u; WorkingDir: {tmp}; Flags: skipifdoesntexist; MinVersion: 4.0,0
; END DCOM
; START MDAC
Filename: {tmp}\mdac_typ.exe; Parameters: "/Q /C:""setup /QNT"""; WorkingDir: {tmp}; Flags: skipifdoesntexist; MinVersion: 4.0,4.0; OnlyBelowVersion: 0,5.0
; END MDAC

Filename: {tmp}\mdac_typ.exe; WorkingDir: {tmp}; Flags: skipifdoesntexist

[_ISTool]
EnableISX=false

[Dirs]
Name: {app}\usermanual; Flags: uninsalwaysuninstall
Name: {app}\download; Flags: uninsalwaysuninstall
Name: {app}\Backup; Flags: uninsalwaysuninstall

[UninstallDelete]
Name: {app}\BLPS.exe; Type: filesandordirs

Narayanan
0
 

Author Comment

by:jnowlin
ID: 7004861
I've run into some other problems (Oracle nightmares) and have been working to correct them.
Please bear with me.

Jim
0
 

Author Comment

by:jnowlin
ID: 7010145
Oracle - I'll get back to it.

Update: 05/14/02
Tonight, I focused on getting my 6 or so Forms, which use 8 or so cmd objects in the Data Environment Designer to work with a connection string built in the DED's Data Link window. I am using this approach because, out on the Net, I read that, although one can create a DSN, it is not distributable beyond one's machine or server.
So, this is becomming a DSN-Less issue for sure.

I would like very much *not* to "re-invent" the wheel and re-do all of these connections as multiple ADODC controls, all of my Data Environments SQL....
So, in the DED's Data Link window, a choice may be made.
1) a DSN, or
2) a connection string can be built.

Finally finding how to express the driver for Adaptive Server AnyWhere as in:
DRIVER={Adaptive Server AnyWhere 6.0},

I successfully made a connection for this Data Environment using this:

DRIVER={Adaptive Server AnyWhere 6.0};UID=dba;PWD=sql;Start=D:\Program Files\Sybase\Adaptive Server Anywhere 6.0\win32\dbeng6.exe  -c 8m;DatabaseFile=D:\Program Files\Sybase\Adaptive Server Anywhere 6.0\asademo.db;AutoStop=Yes;Integrated=No

So, NOW, I need to figure out how to get something to point to (be assigned to) this connection string for this DE.

Previously, using a DSN named deSQLAny_1, I then declared a variable, 'de' as:
Private WithEvents de As deSQLAny_1,
Private WithEvents rs As ADODB.RecordSet
and subsequently used this:

de.Add(rs) ' add a record to the database
de.delete(rs) ' delete a record from the database
etc.

I'm probably a far way off still, but I think I'm closer to being able to distribute a working application, at least the ASAnyWhere part.
I'll be working with XSinbad's suggestions primarily now.

Jim
0
 

Author Comment

by:jnowlin
ID: 7022487
I'm not sure of anything right now. This whole project has been a real pain.
I managed, through sheer brute brainwork, to get a DSN-Less connection within the Data Link window of the Data Environment Designer. This was after I learned that the creation of a DSN from within the Setup1.vbp doesn't work because (from Microsoft's Online Knowledge Base) the DataEnvironment Designer cannot use DSNs anywhere but on a standalone PC.
So, this Data Environment, using a connection string, now connects to this Sybase Adaptive Server AnyWhere database using this VB app developed on my WIN2K partition. Run P&D and try to run Setup on Windows XP home ---
<bang>"Data Source not found and no driver specified" - or something like that.
Now, just for this database, I need to find Sybase's "client installation".
I guess merely having the database file in the same folder as your VB project file, with all its associated files, is yet not enough.

I'm off to find it.

Talk about learning/looking for something.
0
 

Author Comment

by:jnowlin
ID: 7039733
5/28/02
I've been working on trying not to get disowned from a family member the last week. Another VB app I wrote has caused Windows Media player to no longer function in my brother's PC.
Jim
0
 
LVL 3

Expert Comment

by:n_narayanan
ID: 7040842
JIM

Did you try the inno setup script which I posted?

Narayanan
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 7082321
Is this resolved?
MOondancer - EE Moderator
0
 

Author Comment

by:jnowlin
ID: 7090783
This is still not resolved Moondancer.

I've been quite ill the last few weeks, including spending a night in the local ER.
I haven't been able to work on it. I *may* need to close out this question in favor of re-posting the question differently, although 'n_narayanan''s solution is very extensive indeed.

For me, what I am trying to accomplish here is both difficult and complex and likely worth substantially more points than the 400 I presently offer.

Jim
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 7090845
Hi, Jim.  I'm very sorry to hear of your illness, and wish you a total and speedy recovery.

Let us know what you want done here, points can be increased to 500, as needed, and you may choose to continue here or start a new one, let me know.

So long as you update this at intervals, and it doesn't appear abandoned, it should be fine.

Best wishes,
Moondancer - EE Moderator
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 7090848
P.S.  This is a very high-volume topic area, and this has moved down in the queue so perhaps won't draw the attention a new question would.  You "may" benefit by posting a new one instead if there is no quick response here.
0
 
LVL 3

Expert Comment

by:n_narayanan
ID: 7091701
Hi Jim

Any points for me (my effort)!?

Thanks

Narayanan
0
 

Author Comment

by:jnowlin
ID: 7099091
I will post additional questions.
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 7099218
Thanks, jnowlin.
Moondancer - EE Moderator
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

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

13 Experts available now in Live!

Get 1:1 Help Now