Post your Vb 6.0 Questions Here

Welcome. Please Login, Register, Or Activate! 
type your username and password to login
Date: November 21, 2009, 11:32 PM
430615 members and 297761 Topics
Latest Member: ujbaby222
Nairaland [Nigerian Forum] Home Help Search Who is currently online? Login Register
Nairaland Forum  |  Technology  |  Programming  |  Post your Vb 6.0 Questions Here
Pages: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) ... (13) Go Down Send this topic Notify of replies
Author Topic: Post your Vb 6.0 Questions Here  (Read 13152 views)
luckyCO
Re: Post your Vb 6.0 Questions Here
« #96 on: May 19, 2008, 11:45 AM »

No more questions?
faoni572 (m)
Re: Post your Vb 6.0 Questions Here
« #97 on: June 03, 2008, 03:20 PM »

Pls, how can i make my vb program run on any other computer that don't have VB 6.0 installed on it. What is the process to compile VB programs so it can run independently on any other computers?

Thanks a lot for your anticipated response.
luckyCO
Re: Post your Vb 6.0 Questions Here
« #98 on: June 04, 2008, 02:41 PM »

VB Version VB-Enterprise.

VB can run on a system that doesn't have VB installed through the following processes;
First the program should be successfully compile by using the File Menu
Make <Your Porject Name >.Exe
When  you click at it a wizard will apear that will guide you in its compilation to executable file.


After a successful compilation;
To make package it which will make it run on any system after installation;

Click Add-Ins and from the sub menu click at Add In Manager
A window will appear;

If you installed VB properly
You will see a lot of tools in a window that will appear.


Look for Package and Development wizard and click at it to highlight it.
Go down you will Load behavior Frame tool
And Under it you will see Three Check boxes

Ckeck Loaded/Unloaded
And
Load on Startup

And click at OK button above.

Go back to Add-Ins menu again
You will see the option called Package and Development wizard and click at it.

Alternatively you can goto your program sub menu and click at Microsoft Visual Studio 6.0 and from other sub menu select Microsoft Visual Studio 6.0 tools and you will find Package and Development wizard and click at it.


A window appears containing three graphical buttons
Click at Package if it ask you to recompile say no.
Choose standard setup and click Next Button.

Choose the location/folder  where you want the setup to be dumped for you and click Next Button.

You will see libraries and files associated your program which will help your program run well.
Should in case you have other files to add maybe access file, you use Add Button and navigate for the file and click Next Button.

Choose Single Cab Option button and click Next Button.

Enter what you would like to name your project and click Next Button.

Since you would like the program to be accessed from Program sub menu click Next Button.

Click Next Button Again
And Next Button Again

And Finally Click Finish Button
and wait for a while as the system build your tool to a setup file.

After a successful packaging a window will appear then click close.

Go to that folder selected above you will four files.
Copy the four files to any system of your choice that may not have VB6.0

Double click at Setup.exe and follow the installation process at the end it will run.

Am in a hurry I would have checked my typing, there maybe some typologically error, plz bear with me.

Let me know whether if it helped u.











faoni572 (m)
Re: Post your Vb 6.0 Questions Here
« #99 on: June 05, 2008, 07:41 AM »

Pls look at this program:

Option Explicit

          Private Sub Command1_Click()
          Static n As Integer
          n = n + 1
          Label1.Caption = "No of clicked = " & n
          End Sub

          Private Sub Command2_Click()

         End Sub

The label will be telling me the number of times i click command. Pls what can i write in command2 so that when i click it the n will reset to 0 and when i click the command1, n will start from 1 instead of continue from where it was before.

Hope u get the question, i will be expecting your reply. Thanks a lot and God bless u.

luckyCO
Re: Post your Vb 6.0 Questions Here
« #100 on: June 05, 2008, 12:56 PM »

I don't know whether I understand what you are saying.
You should have told me why you needed the procedure, anyway try this;

Dim n as integer

Private Sub  Form1_load()
n=0
End sub

Private Sub Command1_Click()
                    n = n + 1
          Label1.Caption = "No of clicked = " & n
          End Sub

          Private Sub Command2_Click()
              n=0
         End Sub

Hope it will help you.

faoni572 (m)
Re: Post your Vb 6.0 Questions Here
« #101 on: June 06, 2008, 12:23 PM »

I really thank u for answering my questions in VB 6.0. your solutions actually work for my problems.  God will bless u abundantly.
luckyCO
Re: Post your Vb 6.0 Questions Here
« #102 on: June 06, 2008, 04:29 PM »

