Skip to content

Instantly share code, notes, and snippets.

View facebookegypt's full-sized avatar

Ahmed Samir facebookegypt

View GitHub Profile
Private Sub CmdPrint_Click()
'Managing Crystal Reports 4.6
With CR
.ReportFileName = App.Path & "\Friends.rpt"
.WindowTitle = "Friends list"
.Connect = CN
.Action = 1
End With
End Sub
Option Explicit
'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
Dim PicNm, StrTempPic As String
Dim Isize, nHand As Integer
Dim Chunk() As Byte
Private Sub ReadPic()
'The Binary Method
Set Rs_Stream = Nothing
StrTempPic = App.Path & "/Temp.JPG"
Rs_Stream.Type = adTypeBinary
Rs_Stream.Open
Rs_Stream.Write RS!PhotoBLOB.Value
'Check the size of the ado stream to -
'make sure there is data
If Rs_Stream.Size > 0 Then
Private Sub RetrieveBlob()
'The BLOB Method
StrTempPic = App.Path & "\Temp.jpg"
If Len(Dir(StrTempPic)) > 0 Then
Kill StrTempPic
End If
'Open the temporary file to save the BLOB to
nHand = FreeFile
Open StrTempPic For Binary As #nHand
'Read the binary data into the byte variable array
Private Sub Form_Load()
'Check if the File (Log.txt) Exists.
If FSO.FileExists(IfileP) = False Then
Option1(1).Value = 0
Option1(2).Value = 0
Option1(3).Value = 0
'create (log.txt) .
FSO.CreateTextFile (IfileP)
Else
'if file exists, then check if empty.
Private Sub Label9_Click()
If InStr(1, Rec.Cn_Path, "mdb") = 0 Then
Label6.Caption = ("Status : No DataBase was choosen")
Exit Sub
End If
If CN.State = 1 Then CN.Close
CN.Open ("Provider = Microsoft.Jet.OleDB.4.0 ; Data Source = " & Trim(Rec.Cn_Path))
Label6.Caption = ("Status : Connected using " & Trim$(Rec.MthdNm))
'Write to log
Open IfileP For Output As #FilNo
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 Sub Timer1_Timer()
Label1.Caption = Format(Now, "DDDD, D/MMMM/YYYY")
Label2.Caption = Format(Now, "HH:MM:SS")
End Sub
'Evry1falls FTP Client Source Code
'Connect to FTP Server
With Inet1
.URL = TxtFtp.Text
.UserName = TxtUsrNm.Text
.Password = TxtPW.Text
'Triggers the DisplayData Routine
Status = ("DIR")
.Execute , "DIR"
End With
'Evry1falls : FTP Client Source Code .....
'FTP Client, Create a new directory (folder) on the FTP Server
'You must have the correct rights to create a Folder,
'Check you Host Support
Status = "MKDIR"
Inet1.Execute , "MKDIR " & Trim(NewFldrNm)