import specific fields only from excel to database

J

jatinashra.cse8

Hello everyone,

I want to import only few fields from the excel into the database. i m
using Microsoft access as the backend and vb as the front end.

So far i have succeeded in opening the excel and load the whole excel
data into the database.

i used the following query to load the whole data into the database
table from access.

rs.Open "Test", cn, adOpenKeyset, adLockOptimistic, adCmdTable

but i want only specific fields from the excel, for which i used

rs.Open "select TestA, TestB, TestC from [vbexl$]", cn, adOpenDynamic,
adLockOptimistic, adCmdTable

where vbexl is the excel object. Also, please let me know whether the
query is right or wrong.

please let me know any other way to import only specific fields
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top