Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Option Explicit
- Private Sub cmdSave_Click()
- On Error GoTo cmdSave_Error
- With CommonDialog1
- .CancelError = True
- .Filter = "Image Files (*.gif; *.bmp; *.jpg)| *.gif;*.bmp;*.jpg"
- .ShowOpen
- End With
- AddImageToDB CommonDialog1.FileName, 2, "File added to database"
- Exit Sub
- cmdSave_Error:
- End Sub
- Private Sub cmdView_Click()
- Dim strTempPath As String
- Dim strTempName As String
- Dim strTempFile As String
- Dim blnShow As Boolean
- 'Create a temp file name
- strTempPath = IIf(Right(App.Path, 1) = "\", App.Path, App.Path & "\")
- strTempName = Format(Now, "MMDDYYHHNNSS") & ".bmp"
- strTempFile = strTempPath & strTempName
- blnShow = ViewFromDB(2, strTempFile)
- If blnShow Then
- Picture1.Picture = LoadPicture(strTempFile)
- DoEvents
- Kill (strTempFile)
- End If
- End Sub
- Private Sub Form_Load()
- 'Set the connectionstring to your database
- strConnString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=bscit;Data Source=PC-1\SQLEXPRESS"
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement