Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,150,834 members, 7,810,208 topics. Date: Friday, 26 April 2024 at 11:55 PM

Post Ur Vb 6.0 Questions Here - Programming (4) - Nairaland

Nairaland Forum / Science/Technology / Programming / Post Ur Vb 6.0 Questions Here (40181 Views)

A Comprehensive Tutorial On Vb 6.0 / My Board Games In Vb 6.0 / Vb 6.0/vb .NET & Intranet/internet Application Development (2) (3) (4)

(1) (2) (3) (4) (5) (6) (7) (8) (9) (10) ... (16) (Reply) (Go Down)

Re: Post Ur Vb 6.0 Questions Here by luckyCO(m): 11:45am On May 19, 2008
No more questions?
Re: Post Ur Vb 6.0 Questions Here by faoni572(m): 3:20pm On Jun 03, 2008
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 ur anticipated response.
Re: Post Ur Vb 6.0 Questions Here by luckyCO(m): 2:41pm On Jun 04, 2008
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 [/b]Frame tool
And Under it you will see Three Check boxes

Ckeck [b]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.
Re: Post Ur Vb 6.0 Questions Here by faoni572(m): 7:41am On Jun 05, 2008
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 ur reply. Thanks a lot and God bless u.
Re: Post Ur Vb 6.0 Questions Here by luckyCO(m): 12:56pm On Jun 05, 2008
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.
Re: Post Ur Vb 6.0 Questions Here by faoni572(m): 12:23pm On Jun 06, 2008
I really thank u for answering my questions in VB 6.0. Ur solutions actually work for my problems. God will bless u abundantly.
Re: Post Ur Vb 6.0 Questions Here by luckyCO(m): 4:29pm On Jun 06, 2008
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.
Re: Post Ur Vb 6.0 Questions Here by faoni572(m): 8:40pm On Jun 08, 2008
pls, how can one do it in VB 6.0 when u maximise ur 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 ur 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
Re: Post Ur Vb 6.0 Questions Here by luckyCO(m): 7:20pm On Jun 14, 2008
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
Re: Post Ur Vb 6.0 Questions Here by luckyCO(m): 5:12am On Jun 21, 2008
Hope no more questions
Re: Post Ur Vb 6.0 Questions Here by javaprince(m): 1:41pm On Jun 21, 2008
@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 ur 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
Re: Post Ur Vb 6.0 Questions Here by luckyCO(m): 12:44pm On Jun 23, 2008
Java prince
You are welcome, I might not know it all.
Thanks man
Re: Post Ur Vb 6.0 Questions Here by luckyCO(m): 5:32pm On Jun 26, 2008
I hope there no questions for me to answer?
Re: Post Ur Vb 6.0 Questions Here by alex406(m): 10:36am On Jun 28, 2008
Lucky,thanks for your update.
Re: Post Ur Vb 6.0 Questions Here by zmovement(m): 11:26am On Jul 08, 2008
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.
Re: Post Ur Vb 6.0 Questions Here by zmovement(m): 1:43pm On Jul 10, 2008
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.
Re: Post Ur Vb 6.0 Questions Here by zmovement(m): 1:45pm On Jul 10, 2008
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.
Re: Post Ur Vb 6.0 Questions Here by howdytee(m): 9:22am On Jul 11, 2008
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
Re: Post Ur Vb 6.0 Questions Here by bartigo(m): 10:56am On Jul 11, 2008
@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.
Re: Post Ur Vb 6.0 Questions Here by luckyCO(m): 2:03pm On Jul 11, 2008
zmovement:

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
Re: Post Ur Vb 6.0 Questions Here by luckyCO(m): 2:06pm On Jul 11, 2008
bartigo:

@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
Re: Post Ur Vb 6.0 Questions Here by luckyCO(m): 2:08pm On Jul 11, 2008
howdytee:

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.
Re: Post Ur Vb 6.0 Questions Here by howdytee(m): 5:50pm On Jul 11, 2008
@ luckyCO
pls, i insist. the thread is so much that to go thru it, looking for that info will be tiresome. plssssssssssss.
Re: Post Ur Vb 6.0 Questions Here by luckyCO(m): 3:21pm On Jul 14, 2008
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
Re: Post Ur Vb 6.0 Questions Here by howdytee(m): 7:10am On Jul 15, 2008
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
Re: Post Ur Vb 6.0 Questions Here by luckyCO(m): 9:47am On Jul 15, 2008
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
Re: Post Ur Vb 6.0 Questions Here by luckyCO(m): 3:02pm On Jul 16, 2008
Hope we dont have any more questions to ask?
Re: Post Ur Vb 6.0 Questions Here by luckyCO(m): 6:06pm On Jul 17, 2008
Am waiting for more questions
Re: Post Ur Vb 6.0 Questions Here by faoni572(m): 9:59am On Jul 21, 2008
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
Re: Post Ur Vb 6.0 Questions Here by faoni572(m): 10:05am On Jul 21, 2008
In addition to the question above, I want to let you know that I am using Access as my database. Thanks
Re: Post Ur Vb 6.0 Questions Here by luckyCO(m): 4:36pm On Jul 22, 2008
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.
Re: Post Ur Vb 6.0 Questions Here by faoni572(m): 8:51am On Jul 25, 2008
Ok, I will try to go through all the posts, thanks a lot

(1) (2) (3) (4) (5) (6) (7) (8) (9) (10) ... (16) (Reply)

Java Programming For Dummies / Nigerian Software Engineer given test to prove he is an engineer at JFK Airport / Facebook Is Suing Me For This

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 50
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.