free counters
Diberdayakan oleh Blogger.
Tampilkan postingan dengan label Visual Basic 6. Tampilkan semua postingan
Tampilkan postingan dengan label Visual Basic 6. Tampilkan semua postingan

Jumat, 12 Oktober 2012

Free SQLite connector with VB6, dhSQLite

by Unknown  |  in Visual Basic 6 at  Jumat, Oktober 12, 2012
Found free library to connect VB6 with SQLite, its called dhSQLite.


The functionality of the former "dhSQLite"-Wrapper is now included in our "combined toolset" - but all the Classes from the former dhSQLite.dll are there - and all the method-calls against these classes are compatible, so you will only have to change the VB6-project-reference from dhSQLite to dhRichClient3 (after properly registering the new toolset) - and your Project should behave and work as before.

The Wrapper was developed as a fast alternative to ADO, encapsulating the super-fast SQLite-engine from: www.sqlite.org


Have downloaded all the file and the tutorial. Now i just need to arrange my time to complete porting my Payroll System.


stay tuned...:D ;)

Will be Porting SQL Server to SQLite

by Unknown  |  in Visual Basic 6 at  Jumat, Oktober 12, 2012
I will be porting my VB6 SQL Server to SQLite in a couple day. After that, i will release my Payroll System as free application than.

stay tune... :D ;)

Senin, 08 Oktober 2012

Floor and Ceil in VB6

by Unknown  |  in Visual Basic 6 at  Senin, Oktober 08, 2012
In VB6 there is no built-in for Floor and Ceil function like in C language.
Let me explain for one who don't know what the purpose of Floor and Ceil, Floor is used for getting the lowest Value of number after the number is rounded and Ceil is use for getting the highest value of number after number is rounded.
for example:
  number = 21,45
 Floor(number) = 21
 Ceil(number) = 22

To overcome this, we can make a module for Floor and Ceil.
Here is the code (kudos for Mario Reynoso for the Code):



'>>--------------------------------------------------------------------------------
'Floor and Ceiling function
'Source http://mario-reynoso.blogspot.com/2009/01/ceiling-y-floor-en-vb6.html
'Devuelve el entero más pequeño no menor que X.
'Ejemplo: Ceiling(1.23) = 2, Ceiling(-1.23) = -1
Public Function Ceiling(ByVal x As Double) As Long
Ceiling = -Int(x * (-1))
End Function
'Devuelve el entero más grande no mayor que X.
'Ejemplo: Floor(1.23) = 1, Floor(-1.23) = -2
Public Function Floor(ByVal x As Double) As Long
Floor = (-Int(x) * (-1))
End Function
'
'<<--------------------------------------------------------------------------------

insert the code to the new module and save it.
To use the function, you can call it directly from you form like this:
Floor(variableNameOrControl)
Ceiling(variableNameOrControl)


Sabtu, 06 Oktober 2012

Simple Selected Text Sequence In Vb6

by Unknown  |  in Visual Basic 6 at  Sabtu, Oktober 06, 2012
A couple days before, I need a form in VB6 that can make a simple sequence for accounting code. I remember some work around for like i have seen before in Qt Creator. Trying with some effort and now it's working. I use some const variable to set the sequence number, so if someone want to add another sequence, they just need to set Upper number Array (U_LBLNUMBER) to the total of sequence -1 .


the formatting result will be set according to the selected number sequence of input text.

You can download the application and the source code in here.

Have a  fun. all righty then.. ;)

Rabu, 09 Mei 2012

Mengubah Text di Textbox ke dalam Format Uang secara Real Time

by Unknown  |  in Visual Basic 6 at  Rabu, Mei 09, 2012
Tutorial singkat ini menggunakan VB6.

Untuk mengubah text di textbox ke dalam format uang ternyata sangatlah mudah dilakukan. Hanya perlu beberapa baris kode di procedure KeyPress dan Change.
Ok, mari kita mulai.

1. buat form kosong di project vb.
2. tambahkan component textbox dan beri nama sebagai txtPrice
3. Masuk ke bagian kode, dan buat Procedure  txtPrice_KeyPress dan  txtPrice_Change seperti koding di bawah.



Private Sub txtPrice_Change()
    If (Len(txtPrice.Text) > 0) Then
      txtPrice.Text = FormatNumber(OriginalNum(txtPrice.Text), 0)
   End If
   txtPrice.SelStart = Len(txtPrice.Text)
End Sub



Private Sub txtPrice_KeyPress(KeyAscii As Integer)
   If (txtPrice.Text = "" Or txtPrice.Text = "0") Then
      txtPrice.Text = ""
   End If
   If (KeyAscii >= 48 And KeyAscii <= 57 Or KeyAscii = vbKeyBack Or KeyAscii = vbKeyDelete) And Not (KeyAscii = 13) And Not (KeyAscii = 46) Then


   Else
      KeyAscii = 0
   End If

   If (Len(txtPrice.Text) > 0) Then
      If (InStr(txtPrice.Text, ".") <> 0) Then
         txtPrice.Text = Replace$(txtPrice.Text, ".", "")
      End If
   End If
End Sub




4. Tambahkan fungsi OriginalNum



Public Function OriginalNum(str) As String
   'test dulu
   test = "100"
   testfmt = FormatNumber(test, 2)
   
   temp = str
   If InStr(testfmt, ",") > 0 Then 'format indonesia
      OriginalNum = Replace(temp, ".", "")
   ElseIf InStr(testfmt, ".") > 0 Then 'format english
      OriginalNum = Replace(temp, ",", "")
   End If
End Function



5. Kemudian test.
6. Finish.


Selamat Berkoding Ria....:D.