|
luckyCO
|
No more questions?
|
|
|
|
|
|
faoni572 (m)
|
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
|
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)
|
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
|
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)
|
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
|
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)
|
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
|
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
|
Hope no more questions
|
|
|
|
|
|
javaprince (m)
|
@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
|
Java prince You are welcome, I might not know it all. Thanks man
|
|
|
|
|
|
luckyCO
|
I hope there no questions for me to answer?
|
|
|
|
|
|
alex406 (m)
|
Lucky,thanks for your update.
|
|
|
|
|
|
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 (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
|
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
|
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)
|
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)
|
@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
|
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 SurnamePrivate 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
|
@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
|
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)
|
@ luckyCO pls, i insist. the thread is so much that to go thru it, looking for that info will be tiresome. plssssssssssss.
|
|
|
|
|
|
luckyCO
|
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)
|
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
|
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
|
Hope we dont have any more questions to ask?
|
|
|
|
|
|
luckyCO
|
Am waiting for more questions
|
|
|
|
|
|
faoni572 (m)
|
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)
|
In addition to the question above, I want to let you know that I am using Access as my database. Thanks
|
|
|
|
|
|
luckyCO
|
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)
|
Ok, I will try to go through all the posts, thanks a lot
|
|
|
|
|
|