+ Reply to Thread
Results 1 to 7 of 7

SQL in VBA definition

  1. #1
    Registered User
    Join Date
    05-21-2014
    Posts
    32

    SQL in VBA definition

    Hi,

    I don't know SQL and just started to use SQL in VBA but the codes are totally strange to me. The below codes are basic SQL which are most required to proceed further, so I would be grateful if anybody explain what does the code says?

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: SQL in VBA definition

    The code tried to access a database named dbPath. Once you are connected to server, you are creating a table. You normally do it on the database itself (Directly), but you are now connecting to server from excel and creating a table as if you are on the server.
    Last edited by AB33; 06-24-2016 at 11:59 AM.

  3. #3
    Registered User
    Join Date
    05-21-2014
    Posts
    32

    Re: SQL in VBA definition

    Thanks AB33. Now I understand most part of the coding.

    However I couldn't run the code second time, it shows error in the following codes (Database Already exist error)

    Please Login or Register  to view this content.
    (Table Already exist error)
    Please Login or Register  to view this content.
    Last edited by wincross; 06-24-2016 at 12:21 PM.

  4. #4
    Registered User
    Join Date
    05-21-2014
    Posts
    32

    Re: SQL in VBA definition

    Hi,

    Can anybody help me on the above?

  5. #5
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: SQL in VBA definition

    No data base allows to create another one if it is already exist.
    Each owner of database has its own syntax, so you need to check your database provider.

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

    Re: SQL in VBA definition

    Why are you using SQL like this on the open workbook? You really shouldn't be doing that

  7. #7
    Registered User
    Join Date
    05-21-2014
    Posts
    32

    Re: SQL in VBA definition

    Hi Kyle123,

    I am a moderate VBA programmer, can write any kind VBA automation but nothing know about SQL or Database or Access. Just started to learn those things while no work at office. I don't know how and where to use SQL in VBA. I saw the above codes in a website, started to reading, understanding and executing. Could you please help on how to use SQL in VBA if this is not the proper way to use?. Sending me an URL which tells this would also be helpful.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Variable Last Row Definition
    By NCF in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-29-2013, 04:20 PM
  2. Criteria definition
    By ZueriBoca in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 05-27-2013, 09:45 AM
  3. [SOLVED] Definition of Lrow
    By VKS in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-08-2012, 01:48 AM
  4. Problem in an IF definition
    By Toomay in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-10-2008, 12:56 PM
  5. [SOLVED] f statistic, p value definition
    By Regression analysis terms in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-08-2006, 04:15 PM
  6. $ definition
    By nicolebelle in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-18-2005, 09:50 AM
  7. [SOLVED] End of data definition
    By Surfstiling in forum Excel General
    Replies: 1
    Last Post: 03-24-2005, 09:06 PM
  8. The definition of....
    By Ursula in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-16-2005, 12:14 PM

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