search data from MySQL database

Tony007

New Member
Joined
Jun 2, 2009
Messages
14
I have an excelfile with 2 columns, ordernumber and articlenumber.
I also have a MySQL database containing the same numbers and many more (like deliverydate, price and more).
I established a connection Excel-MySQL using OLEDB and ODBC-DSN, so i can import the entire MySQL table in Excel. This table is 35.000 rows long and takes ages to download in excel :(, but i only need the 1 row with the ordernumber and articlenumber to look for the price.
After importing the complete MySQL database in Excel, i am able to look for the desired data (like deliverydate or price) using VLOOKUP.
But i don't want to import the whole sql table.
Is it possible to search (using VBA) for the desired data in the sql table, and only import the data i want?

Many thx!
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Why don't you do it the other way round?

For example use the data from Excel as criteria for a query in the MySQL database?
 
Upvote 0

Forum statistics

Threads
1,223,923
Messages
6,175,410
Members
452,640
Latest member
steveridge

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top