Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,152,773 members, 7,817,149 topics. Date: Saturday, 04 May 2024 at 07:10 AM

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

Nairaland Forum / Science/Technology / Programming / Post Ur Vb 6.0 Questions Here (40215 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 moore20: 7:20pm On Oct 14, 2008
lucky please how do i link 2 combo boxes to display states and their local government
just like what we see in most forms where u select state of origin from the first combo and then it displays a list of all the local governments in that state

abeg i need ur help

thanks a million
Re: Post Ur Vb 6.0 Questions Here by luckyCO(m): 2:47pm On Oct 15, 2008
U will have list of all the states and their corresponding localgovernments.\
Say In FCT we have
FCT Index no is 6
In your database you will have all these fields

StateID
LGAName

LIst
StateID LGANAME
6 AMAC
6 BWARI
6 KWALI
6 ect

Then you goto you the combo1_Click event
and write the following SQL statement

Select LGANAME from LGAtbl where STATEID=" & val(cboSTATEID.text)
Then insert in in your combo

If you need me to write the program for I will be happily do tht free of charge for you because it requires more procedures than this.

Thanks.
Text me on 08036025235
Re: Post Ur Vb 6.0 Questions Here by dami9ja(m): 11:40pm On Oct 24, 2008
@luckyc0, Great wrk u d0in here sir! I need ur help on this little thing. I jst re-started Vb n i created a simple result sheet which displays "grades","total" n "average" after some values are entered in the different "marks" boxes. What i need now is a way to count n display d numbers of of "fails" in d "grade" txtboxes i.e. If 2 courses are failed it shud display 2,if tis 3 it shud dsplay 3 n so on. Hope i wuz able 2 explain smethng. Thanks bro,
Re: Post Ur Vb 6.0 Questions Here by dami9ja(m): 11:44pm On Oct 24, 2008
@luckyc0, Also need some advice from u. Plz give me ur Yim id so we can tlk beta. Thanks. Myn is dammiedam.
Re: Post Ur Vb 6.0 Questions Here by moore20: 6:36pm On Oct 27, 2008
hi lucky
sorry to bother u again please how do i connect a vb project to a database(access) using ADODB connection
please start from project----reference or component e.t.c

keep up the good work
u r blessed,
Re: Post Ur Vb 6.0 Questions Here by luckyCO(m): 12:45pm On Oct 28, 2008
moore20:

hi lucky
sorry to bother u again please how do i connect a vb project to a database(access) using ADODB connection
please start from project----reference or component e.t.c

keep up the good work
u r blessed,

I don't like when somebody is feeling sorry for what he has been given right to do.
I have posted answer to this question but for the sake of not knowing the thread am posting it again.

To connect to database(access) using ADODB connection follow the steps;
1. Click at Project Menu , from its sub menu click References.
2. that will take you to a window, search and Check Microsoft Ado Ext. 2.8 For DLL and Security,Microsoft ActiveX data Objects 2.0 Library and Microsoft ActiveX data Record set 2.0 Library.
3. Click Ok Button
4. Open a form and command button.
5. Copy the code below and paste in the form declaration

Sub OpenD3(ConnString As String, SQL As String) As ADODB.Recordset
Dim dbw As New ADODB.Recordset
dbw.ActiveConnection = ConnString
dbw.Source = SQL
dbw.CursorType = adOpenKeyset
dbw.LockType = adLockOptimistic
dbw.Open
Set OpenD3 = dbw
End sub

6. Double click Command button and paste the code below
Dim rs New ADODB.Recordset
set rs=OPend3(your connection string,SQL)
the do whatever you want with the recordet.
Thanks


dami9ja:

@luckyc0, Also need some advice from u. Plz give me ur Yim id so we can tlk beta. Thanks. Myn is dammiedam.
dami9ja:

@luckyc0, Great wrk u d0in here sir! I need ur help on this little thing. I jst re-started Vb n i created a simple result sheet which displays "grades","total" n "average" after some values are entered in the different "marks" boxes. What i need now is a way to count n display d numbers of of "fails" in d "grade" txtboxes i.e. If 2 courses are failed it should display 2,if tis 3 it should dsplay 3 n so on. Hope i wuz able 2 explain smethng. Thanks bro,

If you were able to display those that failed in textboxes

Now use this code down and iterated and sum them.

dim txt as control
dim sum=0
For each txt in me
if typeof txt is textbox then
if txt.text="fail" then sum=sum+1
end if
next
dami9ja:

@luckyc0, Also need some advice from u. Plz give me ur Yim id so we can tlk beta. Thanks. Myn is dammiedam.

cyprosoft
Re: Post Ur Vb 6.0 Questions Here by dami9ja(m): 3:53pm On Nov 01, 2008
Dont quite undastand d solution you gave. Plz kindly hlp me add sme comments for better clarity. Thanks sir. @LuckyC0
Re: Post Ur Vb 6.0 Questions Here by luckyCO(m): 11:41am On Nov 04, 2008
Please say exaclty what you want me to comment for.
Or later,
Send the uncompleted program for on my mail I will complete it for you and send it back to you with comments.

Thanks
Re: Post Ur Vb 6.0 Questions Here by moore20: 6:45pm On Nov 06, 2008
thanks lucky
i really appreciate your assistance in VB 6 so far
but i would be glad if u can still teach me c++ probably with an e-book to study
guess you are good at it too,
i'll be xpecting your respose
thanks and continue the good work

god bless u.
Re: Post Ur Vb 6.0 Questions Here by dami9ja(m): 7:35pm On Nov 06, 2008
0h! I finally got it after some reading,u know am stil a beginner! Thanks 1ce again sir.
Re: Post Ur Vb 6.0 Questions Here by luckyCO(m): 7:54pm On Nov 06, 2008
moore20:

thanks lucky
i really appreciate your assistance in VB 6 so far
but i would be glad if u can still teach me c++ probably with an e-book to study
guess you are good at it too,
i'll be xpecting your respose
thanks and continue the good work

god bless u.


Sorry I dont know C++ much.
Am a microsoft person,if you have problem in vb.net or C# i can equally help but not c++
Thanks
Re: Post Ur Vb 6.0 Questions Here by RuuDie(m): 12:19pm On Nov 09, 2008
@ all who can help,

with respect 2 dynasty's problem of "filtering & selecting unique records randomly."
how can the values of the arrays be stored into a new word or excel sheet & saved with a specified name.
Re: Post Ur Vb 6.0 Questions Here by luckyCO(m): 9:32am On Nov 10, 2008
I will write the program and sent it to.
Am not working with my system so cant do that.
Please check back.
Thanks
Re: Post Ur Vb 6.0 Questions Here by luckyCO(m): 5:53pm On Nov 10, 2008
'Open a project on its from clear and paste the code below. Thanks

Dim g(100) As String
Dim SQL As String
Private Sub Form_Load()
Dim J As Integer
For J = 0 To 99
g(J) = J + 1 & " good work"
SQL = SQL & J + 1 & " good work" & vbCrLf

Next

Print2Excel

End Sub
Public Sub Print2Excel()

On Error GoTo errh
Dim D As Object, K As Long, J As Long
Set D = CreateObject("Excel.Application"wink
D.Visible = True
D.Workbooks.Add
Dim II As Long
Dim i9 As Long


D.Worksheets.Add

Dim M As Long


For K = 0 To 99

D.Worksheets(1).Cells(K + 1, 1) = g(K)
Next K


D.Worksheets(1).Columns.Font.Size = 8
D.Worksheets(1).Rows(1).Font.Bold = True
D.Worksheets(1).Rows.AutoFit
D.Worksheets(1).Columns.AutoFit
Exit Sub
errh:

End Sub
Re: Post Ur Vb 6.0 Questions Here by faoni572(m): 11:45am On Nov 11, 2008
Pls how can I make MSHFlexgrid to adjust automatically to the longest length of the text that enter it. The data may come from database and I want a way the grids will stretch automatically when I dispaly it instead of adjusting the columns manually to read the text.
Re: Post Ur Vb 6.0 Questions Here by zedon: 5:44am On Nov 12, 2008
does anyone know how to block my computer from asking for my dads administrator password any time i wnt to download on the computer
Re: Post Ur Vb 6.0 Questions Here by moore20: 7:08pm On Nov 13, 2008
hi lucky
how are u?
you said you could help me write a program connecting 2 combo boxes to display states and their local governments
i would really appreciate it if u send the program my e-mail id:moore501@yahoo.com

thumbs up mann,

thanks
Re: Post Ur Vb 6.0 Questions Here by luckyCO(m): 10:27am On Nov 18, 2008
moore20:

hi lucky
how are u?
you said you could help me write a program connecting 2 combo boxes to display states and their local governments
i would really appreciate it if u send the program my e-mail id:moore501@yahoo.com

thumbs up mann,

thanks

I will attend to you by God Grace.
I have taken note of your program, I will write it and send to you.

faoni572:

please how can I make MSHFlexgrid to adjust automatically to the longest length of the text that enter it. The data may come from database and I want a way the grids will stretch automatically when I dispaly it instead of adjusting the columns manually to read the text.
I dont think I have done something like dat using flexgrid. I used to do that in dotnet. But will look at it and possibly write a program thatwill do that
Re: Post Ur Vb 6.0 Questions Here by faoni572(m): 10:46am On Dec 03, 2008
@ luckyCO, I saw the code to make flexigrid adjust automatically according to the text that enter it, I saw it on the net, I am not the one that write it but it works very fine for me without any error. I copied the code below for you to see it.

Thanks a lot.



'xxxxxxFlexigrid Adjust to the lenght of Data xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
MSHFlexGrid1.AllowUserResizing = flexResizeBoth

Dim r As Integer
Dim c As Integer
Dim max_len As Single
Dim new_len As Single
Font.Name = MSHFlexGrid1.Font.Name
Font.Size = MSHFlexGrid1.Font.Size
For c = 0 To MSHFlexGrid1.Cols - 1
    max_len = 0
    For r = 0 To MSHFlexGrid1.Rows - 1
        new_len = TextWidth(MSHFlexGrid1.TextMatrix(r, c))
        If max_len < new_len Then max_len = new_len
     Next r
     MSHFlexGrid1.ColWidth(c) = max_len + 240
     MSHFlexGrid1.ColAlignment(c) = flexAlignLeftCenter
Next c

'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Re: Post Ur Vb 6.0 Questions Here by luckyCO(m): 8:57pm On Dec 03, 2008
Thanks a lot
Re: Post Ur Vb 6.0 Questions Here by smallboy2(m): 1:11pm On Dec 25, 2008
For Undergraduates who need programing projects we have great programers who will help you. You can also reward luckyCO for his good work here.
Re: Post Ur Vb 6.0 Questions Here by H2O2: 4:32am On Dec 31, 2008
i miss coding
Re: Post Ur Vb 6.0 Questions Here by Nobody: 9:44pm On Jan 06, 2009
@lucky, great job u are doing here - u have really challenged me - my vb 6.0 is rusty - and vb 6.0 was the first lang i learnt to speak 10 years ago! I am going to start another thread on vb 6.0 something related to web design - and i will love you to fall in once in a while - it is obvious that you are far better than me in vb 6.0 programming - no be beans talk - and i alwayz like to give respect to ppl better than me!

I specialize in an area of vb that is directly related to web development, but my core vb is not quite as sharp as yours from what i can see in your posts.

Great Job helping your students - i like that part too.
Re: Post Ur Vb 6.0 Questions Here by Lisa11: 1:00pm On Jan 09, 2009
Before reading your article I don't have any idea about this . Thank's for giving me knowledge about a new thing.

Lisa11

Online Dating
Re: Post Ur Vb 6.0 Questions Here by StanIyke(m): 4:22pm On Jan 10, 2009
in vb, when ur access database gets full, how do u connect d new one u create to d old that gets fiiled up, besides, if u want to generate pins, dat u av stored already, wat will be d codes. for example, if u want to give out pins to different users. plz, gimme ur numbs so i can kal u.
Re: Post Ur Vb 6.0 Questions Here by luckyCO(m): 3:56pm On Jan 12, 2009
Stan Iyke:

in vb, when ur access database gets full, how do u connect d new one u create to d old that gets fiiled up, besides, if u want to generate pins, that u av stored already, what will be d codes. for example, if u want to give out pins to different users. plz, gimme ur numbs so i can kal u.
Well you can create an interface where user can create database and another interface where they can switch from one database to another.

I don understand your second question about PIN and Code.
08036025235
Cy
Re: Post Ur Vb 6.0 Questions Here by StanIyke(m): 7:54am On Jan 20, 2009
Tanx bro. Plz how do i create d interface to switch rm one datbase 2 anoda or an interfaze 2 create an intafaze. Plz i aw8 ur rply. God bles. As 4 d pin, iv sortd it out wt i usd ws randomize timer, 2 generate d pins witout repitetion. But it generates pin one afta d oda. Plz, if i want say 200 pins 2 b generatd at once, how do i go abt it. Aw8 ur rply. Shalom!
Re: Post Ur Vb 6.0 Questions Here by twumie(m): 12:35pm On Jan 20, 2009
How can you add a database to your program on VB 6
Re: Post Ur Vb 6.0 Questions Here by StanIyke(m): 10:38pm On Jan 20, 2009
Dependin on d type of dbase, u wnt 2 use. Access or mysql. 4 access, g2 ms acess n create d name nd d table name. Use adodc 2 link it.
Re: Post Ur Vb 6.0 Questions Here by StanIyke(m): 10:50pm On Jan 20, 2009
Plz lucky ow do i create an interface 4 users 2 create database. Plz im usin access, cuz i jst strtd mysql. I aw8 ur rply. Nyt nyt.
Re: Post Ur Vb 6.0 Questions Here by luckyCO(m): 12:53pm On Jan 23, 2009
Stan Iyke:

Tanx bro. Plz how do i create d interface to switch rm one datbase 2 anoda or an interfaze 2 create an intafaze. Plz i aw8 ur rply. God bles. As 4 d pin, iv sortd it out wt i usd ws randomize timer, 2 generate d pins witout repitetion. But it generates pin one afta d oda. Plz, if i want say 200 pins 2 b generatd at once, how do i go abt it. Aw8 ur rply. Shalom!

How to create an interface to switch from one database to the has to go this way
1. Your database information must be out, meaning that you get your database information from a registry or text file (Text file recommended)

2. Create a vb form and code into it to be able to retrieve all the existing database and allow you to have another text file.

cbodbname.clear 'a combox where you fill all ur existing db name.
cbodbstatus.clear 'a combox where you fill all ur existing database status will be filled whether active or not. At most one database will be active.

dim dbnamedb as string
dim activedb as string

Open App.Path & "\databasename.txt" For Input As #1

do while not eof(1)
Input #1, dbnamedb,activedb

cbodbname.additem(dbnamedb )
cbodbstatus.additem(activedb)
loop
close

Cause the user to select the database he/she want after which he clicks at a command button
embed the code blow ur command button sub procedure
Open App.Path & "\databasename.txt" For Output As #1

dim J as integer
dim dbn as string
dim dbS as string

for J=0 to cbodbname.listcount-1
dbn=cbodbname.list(j)
if j=cbodbname.listindex then
dbS ="1"
else
dbS ="0"
end if

Write #1, dbn,dbs
next j
close


3. Create another form to allow you create your database and save a copy of that database name in your text file.
Look for code to create access database.

Open App.Path & "\databasename.txt" For Output As #1
Write #1, txtdbname.text,"0"
close


4. cause your program to go an read the active database from your text file.
public Databasename as string

Open App.Path & "\databasename.txt" For Input As #1

do while not eof(1)

Input #1, dbnamedb,activedb
Databasename =dbnamedb ' incase if no database is active

if trim(activedb)="1" then
Databasename =dbnamedb
exit do
close
end if
loop
close

If you didnt understabd the code and what u want to do with this code is very important to yuo, i can mapp out time design only this area and post it here.
Take care and remain blessed
Re: Post Ur Vb 6.0 Questions Here by luckyCO(m): 1:00pm On Jan 23, 2009
[/quote][quote author=twumie link=topic=60292.msg3364694#msg3364694 date=1232451314]
How can you add a database to your program on VB 6

You can do by having a little know abt a particular database say Access,mysql etc
You should be able to know hw to create table in any then you now learn how use SQL statment to access data from your database.
We have so many ANSII SQL which is available for almost all databasein the world although Oracle is trying to create its SQL but it still allows some ASNII.

so when u know that you are in biz with vb6.0

we ve some commands like
Select
Delete
update
Truncate
Create
Drop
etc
So learn the esp
Select,update,Delete and when to use them

If u ve no idea about this let me know i will send something to u that will help u out.

(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. 52
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.