Post your Vb 6.0 Questions Here

Welcome. Please Login, Register, Or Activate! 
type your username and password to login
Date: November 21, 2009, 08:50 PM
430585 members and 297728 Topics
Latest Member: okhuoze
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) (11) (12) (13) Go Down Send this topic Notify of replies
Author Topic: Post your Vb 6.0 Questions Here  (Read 13147 views)
moore20
Re: Post your Vb 6.0 Questions Here
« #160 on: October 14, 2008, 07:20 PM »

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 your help

thanks a million

luckyCO
Re: Post your Vb 6.0 Questions Here
« #161 on: October 15, 2008, 02:47 PM »

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
dami9ja (m)
Re: Post your Vb 6.0 Questions Here
« #162 on: October 24, 2008, 11:40 PM »

@luckyc0, Great wrk u d0in here sir! I need your 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,
dami9ja (m)
Re: Post your Vb 6.0 Questions Here
« #163 on: October 24, 2008, 11:44 PM »

@luckyc0, Also need some advice from u. Plz give me your Yim id so we can tlk beta. Thanks. Myn is dammiedam.
moore20
Re: Post your Vb 6.0 Questions Here
« #164 on: October 27, 2008, 06:36 PM »

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,
luckyCO
Re: Post your Vb 6.0 Questions Here
« #165 on: October 28, 2008, 12:45 PM »

Quote from: moore20 on October 27, 2008, 06:36 PM
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


Quote from: dami9ja on October 24, 2008, 11:44 PM
@luckyc0, Also need some advice from u. Plz give me your Yim id so we can tlk beta. Thanks. Myn is dammiedam.
Quote from: dami9ja on October 24, 2008, 11:40 PM
@luckyc0, Great wrk u d0in here sir! I need your 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 
Quote from: dami9ja on October 24, 2008, 11:44 PM
@luckyc0, Also need some advice from u. Plz give me your Yim id so we can tlk beta. Thanks. Myn is dammiedam.

cyprosoft
dami9ja (m)
Re: Post your Vb 6.0 Questions Here
« #166 on: November 01, 2008, 03:53 PM »

Dont quite undastand d solution you gave. Plz kindly hlp me add sme comments for better clarity. Thanks sir. @LuckyC0
luckyCO
Re: Post your Vb 6.0 Questions Here
« #167 on: November 04, 2008, 11:41 AM »

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
moore20
Re: Post your Vb 6.0 Questions Here
« #168 on: November 06, 2008, 06:45 PM »

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.
dami9ja (m)
Re: Post your Vb 6.0 Questions Here
« #169 on: November 06, 2008, 07:35 PM »

0h! I finally got it after some reading,u know am stil a beginner! Thanks 1ce again sir.
luckyCO
Re: Post your Vb 6.0 Questions Here
« #170 on: November 06, 2008, 07:54 PM »

Quote from: moore20 on November 06, 2008, 06:45 PM
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
RuuDie (m)
Re:
« #171 on: November 09, 2008, 12:19 PM »

@ 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.
luckyCO
Re: Post your Vb 6.0 Questions Here
« #172 on: November 10, 2008, 09:32 AM »

I will write the program and sent it to.
Am not working with my system so cant do that.
Please check back.
Thanks
luckyCO
Re: Post your Vb 6.0 Questions Here
« #173 on: November 10, 2008, 05:53 PM »

'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")
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



faoni572 (m)
Re: Post your Vb 6.0 Questions Here
« #174 on: November 11, 2008, 11:45 AM »

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.
zedon
Re: Post your Vb 6.0 Questions Here
« #175 on: November 12, 2008, 05:44 AM »

does anyone know how to block my computer from asking for my dads administrator password any time i wnt to download on the computer
moore20
Re: Post your Vb 6.0 Questions Here
« #176 on: November 13, 2008, 07:08 PM »

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
luckyCO
Re: Post your Vb 6.0 Questions Here
« #177 on: November 18, 2008, 10:27 AM »


Quote from: moore20 on November 13, 2008, 07:08 PM
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.

Quote from: faoni572 on November 11, 2008, 11:45 AM
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
faoni572 (m)
Re: Post your Vb 6.0 Questions Here
« #178 on: December 03, 2008, 10:46 AM »

@ 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 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxx
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

'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxx
luckyCO
Re: Post your Vb 6.0 Questions Here
« #179 on: December 03, 2008, 08:57 PM »

Thanks a lot
smallboy2
Re: Post your Vb 6.0 Questions Here
« #180 on: December 25, 2008, 01:11 PM »

For Undergraduates who need programing projects we have great programers who will help you. You can also reward luckyCO  for his good work here.
H2O2
Re: Post your Vb 6.0 Questions Here
« #181 on: December 31, 2008, 04:32 AM »

i miss coding
*dhtml (m)
Re: Post your Vb 6.0 Questions Here
« #182 on: January 06, 2009, 09:44 PM »

@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.
Lisa11
Re: Post your Vb 6.0 Questions Here
« #183 on: January 09, 2009, 01:00 PM »

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
Stan Iyke (m)
Re: Post your Vb 6.0 Questions Here
« #184 on: January 10, 2009, 04:22 PM »

in vb, when your 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 your numbs so i can kal u.
luckyCO
Re: Post your Vb 6.0 Questions Here
« #185 on: January 12, 2009, 03:56 PM »

Quote from: Stan Iyke on January 10, 2009, 04:22 PM
in vb, when your 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 your 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
Stan Iyke (m)
Re: Post your Vb 6.0 Questions Here
« #186 on: January 20, 2009, 07:54 AM »

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 your 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 your rply. Shalom!
twumie (m)
Re: Post your Vb 6.0 Questions Here
« #187 on: January 20, 2009, 12:35 PM »

How can you add a database to your  program on VB 6
Stan Iyke (m)
Re: Post your Vb 6.0 Questions Here
« #188 on: January 20, 2009, 10:38 PM »

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.
Stan Iyke (m)
Re: Post your Vb 6.0 Questions Here
« #189 on: January 20, 2009, 10:50 PM »

Plz lucky ow do i create an interface 4 users 2 create database. Plz im usin access, cuz i jst strtd mysql. I aw8 your rply. Nyt nyt.
luckyCO
Re: Post your Vb 6.0 Questions Here
« #190 on: January 23, 2009, 12:53 PM »

Quote from: Stan Iyke on January 20, 2009, 07:54 AM
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 your 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 your 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 your existing db name.
cbodbstatus.clear 'a combox where you fill all your 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 your 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
luckyCO
Re: Post your Vb 6.0 Questions Here
« #191 on: January 23, 2009, 01:00 PM »

Quote
Quote from: twumie on January 20, 2009, 12:35 PM
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.
 Oracle DBA Corner  Tutorials On Game Programming  Java Programming For Dummies  Page 2
Pages: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) (11) (12) (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.