HP3000-L Archives

February 2000, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Peter Chong <[log in to unmask]>
Reply To:
Peter Chong <[log in to unmask]>
Date:
Wed, 16 Feb 2000 09:48:16 -0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (83 lines)
Hi, Folks

Kind of Out of Topic, But here is a sample MS Access VBA code for
uploading Excel file to IMAGE/3000 using ODBC/32(High Speed Connection) 
and MS Access(user Inferface).


<<I use the ODBC/32 connection with an MS/Access front end,
actual Access table( input file ) is attached to an Excel file.

1 The Excel file is changed or Modified by user,
an user simply click the Upload button in a Access form.
(VBA code is available)>>

Peter,

Yes, I would like to see the VBA code.

 I've downloaded IMAGE data into Access and written VBA for but never
used VBA with Access.    I'd like to see how it is done with Access.

I've written a VBA script that checks that a user is logged-on to the
HP 3000 via Reflections and is at the colon prompt before running a
host program.


--Private Sub btnUpload_Click()
Dim stDocName As String
Dim db As Database
Dim rs As Recordset
Set db = CurrentDb
Dim strSQL As String

'   Clear an Excel TempFile and ODBC IMAGE Database
   CurrentDb.Execute "DELETE * FROM LLLAP_CM"
   CurrentDb.Execute "DELETE * FROM Temp3815"

'    strSQL = "Delete LLLAP_CM.CHK_NBR,"
'    strSQL = strSQL & "LLLAP_CM.TRAN_TYPE , "
'    strSQL = strSQL & "LLLAP_CM.DATE01 , "
'    strSQL = strSQL & "LLLAP_CM.DATE02 , "
'    strSQL = strSQL & "LLLAP_CM.AMT_01 , "
'    strSQL = strSQL & "LLLAP_CM.VENDOR, "
'    strSQL = strSQL & "LLLAP_CM.FILLER "
'    strSQL = strSQL & "FROM LLLAP_CM;"
'    DoCmd.RunSQL strSQL, dbFailOnError
 
'   Import SomeExcelFile to tmpTableName
    
    DoCmd.TransferSpreadsheet transfertype:=acImport, SpreadsheetType:=5, _
            tablename:="TempFile", FileName:="File3815", _
            Hasfieldnames:=False, Range:="File3815!a5:I5000"
            'This will import the range B1 through B11
            'The Spreadsheet type = 5 specifies an Excel 5.0/7.0 file
            'format

'   Insert a 3K IMAGE Data set from a tmpTableName
    
    strSQL = "INSERT INTO LLLAP_CM "
    strSQL = strSQL & "( TRAN_TYPE, CHK_NBR, AMT_01, VENDOR, DATE01 )"
    strSQL = strSQL & "SELECT "
    strSQL = strSQL & "TempFile.F1,"
    strSQL = strSQL & "TempFile.F2,"
    strSQL = strSQL & "TempFile.F6,"
    strSQL = strSQL & "TempFile.F9,"
    strSQL = strSQL & "TempFile.F4 "
    strSQL = strSQL & "FROM TempFile "
    strSQL = strSQL & "ORDER BY TempFile.F2 DESC;"
      
        
    DoCmd.RunSQL strSQL, dbFailOnError

    'RefreshDatabaseWindow
            
            
End Sub

Peter Chong
Sr. ERP/MRP Analyst.
L3 Communications
714.956.9200 x 363
http://www.powerparagon.com

ATOM RSS1 RSS2