External date (1 Viewer)

radek225

Registered User.
Local time
Today, 00:10
Joined
Apr 4, 2013
Messages
307
I'm using dao.recordset (know sql) to work with my internal data, because in the past someone in this forum show me how to work with sample.

So now I need to import from xls some date to my database in Ms Access. But Ado.recordset is unknown for me (I was traying to understand it:/). So I made simple sample. Could someone show me on this sample how to import the date using ado.recordset?

Please guys help!

import from
zr.xls - C:\PlikiWejscia\zr.slx

to

c:\Wycena\Wycena.accdb

n17 : o18 to tblWycena
g12:j16 to tblSzczegoly


Please see attachments

The code should works from MS Access
 

Attachments

  • zr.zip
    6.1 KB · Views: 50
  • wyceny.zip
    25.9 KB · Views: 38
Last edited:

Ranman256

Well-known member
Local time
Today, 03:10
Joined
Apr 9, 2015
Messages
4,337
you do not need ado nor dao recordsets.
If you are using internal data, just use the CurrentDB.
set rst = currentDB.openrecordet("query")

to import excel data, use
docmd.TransferSpreadsheet acImport ,acSpreadsheetTypeExcel12 ,tbl,"c:\myFile.xls",true
or
attache the excel wb as a table, then run an append query.
 

radek225

Registered User.
Local time
Today, 00:10
Joined
Apr 4, 2013
Messages
307
you do not need ado nor dao recordsets.
If you are using internal data, just use the CurrentDB.
set rst = currentDB.openrecordet("query")

to import excel data, use
docmd.TransferSpreadsheet acImport ,acSpreadsheetTypeExcel12 ,tbl,"c:\myFile.xls",true
or
attache the excel wb as a table, then run an append query.

I can't because I need opportunity to choose information from ms excel (range) and then paste these information to specific tables in ms access. Please see my sample
 

Users who are viewing this thread

Top Bottom