Thank God that it really helped you.
Should in case you have more questions, don't hesitate to post it here since we are having steady internet services now
I think I would always come here to answer them.

If you are migrating to .Net, you can also ask your questions, especially vb.net and C# using VS2005 Development tool.

Take care and remain blessed.


faoni572 (m)
Re: Post your Vb 6.0 Questions Here
« #103 on: June 08, 2008, 08:40 PM »

pls, how can one do it in VB 6.0 when u maximise your form then all the controls on the form will adjust to the new position and when u are resizing the form by reducing the size, controls will adjust accordingly. Thanks a lot for your past responses u have been giving me. The truth is that i am learning VB 6.0 by reading on my own and i have been writing some simple programs. i must confess that u have really been a source of help for me. thanks
luckyCO
Re: Post your Vb 6.0 Questions Here
« #104 on: June 14, 2008, 07:20 PM »

For VB6.0 you have to use code to arrange those controls where they should be.

What I normally do is to disable Maximize button and design whatever I want on the interface giving to you.
Then u will have option of either minimizing or closing it.

But if the form in question is MDIFORM which  houses nothing other than forms, then I can allow three control buttons.

But in Vb.NET they have provided us with DOCK and ANCHOR to achieve that.

Thanks


luckyCO
Re: Post your Vb 6.0 Questions Here
« #105 on: June 21, 2008, 05:12 AM »

Hope no more questions
javaprince (m)
Re: Post your Vb 6.0 Questions Here
« #106 on: June 21, 2008, 01:41 PM »

@topic
Good work you doing down here. Saw the way, u answered those questions beautifully. Used to program VB 6.0(it was my first Major Programming) long ago (2003/05), but now am a Java guy. Love Java for its power and flexibility + OOP.
Its good to know your also into C# and VB.NET, if u don't mind, I'll like to assist u in answerin some of the questions that comes along
luckyCO
Re: Post your Vb 6.0 Questions Here
« #107 on: June 23, 2008, 12:44 PM »

Java prince
You are welcome, I might not know it all.
Thanks man
luckyCO
Re: Post your Vb 6.0 Questions Here
« #108 on: June 26, 2008, 05:32 PM »

I hope there no questions for me to answer?
alex406 (m)
Re: Post your Vb 6.0 Questions Here
« #109 on: June 28, 2008, 10:36 AM »

Lucky,thanks for your update.
zmovement
Re: Post your Vb 6.0 Questions Here
« #110 on: July 08, 2008, 11:26 AM »

What code do you attach to the Command1_Click Procedure of the "Search" Command Button for an application form which is to search an Access 2000 database table (.mdb format) in its first two columns (Surname and First Name, for instance), in order for it to commence searching the two columns listed and to display the result sets of rows containing entries in the first two rows which contain part or all of the string segments of the code just entered in the search box. (If you are familiar with the Access 2007 ADO Data Control, it has the search box just between the search arrow buttons.)

N.B This is the heart of most rudimentary applications for schools, hotel or other parastatal management software.

Thank you very much.
zmovement
Re: Post your Vb 6.0 Questions Here
« #111 on: July 10, 2008, 01:43 PM »

What code do you attach to the Command1_Click Procedure of the "Search" Command Button for an application form which is to search an Access 2000 database table (.mdb format) in its first two columns (Laballed Surname and First Name, for instance), in order for it to commence searching the two columns labelled as above (Surname and First Name, for instance), and to display the result sets of rows containing entries in the first two rows which contain part or all of the string segments of the code just entered in the search box for single or group search operations. (If you are familiar with the Access 2007 ADO Data Control, it has the search box just between the search arrow buttons.)

N.B This is the heart of most rudimentary applications for schools, hotel or other parastatal management software.

Also enlighten me on how I can use SQL for this purpose.

Thank you very much.
zmovement
Re: Post your Vb 6.0 Questions Here
« #112 on: July 10, 2008, 01:45 PM »

What code do you attach to the Command1_Click Procedure of the "Search" Command Button for an application form which is to search an Access 2000 database table (.mdb format) in its first two columns (Laballed Surname and First Name, for instance), in order for it to commence searching the two columns labelled as above (Surname and First Name, for instance), and to display the result sets of rows containing entries in the first two rows which contain part or all of the string segments of the code just entered in the search box for single or group search operations. (If you are familiar with the Access 2007 ADO Data Control, it has the search box just between the search arrow buttons.)

