473,397 Members | 2,077 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Building a single EXE file in VB 2005?

We have been using VB6 to develop small custom apps that access an
Oracle database, in order to extend a larger product that is developed
by our colleagues in Germany (who use C++ and Java).

As each app is small and simple, we have been distributing each to the
customer in the form of a single EXE file.

I have been attempting to build another one of these small custom apps,
using VB 2005 Express Edition. It doesn't seem to be possible to
produce a single EXE file using this environment: for a start, there is
no File -> Make executable menu, only a more complex Build -> Publish
menu, which I think produces an MSI installer file. There are deeper
problems, however. Is there anything incorrect in my thinking below?

1) In order to write a program that takes the results of queries on an
Oracle database and places them in an Excel spreadsheet, in VB6, we can
use (COM) ADODB and Excel.Range.CopyFromRecordset, which copies the
data in a single (fairly quick) step. The database facilities in
VB.NET provide no equivalent: we must instead write (slow and possibly
buggy) code that copies one row at a time from the query result into
the spreadsheet (see
<http://support.microsoft.com/?scid=kb;en-us;306022&spid=1249&sid=global>),
or use (COM) ADODB.

2) If our code uses COM objects (eg ADODB in the above case), it isn't
possible to compile the app into a single EXE file. It seems that
VB.NET needs to create an Interop.ADODB.dll file in this case.

I think if we want to continue to distribute single EXE files, it may
be best for us to stick with VB6.

Have I missed something?

Ashley.

Jun 26 '06 #1
7 12215
Hello ashley,

First, if you can't work the bugs out of a simple double loop perhaps you
should consider a different career path.
Second, the Express versions of the IDE are not for commercial use.
Third:

Set ExcelRowCounter
Set ExcelColumnCounter
Loop over each row
Loop over each column
Write Value to Excel Cell
Increment ExcelCellCounter
Next
Increment ExcelRowCounter
Next

-Boo
We have been using VB6 to develop small custom apps that access an
Oracle database, in order to extend a larger product that is developed
by our colleagues in Germany (who use C++ and Java).

As each app is small and simple, we have been distributing each to the
customer in the form of a single EXE file.

I have been attempting to build another one of these small custom
apps, using VB 2005 Express Edition. It doesn't seem to be possible
to produce a single EXE file using this environment: for a start,
there is no File -> Make executable menu, only a more complex Build ->
Publish menu, which I think produces an MSI installer file. There are
deeper problems, however. Is there anything incorrect in my thinking
below?

1) In order to write a program that takes the results of queries on an
Oracle database and places them in an Excel spreadsheet, in VB6, we
can
use (COM) ADODB and Excel.Range.CopyFromRecordset, which copies the
data in a single (fairly quick) step. The database facilities in
VB.NET provide no equivalent: we must instead write (slow and possibly
buggy) code that copies one row at a time from the query result into
the spreadsheet (see
<http://support.microsoft.com/?scid=k...=1249&sid=glob
al>),
or use (COM) ADODB.
2) If our code uses COM objects (eg ADODB in the above case), it isn't
possible to compile the app into a single EXE file. It seems that
VB.NET needs to create an Interop.ADODB.dll file in this case.

I think if we want to continue to distribute single EXE files, it may
be best for us to stick with VB6.

Have I missed something?

Ashley.

Jun 26 '06 #2
Hello Boo...

Thanks for the reply. I don't see the need for your confrontational
tone -- although I realise that I didn't give any information about my
background, which hasn't helped. I did give a little detail recently
in another post here:
<http://groups.google.co.uk/group/microsoft.public.dotnet.languages.vb/browse_frm/thread/3f0bd46d9cf7ee1d?hl=en>.

I would prefer to avoid writing code to do this particular job in order
to minimise risk of bugs. I'm worried about typing issues, for
instance. If a well-tested library already exists to do this (which it
does in VB6), I'd prefer to use that.

I will check out the licensing limitations on the Express editions --
thank you.

There were other issues in my original posting. Does anyone have any
more feedback?

Ashley.

