Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2009
    Location
    -31.9554,115.85859
    Posts
    282

    @upeters. ODBC Can you explain this to me?

    I'm trying to use a button to send a cmd to the sql database, but the following code seems to be giving me troubles.

    Code:
    -- Get ROOT "D:\"
    FullSystemPath = Shell.GetFolder(SHF_STARTMENU);
    SysRoot = String.Left(FullSystemPath, 3);
    
    -- inData is an input box with a database name which is the sql server
    -- in this case its filled with "IHOFFICEDATA" as the database name.
    BackUp = Input.GetText("inData");
    
    -- This is the command I'm using, nothing happens.
    ODBC.ExecuteSQL("backup database " .. BackUp .. " to disk = '" .. SysRoot .. BackUp ..  ".bak' GO");
    
    --I even tried this too, still nothing.
    ODBC.ExecuteSQL("BACKUP DATABASE IHOFFICEDATA to disk = 'D:\IHOFFICEDATA.bak' GO")
    Any ideas?
    Last edited by boku; 03-28-2009 at 12:20 PM.

  2. #2
    Join Date
    Jun 2008
    Posts
    108
    i think the code is wrong. maybe this works:
    Code:
    result = ODBC.ExecuteSQL("BACKUP TABLE IHOFFICEDATA TO 'D:\IHOFFICEDATA.bak'");
    i think, things like "to disk" an "GO" are incorrect.

  3. #3
    Join Date
    Mar 2009
    Location
    -31.9554,115.85859
    Posts
    282
    @presidente

    You were right about the GO command, cheers, but that was a typo in the post, in the application, it is without the GO command.

    Code:
    BACKUP DATABASE IHOFFICEDATA to disk = 'D:\IHOFFICEDATA.bak'
    But I did notice some other typos that I had in the application.

    I've just gone through the whole code again, and managed to get it to work!
    I've posted the code below for all the see.

    Make sure you have an active ODBC connection before using this or it wont work.

    Code:
    -- Get ROOT "D:\" or "C:\" or wherever Windows is installed.
    FullSystemPath = Shell.GetFolder(SHF_STARTMENU);
    SysRoot = String.Left(FullSystemPath, 3);
    
    -- Database name "IHOFFICEDATA"
    BackUp = Input.GetText("inData");
    
    -- The SQL Command
    ODBC.ExecuteSQL("backup database " .. BackUp .. " to disk = '" .. SysRoot .. BackUp ..  ".bak'");

Similar Threads

  1. ODBC Action Plugin for AutoPlay Media Studio
    By Ulrich in forum AutoPlay Media Studio 7.5 Plugins
    Replies: 29
    Last Post: 09-30-2009, 04:22 PM
  2. ODBC Setup
    By Gerald Burnette in forum Setup Factory 7.0
    Replies: 2
    Last Post: 05-20-2009, 01:38 AM
  3. Create ODBC Connection
    By KevinD in forum Setup Factory 8.0
    Replies: 9
    Last Post: 01-16-2009, 09:59 AM
  4. Pull data from ODBC
    By GalacTek in forum AutoPlay Media Studio 5.0
    Replies: 2
    Last Post: 09-29-2004, 06:23 AM
  5. INFO: ODBC Configuration Runtime Notes
    By Support in forum Setup Factory 6.0 Knowledge Base
    Replies: 0
    Last Post: 10-30-2002, 02:22 PM

Posting Permissions

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