N.B This is the heart of most rudimentary applications for schools, hotel or other parastatal management software.

Also enlighten me on how I can use SQL for this purpose.

Thank you very much.


howdytee (m)
Re: Post your Vb 6.0 Questions Here
« #113 on: July 11, 2008, 09:22 AM »

pls,hw do i get my app 2save infm in2 a database?i dsignd an app 4a hospital,4 staff records,bt cnt get it 2store input
bartigo (m)
Re: Post your Vb 6.0 Questions Here
« #114 on: July 11, 2008, 10:56 AM »

@luckyCO
  hi please am a new programer and i would like to learn vb 6.0, though i have already started b4 leaving school for the hols, but i didn't go far so i was wondering if you could help me with any site that might be useful for me to learn faster. thanks. 
luckyCO
Re: Post your Vb 6.0 Questions Here
« #115 on: July 11, 2008, 02:03 PM »

Quote from: zmovement on July 10, 2008, 01:43 PM
What code do you attach to the Command1_Click Procedure of the "Search" Command Button for an application form which is to search an Access 2000 database table (.mdb format) in its first two columns (Laballed Surname and First Name, for instance), in order for it to commence searching the two columns labelled as above (Surname and First Name, for instance), and to display the result sets of rows containing entries in the first two rows which contain part or all of the string segments of the code just entered in the search box for single or group search operations. (If you are familiar with the Access 2007 ADO Data Control, it has the search box just between the search arrow buttons.)

N.B This is the heart of most rudimentary applications for schools, hotel or other parastatal management software.

Also enlighten me on how I can use SQL for this purpose.

Thank you very much.

I may not say I understand you very well but I will give you solutions.


Call the procedure below by using
Dim ConString as string
dim DbpathName as string
Dim CMText as string

DbpathName= "C:\DatabaseName.mdb"
CMText="Select Firstname,Surname from <TableName>

ConString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DbpathName & ";Persist Security Info=False

FillInMSH MSHFlexGrid1,ConString,CMText
To fill all rows in the selected table found in the two columns.


To filter the query you can use equal(=) of Like command after where statement as follows
Using Equal(=)

CMText="CMText="Select Firstname,Surname from <TableName> where surname='White' And Firstname='Bush'
FillInMSH MSHFlexGrid1,ConString,CMText


Using Like

CMText="CMText="Select Firstname,Surname from <TableName> where surname like'Whit%e' And Firstname like'Bush%'
FillInMSH MSHFlexGrid1,ConString,CMText


If you want to use textbox which means as soon as you type it will filter then use
For Surname

Private Sub Text1_Change()
CMText="CMText="Select Firstname,Surname from <TableName> where surname like'" & text1.text & "%'"
FillInMSH MSHFlexGrid1,ConString,CMText
End Sub



PPublic  sub  FillInMSH(MSH1 As MSHFlexGrid, ConnectingString As String, CommandText  As String)
On Error GoTo errh
Dim j As Long, i As Integer, db As New ADODB.Recordset
Dim rs As New ADODB.Connection
rs.ConnectionString = ConnectingString
rs.Open
Set db = rs.Execute(CommandText)
MSH1.Refresh
MSH1.Rows = 2
MSH1.Cols = db.Fields.Count
For j = 0 To db.Fields.Count - 1
MSH1.TextMatrix(0, j) = db.Fields(j).Name
MSH1.TextMatrix(1, j) = ""
Next j
j = 0
Do While Not db.EOF
j = j + 1
MSH1.Rows = j + 1
For  I = 0 To db.Fields.Count - 1
MSH1.TextMatrix(j, i) = " " & db.Fields(i).Value
DoEvents
Db.movenext
Next  I
Loop
db.Close
rs.Close
Exit sub

errh:
End sub

Try and see whether it answers your question
luckyCO
Re: Post your Vb 6.0 Questions Here
« #116 on: July 11, 2008, 02:06 PM »

Quote from: bartigo on July 11, 2008, 10:56 AM
@luckyCO
  hi please am a new programer and i would like to learn vb 6.0, though i have already started before leaving school for the hols, but i didn't go far so i was wondering if you could help me with any site that might be useful for me to learn faster. thanks. 

Go to www.vbsource.com or www.codeproject.com,www.vbsourcecode.com
luckyCO
Re: Post your Vb 6.0 Questions Here
« #117 on: July 11, 2008, 02:08 PM »

Quote from: howdytee on July 11, 2008, 09:22 AM
please,hw do i get my app 2save infm in2 a database?i dsignd an app 4a hospital,4 staff records,bt cnt get it 2store input

