Skip to content

Instantly share code, notes, and snippets.

View facebookegypt's full-sized avatar
🏠
Working from home

Ahmed Samir facebookegypt

🏠
Working from home
View GitHub Profile
@facebookegypt
facebookegypt / gist:4972114
Last active December 13, 2015 20:48
DataGrid view Add, Delete and Update
'Visual Basic Online Courses
'DataGridView Add, Edit, Delete, Search
'Using the KeyBoard, MS-Access, Sql Server
'By : evry1.net/VBNet
Imports System.Data.SqlClient
Public Class Form1
Public CN As New SqlClient.SqlConnection
Public RD As SqlDataReader
Public DBS As New DataSet
Option Explicit
'API to move windowless form
Private Const HTCAPTION As Long = 2
Private Const WM_NCLBUTTONDOWN As Long = &HA1
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
lParam As Any) As Long
Private Declare Function ReleaseCapture Lib "user32" () As Long
Private Function RandomDoubles(cb As Integer) As Double
Randomize
Dim rgch As Double
rgch = "123456789101112"
rgch = rgch & Round(rgch) & "1211109876543210"
Dim i As Long
For i = 1 To cb
RandomDoubles = RandomDoubles & Mid$(rgch, Int(Rnd() * Len(rgch) + 1), 1)
Next
Private Sub Form_Load()
Me.Icon = LoadPicture(App.Path & "\Phone.Ico")
End Sub
Private Sub Form_Load()
Me.Caption = ("My Personal PhoneBook application using Visual Basic 6.0")
End Sub
Option Explicit
Const vbDarkBlue = &H800000
Private Sub Form_Load()
With Label2
.Caption = "My PhoneBook Application"
.ForeColor = vbDarkBlue
.BackStyle = vbTransparent
.BorderStyle = 0
.FontBold = True
Option Explicit
Const vbDarkBlue = &H800000
Dim X As Single
Private Sub Form_Load()
X = 200
With Me
.DrawMode = vbCopyPen
.DrawStyle = vbDash
Private Sub Timer1_Timer()
LblTime.Caption = "Date : " & Format(Now, "DDD, dd/mmm/yyyy") & vbCrLf
LblTime.Caption = Lbldtim.Caption & "Time : " & Format(Now, "HH:mm:ss AM/PM")
End Sub
Option Explicit
'3 Methods to store photos or (OLE) Ojects into MS-Access 2003 database .
'This would also apply to Oracle, SqlServer or any database engine supports BLOB .
'More Support (http://evry1falls.freevar.com) ... Visit Me .!
'Using ADO2.8
Dim CN As New ADODB.Connection
Dim RS As New ADODB.Recordset
Dim Rs_Stream As New ADODB.Stream
Const conChunkSize = 100
Dim Ctrl, Ctrl1 As Control
Option Explicit
'API to move windowless form
Private Const HTCAPTION As Long = 2
Private Const WM_NCLBUTTONDOWN As Long = &HA1
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
lParam As Any) As Long
Private Declare Function ReleaseCapture Lib "user32" () As Long