+ Reply to Thread
Results 1 to 5 of 5

Use Excel as Database by opening excel workbook as ADODB object

  1. #1
    Registered User
    Join Date
    06-20-2013
    Location
    Sydney
    MS-Off Ver
    Excel 2007
    Posts
    2

    Use Excel as Database by opening excel workbook as ADODB object

    Hi,

    I have seen very limited help online on this because most people are trying to use other sources as either front end or back end, such as Access, SQL server or .NET etc. But in this case my database sits in a in-house analysis application in Excel, I have no support in any corporate database nor do I have Access application in my standard XP installation. So I need to use Excel as a database to store data.

    I have created a connection that queries tables fine, so that part worked well. Here's the code


    Please Login or Register  to view this content.
    This part was working fine.

    However the problem is I need it to have other basic function of a datbase, such as adding, editing and deleting tables.

    But here's where the probelm lies, it doesn't work no matter what form of SQL or code combinations I tried. It always gives me an run time error '-2147217887' (8004e21) <- some random long strings that are different every single time.


    The code is as below:

    v1:


    Please Login or Register  to view this content.

    This one didnt work.

    v2:

    Please Login or Register  to view this content.
    This one didnt work either.

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Use Excel as Database by opening excel workbook as ADODB object

    you should be able to use INSERT INTO queries to append data or SELECT INTO to create new sheets http://support.microsoft.com/kb/295646
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Use Excel as Database by opening excel workbook as ADODB object

    Can't you install SQL Server Express? It's free

  4. #4
    Registered User
    Join Date
    06-20-2013
    Location
    Sydney
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Use Excel as Database by opening excel workbook as ADODB object

    Quote Originally Posted by JosephP View Post
    you should be able to use INSERT INTO queries to append data or SELECT INTO to create new sheets http://support.microsoft.com/kb/295646
    Hi,

    thanks for your response!

    I tried the post you have given me and it still didn't work...

    Here's the code:

    Please Login or Register  to view this content.

  5. #5
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Use Excel as Database by opening excel workbook as ADODB object

    try it with a closed workbook-you should not use ado on an open one

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1