Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,202,265 members, 7,981,486 topics. Date: Monday, 21 October 2024 at 06:20 PM |
Nairaland Forum / Science/Technology / Programming / Post Ur Vb 6.0 Questions Here (40953 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): 1:37pm On Jan 23, 2009 |
for access database only for you to create data you have to use ms access to create database or use visual database available in vb's addin menu. if you want to that to be automatic then you have create a sample database without table in it and write a program to copy it to any destination you want and you can start to access. you can paste this code at the topmost part of your code form Public Declare Function CopyFile Lib "kernel32" Alias "CopyFileA" (ByVal lpExistingFileName As String, ByVal lpNewFileName As String, ByVal bFailIfExists As Long) As Long then you can call it like below copyfile ("C:\h.mdb",app.path & "\good.mdb",true) call the sub program to create tables Private Sub Command1_Click() Dim SQLtxt a string Dim dbn as string SQLtxt = "CREATE TABLE test (ID COUNTER PRIMARY KEY,Mobile Memo,Message Memo,ReportCode memo) " ' As programer you can loop the table creation into any number of time with different parameters. if CreateTable("students",SQLtxt)=true then Msgbox "database table was created successfully" else Msgbox "Table creation failed" end if End Sub Public function CreateTable(dbname As String, txtSQL As String) as boolean dim dbConntectionString as string dbConntectionString ="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & app.path & "\" & trim(dbname) & ".mdb;Persist Security Info=False" on error goto errh Dim CNN As New ADODB.Connection CNN.Open dbConntectionString CNN.Execute txtSQL , iAffected, adExecuteNoRecords CNN.Close CreateTable=true exit function errh:CreateTable=false End Sub If it is not clear let me know Or given me sample project to illustrate and plz be elaborate in what u want. bye |
Re: Post Ur Vb 6.0 Questions Here by Nobody: 2:08pm On Jan 23, 2009 |
I kinda suspect what the guy was asking for was how to do all those connection with jet enginexxx to an access database. Such that you can now control the access database using the ado or adoc control with data-binding to objects, \ At least that method does not take so many codes and is easy to use and you can still perform basic operations like move forward, back and even search with no serious coding. @lucky - u are the teacher - i was just passing by - and keep up the good job |
Re: Post Ur Vb 6.0 Questions Here by luckyCO(m): 5:44pm On Jan 24, 2009 |
dhtml: For beginners, using Last ,back,Forward and first record set method can be managed. But to the person's instrest the way I code it will enable you to have power and managerial control over the performance of ur program. For me I do write code that connects to database and return a recordset for me. Again I write function that can retrieve one item for me from a particular table, another code that will check whether a particular item is extisting such dat I will not insert it again. When the time comes I will call the functions for use. Am waiting for him to tell me what he want s them I will reply back. Thanks |
Re: Post Ur Vb 6.0 Questions Here by debeginin(m): 1:25pm On Feb 03, 2009 |
Please house Ineed you guys to tell me the IDE I can use for VB6.0 and let me into a very good VB textbook for a beginner.Thanks. |
Re: Post Ur Vb 6.0 Questions Here by faoni572(m): 4:25pm On Feb 03, 2009 |
hook2web: Are we discussing pay pal here? Pls for God's sake this thread is for Visual Basic 6.0 programming. You can go to bussiness section or advert section to advertise ur products. |
Re: Post Ur Vb 6.0 Questions Here by kossy(m): 10:41am On Feb 04, 2009 |
hi, luckyco and co. pls i need to use the shell command. Can you help me with that? and how do i print a database. I used access as the database. Which web site is the best to get online help on vb6.0 |
Re: Post Ur Vb 6.0 Questions Here by luckyCO(m): 10:32pm On Feb 04, 2009 |
kossy: You may not be able to print database rather information Table(s) within the database. You either use Crystal,active and datareport to display the data from table(s) then printing will be easy. You can go to www.4shared.com and type any type book u like otherwise google it out. debeginin:Use vb6.0 IDE service park 6. Go to market and buy then download service park 6 from microsoft site. thanks |
Re: Post Ur Vb 6.0 Questions Here by textmypage(m): 11:47am On Feb 13, 2009 |
where can i download a java file editor?i need a software or application that i can use 2 edit opera mini 4 free browsing.anyone wit idea shud email it to textmypage@yahoo.com TY |
Re: Post Ur Vb 6.0 Questions Here by luckyCO(m): 10:36am On Feb 14, 2009 |
Hope there is no much questions from you on Vb 6.0. For those who want migrate from vb.6.0 to vb.net 2005 I have created another thread similar to this one, so feel free to post your questions. Thanks and may God bless. |
Re: Post Ur Vb 6.0 Questions Here by francisman: 7:39pm On Feb 15, 2009 |
Guys, check out this site, you'd find it useful : www.nairabooks.com for all your orders for new and used books, magazines, journals in all areas. |
Re: Post Ur Vb 6.0 Questions Here by luckyCO(m): 8:41am On Feb 16, 2009 |
No more questions? |
Re: Post Ur Vb 6.0 Questions Here by RuuDie(m): 12:33pm On Feb 17, 2009 |
Hi, can anybody help out with VB6 codes that can pull data saved in MS-Access tables and into a MS-Excel or MS-Word document |
Re: Post Ur Vb 6.0 Questions Here by coolgenius: 12:35am On Feb 18, 2009 |
luckyCO Where do you find the time to do this. I'm a programmer too and have a clue into your world. Are you employed? |
Re: Post Ur Vb 6.0 Questions Here by luckyCO(m): 11:35am On Feb 18, 2009 |
RuuDie: I will send you the code later, although I have sent somewhere on this thread. To do that is very simple, I may give you crew incase you can do it alone Export to excel dim obj as object set obj=createobject("Excel.Application" . . . . Alternatively you can reference the object by using reference menu. That one is more user freindly. I will give you the entire code later. coolgenius: Well am self employed. I do this on my relaxation time. Am not doing to attract applause but to help the much I can. Thanks |
Re: Post Ur Vb 6.0 Questions Here by kossy(m): 1:01pm On Feb 18, 2009 |
Hi, luckyco,pls i have similar question on excel. How do i fill the rows and columns with data, or preferably if i am using ms word. How do i pop it (the file) out at run time. Thanks man for the site you gave me as reply to my previous question. it helped a lot |
Re: Post Ur Vb 6.0 Questions Here by kossy(m): 1:14pm On Feb 18, 2009 |
Oops, my bad! I have seen the code for excel on page 6 |
Re: Post Ur Vb 6.0 Questions Here by luckyCO(m): 10:57am On Feb 19, 2009 |
I dont Have time re-write the code giving you exactly what you demanded for. In any case To export the MS Access , I filled it on the MSH grid before exporting it to excel. Call the function below as follw Control neeed; Command button and MSHFlexgrid Private Sub Command1_Click() Dim ConS as string,SQL as string SQL="Select * from mytable" cons="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.path & "\<database>.mdb;Persist Security Info=False ' fill the grid FillInMSH MSHFlexGrid1,ConS ,SQL 'export to excel PrintMsh SHFlexGrid1 End Sub Public Function FillInMSH(MSH1 As MSHFlexGrid, ConectionString As String, SQLstr As String, Optional txtHoldNum As String, Optional SumIt As Boolean, Optional DontDo As Integer, Optional DontDo1 As Integer, Optional FormatWithSense As Boolean, Optional GenSerialOnFirstRow As Boolean, Optional RowPosition As Integer, Optional SummaryXter As String, Optional ColOnly As Integer) On Error GoTo errh Dim StoreVA(122) As Single, LP As Integer, HP1 As String Dim j As Long, I As Integer, db As New ADODB.Recordset Dim rs As New ADODB.Connection rs.ConnectionString = ConectionString rs.Open Set db = rs.Execute(SQLstr) MSH1.Refresh Cancel_Grid_Fill = False 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) = "" If IsNull(db.Fields(I).Value) = False Then If Val(txtHoldNum) > 10 And SumIt = True And db.Fields(I).Type < 120 Then If ColOnly = 0 Then StoreVA(I) = Val(db.Fields(I).Value) + StoreVA(I) ElseIf ColOnly = I Then StoreVA(I) = Val(db.Fields(I).Value) + StoreVA(I) End If If I <> DontDo And I <> DontDo1 And FormatWithSense = True Then MSH1.TextMatrix(j, I) = " " & Format(db.Fields(I).Value, "0,000.00" Else MSH1.TextMatrix(j, I) = " " & db.Fields(I).Value End If ElseIf db.Fields(I).Type < 120 And (I = DontDo Or I = DontDo1) Then HP1 = db.Fields(I).Value If FormatWithSense = True Then If Val(HP1) - Int(Val(HP1)) = 0 Then HP1 = Format(HP1, "0,0" Else HP1 = Format(HP1, "0,0.00" End If End If MSH1.TextMatrix(j, I) = " " & HP1 Else MSH1.TextMatrix(j, I) = " " & db.Fields(I).Value End If End If If GenSerialOnFirstRow = True And I = RowPosition Then MSH1.TextMatrix(j, I) = j End If Next I db.MoveNext CounterProgress = j DoEvents If Cancel_Grid_Fill = True Then If MsgBox("Are you sure you want to cancel this process", vbQuestion + vbYesNo, "Choose either yes or no" = vbNo Then: Cancel_Grid_Fill = False: Exit Function Exit Function End If 'If CancelNexted = True Then CancelNexted = False: Exit Function Loop db.Close rs.Close If Val(txtHoldNum) > 10 Then MSH1.Rows = MSH1.Rows + 1 MSH1.Rows = MSH1.Rows + 1 For I = 0 To MSH1.Cols - 1 If DontDo = I And I <> DontDo1 Then MSH1.TextMatrix(MSH1.Rows - 1, I) = StoreVA(I) Else If FormatWithSense = True Then MSH1.TextMatrix(MSH1.Rows - 1, I) = IIf(StoreVA(I) <> 0, Format(StoreVA(I), "0,000.00", "" Else MSH1.TextMatrix(MSH1.Rows - 1, I) = " " & IIf(StoreVA(I) <> 0, Format(StoreVA(I), "0,0", "" End If End If Next I If SummaryXter = "" Then MSH1.TextMatrix(MSH1.Rows - 1, 1) = "Summary:" Else MSH1.TextMatrix(MSH1.Rows - 1, 1) = SummaryXter End If End If Exit Function errh: End Function Public Sub PrintMsh(Mhs As Control, Optional KIM As Integer) If Global_Can_Change_Setting = False Then MsgBox "You don't have right to export your report to excel", vbCritical, "Right violated" Exit Sub End If If MsgBox("Are you sure you want to export the data to excel", vbQuestion + vbYesNo, "Choose either yes or no" = vbNo Then Exit Sub 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 Dim i8 As Integer i8 = CInt(Mhs.Rows / 65536) - 3 For K = 1 To i8 D.Worksheets.Add Next K i8 = 1 i9 = 65536 II = 1 Dim M As Long M = 1 Dim DF0 As Integer If KIM <> 0 Then DF0 = KIM + 1 If KIM = 0 Then DF0 = KIM + 1 For K = 0 To Mhs.Rows - 1 If K = i9 Then II = II + 1: i9 = i9 + 65536: M = 1 If II = i8 Then i8 = i8 + 1: D.Worksheets(II).Columns.Font.Size = 8 D.Worksheets(II).Rows(1).Font.Bold = True D.Worksheets(II).Rows.AutoFit D.Worksheets(II).Columns.AutoFit End If For j = 1 To Mhs.Cols - DF0 D.Worksheets(II).Cells(M, j + 1) = Trim(Mhs.TextMatrix(K, j)) Next j D.Worksheets(II).Cells(M, 1) = M - 1 M = M + 1 Next K D.Worksheets(II).Cells(1, 1) = "S/N" D.Worksheets(II).Columns.Font.Size = 8 D.Worksheets(II).Rows(1).Font.Bold = True D.Worksheets(II).Rows.AutoFit D.Worksheets(II).Columns.AutoFit Exit Sub errh: End Sub |
Re: Post Ur Vb 6.0 Questions Here by luckyCO(m): 1:46pm On Feb 20, 2009 |
Hope there is no more questions? In case I ve not answered your questions, you may repost it. Thanks |
Re: Post Ur Vb 6.0 Questions Here by kheme(m): 4:02pm On Feb 21, 2009 |
hi. i'm trying to write a sudoku puzzle generator with vb.net but my algorithm seems correct, but runs out of numbers at some stages while generating the puzzle. can anyone look into ma code and see why? Public Class home i've attached screen shots, the "0" in the puzzle are the places where the algorithm runs out of numbers to put cos the next number to put cannot be placed there due to the rules of sudoku. i need help guys!
|
Re: Post Ur Vb 6.0 Questions Here by kossy(m): 8:16pm On Feb 22, 2009 |
Hi LuckyCo, I am afraid there is still much to ask. These lines has solved half of my problem 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 It opens a file for me in excel but nothing was written into it. The code u gave was too complex for now. 1. I am using ADO datalink object and not ADOBD but database creation is not the problem for now Assuming, i have this as the database name destination distance tunde london 6000 Kayode Paris 3453 LuckyCo Lagos 23 Please, write the (simple code) that will put all these in the excel file that was opened. If possible u might not even make use of the database. I would tr that out myself Thanks. |
Re: Post Ur Vb 6.0 Questions Here by kossy(m): 8:21pm On Feb 22, 2009 |
kheme , I am afraid, u might need to try this out in vb6.0. Maybe then some of use might have time to look into it. Or preferably, u take it to the vb.net forum. Response will be faster there than here. |
Re: Post Ur Vb 6.0 Questions Here by kossy(m): 10:06pm On Feb 22, 2009 |
I have been able to finish tge program thanks to u. the only problem i am facing now is how to arrange the output properly. I need to know how to use the font, bold etc at the programming level. Note: the output file is attached
|
Re: Post Ur Vb 6.0 Questions Here by segun12: 10:22am On Feb 23, 2009 |
well sorry people in the house iam here to introduce a property 4 sale in ABUJA. A DUPLEX 5BEDROOM 2SITTING ROOM INTERLOCK SURROUNDING, THIS IS GOING FOR 80M.PLS FOR ANY INFORMATION CONTACT ME ON 08033054149 |
Re: Post Ur Vb 6.0 Questions Here by luckyCO(m): 12:05pm On Feb 23, 2009 |
D.Worksheets(II).Columns.Font.Size = 8 D.Worksheets(II).Rows(1).Font.Bold = True D.Worksheets(II).Rows.AutoFit D.Worksheets(II).Columns.AutoFit From my sub program you may try changes the properties above and see what it will give you dat is the way I arranged the font and things like dat. |
Re: Post Ur Vb 6.0 Questions Here by legendprac(m): 5:39pm On Feb 23, 2009 |
pls someone should help me on these topics on assembly language: what is an assembler constructor; file i/o program segmentation and linkage; interpretive routine |
Re: Post Ur Vb 6.0 Questions Here by legendprac(m): 5:41pm On Feb 23, 2009 |
pls someone should help me on these topics on assembly language: what is an assembler constructor; file i/o program segmentation and linkage; interpretive routine |
Re: Post Ur Vb 6.0 Questions Here by legendprac(m): 5:48pm On Feb 23, 2009 |
pls someone should help me on these topics on assembly language: what is an assembler constructor; file i/o program segmentation and linkage; interpretive routine. this is d link to the thread. https://www.nairaland.com/nigeria/topic-238443.0.html#msg3504497 |
Re: Post Ur Vb 6.0 Questions Here by luckyCO(m): 11:44am On Feb 24, 2009 |
I don't have much knowledge in Assembly Language. But still yet you can google it out. |
Re: Post Ur Vb 6.0 Questions Here by moore20: 4:55pm On Feb 25, 2009 |
hi lucky still xpecting ur reply have a splendid day |
Re: Post Ur Vb 6.0 Questions Here by luckyCO(m): 3:50pm On Feb 26, 2009 |
moore20: Plz can u help me ask ur questions again? |
Re: Post Ur Vb 6.0 Questions Here by legendprac(m): 9:07am On Feb 28, 2009 |
pls someone should help me on these topics on assembly language: what is an assembler constructor; file i/o program segmentation and linkage; interpretive routine |
Re: Post Ur Vb 6.0 Questions Here by kossy(m): 3:00pm On Feb 28, 2009 |
Pls i need to know if i can use vb6.0 to write program that can help me sign in into yahoomail for example. If not what programming language is best for that. |
(1) (2) (3) (4) (5) (6) (7) (8) (9) (10) ... (16) (Reply)
Java Programming For Dummies / Artificial Intelligence And Machine Learning Group / 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. 81 |