Jun 27 '06 #3
Ashley,

I think that most of us are not aware of a more suitable standard library
for your purpose in VB6.

Interop with Office has never been a simple job, all was it alone that the
development part of Office has showed in past in a way its own standards of
programming to the world.

But it is as well not so impossible to do as you show.

There is a special Office Net addition in Visual Studio which is standard in
more expensive versions.
See in this link what is included in the Express version.

http://msdn2.microsoft.com/en-us/library/b4z62wxz.aspx
However in this sample set is as well a sample how to automate office, I
have the idea that it will go in the Express version as well, because it are
older samples. (I don't guarantee that).

http://www.microsoft.com/downloads/d...displaylang=en

I hope this helps,

Cor
<as*********@gmail.com> schreef in bericht
news:11**********************@c74g2000cwc.googlegr oups.com...
Hello Boo...

Thanks for the reply. I don't see the need for your confrontational
tone -- although I realise that I didn't give any information about my
background, which hasn't helped. I did give a little detail recently
in another post here:
<http://groups.google.co.uk/group/microsoft.public.dotnet.languages.vb/browse_frm/thread/3f0bd46d9cf7ee1d?hl=en>.

I would prefer to avoid writing code to do this particular job in order
to minimise risk of bugs. I'm worried about typing issues, for
instance. If a well-tested library already exists to do this (which it
does in VB6), I'd prefer to use that.

I will check out the licensing limitations on the Express editions --
thank you.

There were other issues in my original posting. Does anyone have any
more feedback?

Ashley.

Jun 27 '06 #4
ljh
Ashley,

I make no bones about it.......in comparing VB.Net to Visual Basic 6, I
think VB.Net is a huge step backwards. It made the easy stuff easier and
the hard stuff harder. Not a great accomplishment if you ask me. VB.Net
was written for Microsoft - not for developers. It solves internal problems
for MS while creating problems for developers. It is the single, largest
screw-up in the history of programming languages.

You are not going to have a "small and simple" application using VB.Net. It
will not be small because you cannot depend on the end user having .Net 2.0
installed. That will add 25 MB to your installation. This significantly
increases bandwidth and distribution costs for you. (Don't even ask me why
MS can make BETA WGA - Windows Genuine Advantage - a critical security
download and not include the .Net runtime as a critical OS update...seeing
as how .Net is their strategy for the future.)

There is a way to make the installation simple and save some space while
including only the portions of .Net that your application needs. It is
called Thinstall.

Thinstall can wrap your entire project (including all needed portions of the
..Net framework) into a single, encrypted executable. Your customer does not
even need the .Net framework installed to use your Thinstall-wrapped app.
It has built-in licensing with the ability to distribute time-limited trials
of your software. It is a fantastic application for making no-install", but
Thinstall starts at $4,000 per application - so it will increase your
distribution costs.

There are similar (and much less expensive) applications that wrap VB6
applications into a single exe - just so you know.

As for what you are looking to do in .Net, I don't know if this will help -
but take a look at
http://www.xtremevbtalk.com/archive/.../t-239550.html. There is a
discussion of similar functionality there.

And, although we all know that VB6 was not perfect, VB.Net has more than its
share of problems. If you haven't already, subscribe to the free KB emails
at www.kbalertz.com. You can specify .Net 2.0 to limit the number of alerts
that you get and you can also search for all of the kb articles for .Net 2.0
right on the site.

IMHO, if what you have works, there is no reason to change to VB.Net. Don't
complicate something that is working. You won't gain any speed advantage.
Your distribution costs will increase. And, Microsoft is changing the
framework yet again with WinFX - now known as .Net 3.0 - and depending on
you to distribute it.

Jim Hubbard

<as*********@gmail.com> wrote in message
news:11**********************@p79g2000cwp.googlegr oups.com...
We have been using VB6 to develop small custom apps that access an
Oracle database, in order to extend a larger product that is developed
by our colleagues in Germany (who use C++ and Java).

As each app is small and simple, we have been distributing each to the
customer in the form of a single EXE file.

I have been attempting to build another one of these small custom apps,
using VB 2005 Express Edition. It doesn't seem to be possible to
produce a single EXE file using this environment: for a start, there is
no File -> Make executable menu, only a more complex Build -> Publish
menu, which I think produces an MSI installer file. There are deeper
problems, however. Is there anything incorrect in my thinking below?

1) In order to write a program that takes the results of queries on an
Oracle database and places them in an Excel spreadsheet, in VB6, we can
use (COM) ADODB and Excel.Range.CopyFromRecordset, which copies the
data in a single (fairly quick) step. The database facilities in
VB.NET provide no equivalent: we must instead write (slow and possibly
buggy) code that copies one row at a time from the query result into
the spreadsheet (see
<http://support.microsoft.com/?scid=kb;en-us;306022&spid=1249&sid=global>),
or use (COM) ADODB.

2) If our code uses COM objects (eg ADODB in the above case), it isn't
possible to compile the app into a single EXE file. It seems that
VB.NET needs to create an Interop.ADODB.dll file in this case.

