Recent content by nhtuan

  1. N

    VBA code to upload files to SQL Server table BLOB field

    To be more practical, I'd like to convert SQL OLE Object of linked table to an attachment field of MS access table? I guess there should be a way to do this.
  2. N

    VBA code to upload files to SQL Server table BLOB field

    I want to see/display and navigate the OLE Object from linked table on my access form, which behaves like attachment field in ms access form with Record Source is the linked table with OLE Object field.
  3. N

    VBA code to upload files to SQL Server table BLOB field

    Thank for you reply, my issue is how to load these files as multiple attachments from SQL varbinary(max) back into MS Access form, I really want to synchronize my MS Access table with attachments field? Concrete VBA code with comments is highly appreciated.
  4. N

    VBA code to upload files to SQL Server table BLOB field

    ' https://stackoverflow.com/questions/302258/import-a-files-like-pdf-mp3-doc-xls-into-a-ms-sql-server-datatable-field Private Sub Command0_Click() Dim rs As ADODB.Recordset Set rs = New ADODB.Recordset rs.Open "select * from dbo_TblFiles where [dbo_TblFiles].[ID]=7", CurrentProject.Connection...
  5. N

    The VBA code that check size of file in bytes !

    Thank you for sharing.
  6. N

    The VBA code that check size of file in bytes !

    Private Sub Command0_Click() 'This will return the size of your file in a MsgBox prompt MsgBox "The attachment size is " & Format(FileLen("C:\Users\Documents\Data\myFile.docx") / 1024 / 1024, "0.00 Mb") End Sub
  7. N

    Here is the code that I use to create a shortcut of Access database file in current directory and change the shortcut icon

    You can copy and paste a shortcut anywhere you want in your local machine.
  8. N

    Here is the code that I use to create a shortcut of Access database file in current directory and change the shortcut icon

    Private Sub Command6_Click() Dim ShortcutPath As String Dim FileSname As String FileSname = Left(CurrentProject.Name, InStr(CurrentProject.Name, ".") - 1) ShortcutPath = CurrentProject.Path & "\" & FileSname & " - Shortcut.lnk" With...
  9. N

    To add attachment file to specific record, I use following code but don't know if it is the best way?

    Thanks for your generous comments, the QR code is programmatically created using Google API "https://chart.googleapis.com/chart?chs=250x250&cht=qr&chl=" & [NGAYBATDAU] & " &choe=UTF-8&chma=1,1,1,1&chof=png"
  10. N

    To add attachment file to specific record, I use following code but don't know if it is the best way?

    I use this code to attach a QR code picture to current record, is there any further improvement? Private Sub Command4_Click() Dim CoutriesRset, FilteredRset As Recordset Dim SQL As String SQL = "Select * From tblCountries Where Country = '" & Me.Country & "'" ' can use SQL for recordset to...
  11. N

    Download Image from website

    It works perfectly, many thanks.
  12. N

    VBA code to search address on Google Maps

    Application.FollowHyperlink does not work! Private Sub Command5_Click() Dim strDetailAddress As String Dim strGmaps As String On Error GoTo MyError strDetailAddress = Me.CAddresse & " " & Me.Ccity & " " & Me.CodePostal strGmaps = "http://maps.google.com/maps?h1=en&q=" &...
  13. N

    VBA code to check internet connection in Windows OS 64 bit, VBA MS Access 2019

    @oleronesoftwares the revised code is here, please let me know how your result. Step 1. Create a standard module with following codes (copy and past), name it whatever you like (ex. MyModuleChkInternet). Option Compare Database Option Explicit Public Flg As LongPtr Public Declare PtrSafe...
  14. N

    VBA code to check internet connection in Windows OS 64 bit, VBA MS Access 2019

    Sharing code saves time, each year I love more and more MS Access and its VBA, the environment that has more than 30 years of operations, highly stable and highly available, flexible, comprehensible and highly productive in this connected world. In our days, internet connection solves numerous...
  15. N

    VBA Import Excel to Access Table with VBA

    Thank you Frothingslosh for sharing, As I use MS Access 365, just want to share for someone who may need, it works well. Private Sub cmdGetExcel_Click() If IsNull(Len(Dir("C:\Users\admin\Documents\MyProject\GoogleSheetName.xlsx"))) = False Then DoCmd.TransferSpreadsheet acImport...
Top Bottom