I think I have answered this question.
Please go through the thread you will see how to save data , retrieve and update data in to and from a database.

But if you insist that I do it again do let me know.
howdytee (m)
Re: Post your Vb 6.0 Questions Here
« #118 on: July 11, 2008, 05:50 PM »

@ luckyCO
pls, i insist. the thread is so much that to go thru it, looking for that info will be tiresome. plssssssssssss.
luckyCO
Re: Post your Vb 6.0 Questions Here
« #119 on: July 14, 2008, 03:21 PM »

To Save the database the the following

SaveData <your connectionstring>,<Insert into <your Table> (name,age,sex) values ('Nairaland',89,'Male')


To Retrieve data from your database.
dim rs as Dim db As New ADODB.Recordset
set rs=OpenDatabase(<your connectionstring>,<Select <your Table> name,age,sex)
msgbox rs.fields(0).value
msgbox rs.fields(1).value
msgbox rs.fields(2).value
rs.close



Note: Functions that are called to do save and select for you.

Function OpenDatabase(ConnectionString As String, SQL As String) As ADODB.Recordset
Dim db As New ADODB.Recordset
db.ActiveConnection =ConnectionString
db.Source = SQL
db.CursorType = adOpenKeyset
db.LockType = adLockOptimistic
db.Open
Set OpenDatabase = db
End Function


Public Sub SaveData(ConnectionString As String, SQL As String)
Dim CNN As New ADODB.Connection
Dim iAffected As Integer

CNN.Open ConnectionString

CNN.Execute SQL, iAffected, adExecuteNoRecords

CNN.Close

End Sub
howdytee (m)
Re: Post your Vb 6.0 Questions Here
« #120 on: July 15, 2008, 07:10 AM »

10ks,bt wats my connectn string spse 2b?&u made mention of SQL in some lines.i dnt av dat on my system,bt MS-ACCESS.10ks
luckyCO
Re: Post your Vb 6.0 Questions Here
« #121 on: July 15, 2008, 09:47 AM »

For MS Access your connection string can be
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DbpathName & ";Persist Security Info=False"

SQL variable  is your commandtext,what you want the db handle to do for.
You have Data maniplation,Data definition etc, they form part of your Commandtext

Eg.
To select all data in a table named customer you would type;
SQL="Select * from customer"

To delete all data in the table named customer;
SQL="Delete from customer"

Take care
luckyCO
Re: Post your Vb 6.0 Questions Here
« #122 on: July 16, 2008, 03:02 PM »

Hope we dont have any more questions to ask?
luckyCO
Re: Post your Vb 6.0 Questions Here
« #123 on: July 17, 2008, 06:06 PM »

Am waiting for more questions
faoni572 (m)
Re: Post your Vb 6.0 Questions Here
« #124 on: July 21, 2008, 09:59 AM »

Hi Lucky, hope you still remember me, you are really doing a great job. God bless you.  Please how is it possible to save picture to databese. I want a database that can save personal data including picture of the person but the picture side is given me problem, can you give me clue on how to do it. Thanks a lot
faoni572 (m)
Re: Post your Vb 6.0 Questions Here
« #125 on: July 21, 2008, 10:05 AM »

In addition to the question above, I want to let you know that I am using Access as my database. Thanks
luckyCO
Re: Post your Vb 6.0 Questions Here
« #126 on: July 22, 2008, 04:36 PM »

I have answered this type of question here.
Please do me a favor and scan through you will get it. I even attached the program itself.

So u have to do the assignment.
faoni572 (m)
Re: Post your Vb 6.0 Questions Here
« #127 on: July 25, 2008, 08:51 AM »

Ok, I will try to go through all the posts, thanks a lot
 Oracle DBA Corner  Tutorials On Game Programming  Java Programming For Dummies  Page 2
Pages: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) ... (13) Go Up Send Topic to Friend by E-mail Reply 


Sections: Autos/Cars (2) Jobs/Vacancies (2) (3) Career Talk Education General(2) Politics Romance Computers Phones Travel
Sports Fashion Health Religion Celebrities TV/Movies (2) Music/Radio (2) Books Webmasters Programming

Links: Page1 Page2 Page3 Page4 Page5 Page6 Page7 Page8 Page9 Page10

Nairaland is owned by Oluwaseun Osewa. See also: Nairalist Classified Ads
Nairaland Forum | Powered by SMF 1.0.12.
© 2001-2005, Lewis Media. All Rights Reserved.