I think if we want to continue to distribute single EXE files, it may
be best for us to stick with VB6.

Have I missed something?

Ashley.

Jun 27 '06 #5
"GhostInAK" <gh*******@gmail.com> wrote in message
news:be*************************@news.microsoft.co m...
Second, the Express versions of the IDE are not for commercial use.


Not sure where you got that idea. From the FAQ for the express editions:

"4. Can I use Express Editions for commercial use?
Yes, there are no licensing restrictions for applications built using the
Express Editions"

Link: http://msdn.microsoft.com/vstudio/ex...t/faq/#general

/claes

Jun 27 '06 #6

"Claes Bergefall" <lo*****@nospam.nospam> wrote in message
news:Ou****************@TK2MSFTNGP02.phx.gbl...
"GhostInAK" <gh*******@gmail.com> wrote in message
news:be*************************@news.microsoft.co m...
Second, the Express versions of the IDE are not for commercial use.


Not sure where you got that idea. From the FAQ for the express editions:

"4. Can I use Express Editions for commercial use?
Yes, there are no licensing restrictions for applications built using the
Express Editions"

Link: http://msdn.microsoft.com/vstudio/ex...t/faq/#general


He probably meant "not for commercial use" as in XP Home is not (intended) for
commercial use, XP Pro is.
Jun 27 '06 #7
Hi Ashley,

I ran into the same Excel issue using adClipString with VB6.
It was so easy passing a recordset to Excel as a display interface for SQL
queries.

The work around I came up with for VB.Net was to issue a SQL query, parse
all field headings with VbTab, and then parse the returned fields for each
row.
The output is wrtten to a file, for which I then call Excel to display.
(It was only a couple of lines of code. See below)

Also, I've read that you can call old ADO recordset code from VB.Net by
setting a certain type of reference, so that you could use your current code
under VB.Net.
I just haven't tried it yet, because of the easy workaround listed below.

Something like:
sData = ""
strSQL = "select * from DBA_HIST_LibraryCache"
Get_Field_Values()
'oWrite = oFile.AppendText("C:\OracleAwrData.xls")
oWrite = oFile.("C:\OracleAwrData.xls")
oWrite.WriteLine(sData)
oWrite.Close()

Shell("C:\\Program Files\\Microsoft Office\\OFFICE11\\Excel.exe " & _
Chr(34) & "C:\OracleAwrData.xls" & Chr(34), vbMaximizedFocus)

Private Sub Get_Field_Values()

selectedDatabase = cmbServers.Items.Item(itemCountPointer)

Dim cnDBMS As New OleDbConnection
cnDBMS.ConnectionString = "Provider=msdaora;Data Source=" &
selectedDatabase & ";User Id=" & txtUserID.Text & ";Password=" &
txtPassword.Text & ";"

cnDBMS.Open()

Dim cmDBMS As New OleDbCommand(strSQL, cnDBMS)

Dim rdrDBMS As OleDbDataReader

rdrDBMS = cmDBMS.ExecuteReader(CommandBehavior.CloseConnecti on)

