SQL..... from EXCEL???

miffe

New Member
Joined
May 3, 2006
Messages
15
Is it possible to INSERT from Excel on one PC to Access (.MDB) on another PC?

How could I do this? Do I have to perform some kind of connect/disconnect like on php-mysql but from VBA? Or how can I update information on the DB remotely...

Let's say I have an excel worksheet that gathers info from the DB, and then I have to output some info back to it... like client info, etc... I know how to gather the info initially, I just connect and update fields in excel... then I made a macro to do it automatically... But how can I update the DB remotely.. from Excel?


Thanks -
Miffe
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

miffe

New Member
Joined
May 3, 2006
Messages
15
I'll restate my question in a simpler form:

Is there a way to INSERT values in a .MDB using SQL from EXCEL including cells from a workbook?

Via which method? VBA? Query editor?

Thanks a lot, a quick example would be appreciated,
- Miffe
 

SydneyGeek

MrExcel MVP
Joined
Aug 5, 2003
Messages
12,251
Hi Miffe,

Yes you can do it using ADO. Here is the first working example I put together... http://www.mrexcel.com/board2/viewtopic.php?t=114080

You need to set a reference in the Excel VBE to the Microsoft ActiveX Data Objects 2.x library (or Microsoft ADO 2.x) for this to work.

Performance over a network is quick -- several hundred records a second is typical.

Denis
 

miffe

New Member
Joined
May 3, 2006
Messages
15
thanks

thanks a lot, seems just perfect, didn't know that about the reference to the active x control - this will just do!

have a great day... or night (who knows what time it is in australia :S)
- miffe
 

Forum statistics

Threads
1,137,202
Messages
5,680,145
Members
419,886
Latest member
Pulpboi

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
Top