iFieldCount = rdrDBMS.FieldCount
sHeadingFlag = "N"

Do While rdrDBMS.Read()
If sHeadingFlag = "N" Then
sHeadingFlag = "Y"
For I = 0 To iFieldCount - 1
sData = sData & rdrDBMS.GetName(I) & vbTab
Next
sData = sData & vbCr
End If
For I = 0 To iFieldCount - 1
'sData = sData & selectedDatabase & vbTab &
CStr(Date.Now.ToShortDateString) & vbTab & CStr(Date.Now.ToShortTimeString) &
vbTab
sData = sData & CType(rdrDBMS.GetValue(I), String) & vbTab
Next
sData = sData & vbCr
Loop

cnDBMS.Close()

End Sub
--
Joseph Karpinski
"as*********@gmail.com" wrote:
We have been using VB6 to develop small custom apps that access an
Oracle database, in order to extend a larger product that is developed
by our colleagues in Germany (who use C++ and Java).

As each app is small and simple, we have been distributing each to the
customer in the form of a single EXE file.

I have been attempting to build another one of these small custom apps,
using VB 2005 Express Edition. It doesn't seem to be possible to
produce a single EXE file using this environment: for a start, there is
no File -Make executable menu, only a more complex Build -Publish
menu, which I think produces an MSI installer file. There are deeper
problems, however. Is there anything incorrect in my thinking below?

1) In order to write a program that takes the results of queries on an
Oracle database and places them in an Excel spreadsheet, in VB6, we can
use (COM) ADODB and Excel.Range.CopyFromRecordset, which copies the
data in a single (fairly quick) step. The database facilities in
VB.NET provide no equivalent: we must instead write (slow and possibly
buggy) code that copies one row at a time from the query result into
the spreadsheet (see
<http://support.microsoft.com/?scid=kb;en-us;306022&spid=1249&sid=global>),
or use (COM) ADODB.

2) If our code uses COM objects (eg ADODB in the above case), it isn't
possible to compile the app into a single EXE file. It seems that
VB.NET needs to create an Interop.ADODB.dll file in this case.

I think if we want to continue to distribute single EXE files, it may
be best for us to stick with VB6.

Have I missed something?

Ashley.

Jul 6 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: PatchFactory Support | last post by:
Description: Professional and easy-to-use patch building environment that can help you to create instant patch packages for software and file updating. Generated patch packages are small size...
9
by: Jenta | last post by:
A World Beyond Capitalism 2005, An Annual International Multiracial Alliance Building Peace Conference Is Accepting Proposals... ...and Online Registration is now available if you plan to table...
1
by: Asim Jalis | last post by:
Building a Single Assembly DLL with C# and C++ Code I am trying to create a single assembly composed of managed C++ and C# code, and I want to do this on the command line. I have confirmed...
4
by: Steve Jorgensen | last post by:
A while ago, I posted a 1/2 formed idea for what was probably an overcomplicated scheme for improving how we create content using the DOM API. Since then, I've been refactoring some real-world code...
8
by: Jacob Arthur | last post by:
How would I go about using a custom select string that is passed from a form to the SelectCommand parameter of SqlDataSource? I tried: SelectCommand = "<% Request.Form("hdnSelect") %>" but I...
4
by: Dariusz Tomon | last post by:
Hello I have got windows application project (C# Visual Studio 2003) with references to external dlls. All I want is to compile everything into one exe file, so that I can send it to another...
3
by: tony | last post by:
Hello!! I use VS 2003 and C# for all class library except MeltPracCommon.dll which is C++.NET The problem is that I get these warnings when building the exe file and use my class libraries....
2
by: magic kat | last post by:
I am working on a web based asp.net 2.0 project that began as an application in Visual Studio 2005. The web site appears to work okay, but when we attempt to build it, we get all sorts of errors. ...
4
by: ramshankaryadav | last post by:
Hi, I'm facing a problem while building a project through MSBuild, this project is a part of a solution which has several other projects on which it depends, but I want to build this project...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.