Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Page 2 of 2 FirstFirst 1 2
Results 16 to 30 of 30
  1. #16
    Join Date
    Mar 2009
    Location
    -31.9554,115.85859
    Posts
    282

    Having difficulties! EMERGENCY

    I have successfully managed to connect to the database in question. However when I run the .ExecuteSQL() with the following code, I get an error. Can anyone shed any light? This does work in SQL server, tested 100%.

    Code:
    CREATE DATABASE [ihaccts] ON  PRIMARY 
    ( NAME = N'ihaccts', FILENAME = N'c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\ihaccts.mdf' , SIZE = 3072KB , FILEGROWTH = 1024KB )
     LOG ON 
    ( NAME = N'ihaccts_log', FILENAME = N'c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\ihaccts_log.ldf' , SIZE = 1024KB , FILEGROWTH = 10%)
    GO
    EXEC dbo.sp_dbcmptlevel @dbname=N'ihaccts', @new_cmptlevel=90
    GO
    ALTER DATABASE [ihaccts] SET ANSI_NULL_DEFAULT OFF 
    GO
    ALTER DATABASE [ihaccts] SET ANSI_NULLS OFF 
    GO
    ALTER DATABASE [ihaccts] SET ANSI_PADDING OFF 
    GO
    ALTER DATABASE [ihaccts] SET ANSI_WARNINGS OFF 
    GO
    ALTER DATABASE [ihaccts] SET ARITHABORT OFF 
    GO
    ALTER DATABASE [ihaccts] SET AUTO_CLOSE OFF 
    GO
    ALTER DATABASE [ihaccts] SET AUTO_CREATE_STATISTICS ON 
    GO
    ALTER DATABASE [ihaccts] SET AUTO_SHRINK OFF 
    GO
    ALTER DATABASE [ihaccts] SET AUTO_UPDATE_STATISTICS ON 
    GO
    ALTER DATABASE [ihaccts] SET CURSOR_CLOSE_ON_COMMIT OFF 
    GO
    ALTER DATABASE [ihaccts] SET CURSOR_DEFAULT  GLOBAL 
    GO
    ALTER DATABASE [ihaccts] SET CONCAT_NULL_YIELDS_NULL OFF 
    GO
    ALTER DATABASE [ihaccts] SET NUMERIC_ROUNDABORT OFF 
    GO
    ALTER DATABASE [ihaccts] SET QUOTED_IDENTIFIER OFF 
    GO
    ALTER DATABASE [ihaccts] SET RECURSIVE_TRIGGERS OFF 
    GO
    ALTER DATABASE [ihaccts] SET AUTO_UPDATE_STATISTICS_ASYNC OFF 
    GO
    ALTER DATABASE [ihaccts] SET DATE_CORRELATION_OPTIMIZATION OFF 
    GO
    ALTER DATABASE [ihaccts] SET PARAMETERIZATION SIMPLE 
    GO
    ALTER DATABASE [ihaccts] SET  READ_WRITE 
    GO
    ALTER DATABASE [ihaccts] SET RECOVERY SIMPLE 
    GO
    ALTER DATABASE [ihaccts] SET  MULTI_USER 
    GO
    ALTER DATABASE [ihaccts] SET PAGE_VERIFY CHECKSUM  
    GO
    USE [ihaccts]
    GO
    IF NOT EXISTS (SELECT name FROM sys.filegroups WHERE is_default=1 AND name = N'PRIMARY') ALTER DATABASE [ihaccts] MODIFY FILEGROUP [PRIMARY] DEFAULT
    GO
    
    USE [ihaccts]
    GO
    /****** Object:  Table [dbo].[pl_accounts]    Script Date: 04/01/2009 16:09:41 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    SET ANSI_PADDING ON
    GO
    CREATE TABLE [dbo].[pl_accounts](
    	[SUCODE] [varchar](10) NOT NULL,
    	[SUNAME] [varchar](30) NULL,
    	[SUBALANCE] [float] NULL,
    	[SU_CREDIT_LIMIT] [float] NULL,
    	[SUSORT] [varchar](8) NULL,
    	[SU_TAX_CODE] [smallint] NULL,
    	[SUADDRESS] [varchar](120) NULL,
    	[SU_ADDRESS_USER1] [varchar](60) NULL,
    	[SU_ADDRESS_USER2] [varchar](60) NULL,
    	[SUPOSTCODE] [varchar](20) NULL,
    	[SUCONTACT] [varchar](30) NULL,
    	[SUPHONE] [varchar](20) NULL,
    	[SUFAX] [varchar](20) NULL,
    	[SU_ON_STOP] [smallint] NULL,
    	[SU_DUE_DAYS] [char](1) NULL,
    	[SUCOUNTRY] [varchar](4) NULL,
    	[SUCURRENCYCODE] [varchar](4) NULL,
    	[INTERCOMPANY] [varchar](10) NULL,
     CONSTRAINT [PK_pl_accounts] PRIMARY KEY CLUSTERED 
    (
    	[SUCODE] ASC
    )WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
    ) ON [PRIMARY]
    GO
    SET ANSI_PADDING OFF
    GO
    /****** Object:  Table [dbo].[nl_accounts]    Script Date: 04/01/2009 16:09:35 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    SET ANSI_PADDING ON
    GO
    CREATE TABLE [dbo].[nl_accounts](
    	[NCOPY_ACCCODE] [char](16) NOT NULL,
    	[NCC] [char](4) NULL,
    	[NDEPT] [char](3) NULL,
    	[NNAME] [char](30) NULL
    ) ON [PRIMARY]
    GO
    SET ANSI_PADDING OFF
    GO
    /****** Object:  Table [dbo].[sl_accounts]    Script Date: 04/01/2009 16:09:49 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    SET ANSI_PADDING ON
    GO
    CREATE TABLE [dbo].[sl_accounts](
    	[CUCODE] [varchar](10) NOT NULL,
    	[CUNAME] [varchar](30) NULL,
    	[CUBALANCE] [float] NULL,
    	[CU_CREDIT_LIMIT] [float] NULL,
    	[CUSORT] [varchar](8) NULL,
    	[CU_TAX_CODE] [smallint] NULL,
    	[CUADDRESS] [varchar](120) NULL,
    	[CU_ADDRESS_USER1] [varchar](60) NULL,
    	[CU_ADDRESS_USER2] [varchar](60) NULL,
    	[CUPOSTCODE] [varchar](20) NULL,
    	[CUCONTACT] [varchar](30) NULL,
    	[CUPHONE] [varchar](20) NULL,
    	[CUFAX] [varchar](20) NULL,
    	[CU_EMAIL] [varchar](60) NULL,
    	[CU_ON_STOP] [smallint] NULL,
    	[CU_DUE_DAYS] [char](1) NULL,
    	[CUPHONE2] [varchar](20) NULL,
    	[CU_VAT_REG_NO] [char](10) NULL,
    	[PAYMENT_TERMS] [char](10) NULL,
    	[Intercompany] [varchar](10) NULL,
    	[CUCURRENCYCODE] [varchar](4) NULL,
    	[CUCOUNTRY] [varchar](4) NULL,
     CONSTRAINT [PK_sl_accounts] PRIMARY KEY CLUSTERED 
    (
    	[CUCODE] ASC
    )WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
    ) ON [PRIMARY]
    GO
    SET ANSI_PADDING OFF
    GO
    
    insert into [ihaccts].[dbo].[sl_accounts] (cucode) values('CASH')

  2. #17
    Join Date
    Apr 2005
    Location
    São Paulo, Brazil
    Posts
    2,451
    David,

    you did not show your code here. I know from the PM you sent me that you are trying to use ODBC.ExecuteSQL() to execute not a single statement, but the whole script at once. As I wrote, I am suspecting that this is where your mistake is, because the expected parameter is a single statement, see MSDN reference for ExecuteSQL(). If somebody knows otherwise, please join the discussion.

    In my opinion, you may prefer to use the command line interface of SQL Server to run the script, instead of feeding it command-by-command through the ODBC interface. Normally you would use ODBC to perform queries and updates... Can't you use File.Run("sqlcmd.exe", ...) to run the script?

    Ulrich

  3. #18
    Join Date
    Mar 2009
    Location
    -31.9554,115.85859
    Posts
    282
    For those interested, my whole code is as follows. Please help me, I'm desperate. Ulrich, I'm not sure how use the cmd line function correctly. I've also uploaded the SQL script I was using at work.

    Code:
    BlankPassword = ""
    ServerName = Registry.GetValue(HKEY_LOCAL_MACHINE, "\\SYSTEM\\ControlSet001\\Control\\ComputerName\\ActiveComputerName", "Computername", true);
    
    SQLServerDB = ODBC.OpenDirectConnection("Driver={SQL Server};" .. 
    										"Server=" .. ServerName .. "\\SQLEXPRESS" ..
    										";Database=" .. "master" ..
    										";Uid=sa;Pwd=");
    										
    Dialog.Message("Notice", SQLServerDB, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
    										
    if (SQLServerDB == 0) then
    
    success = ODBC.ExecuteSQL("CREATE DATABASE [ihaccts] ON  PRIMARY  \r\n" ..
    "( NAME = N'ihaccts', FILENAME = N'C:\\Program Files\\Microsoft SQL Server\\MSSQL.1\\MSSQL\\DATA\\ihaccts.mdf' , SIZE = 3072KB , FILEGROWTH = 1024KB ) \r\n" ..
    "LOG ON \r\n" ..
    "( NAME = N'ihaccts_log', FILENAME = N'C:\\Program Files\\Microsoft SQL Server\\MSSQL.1\\MSSQL\\DATA\\ihaccts_log.ldf' , SIZE = 1024KB , FILEGROWTH = 10%) \r\n" ..
    "GO \r\n" ..
    "EXEC dbo.sp_dbcmptlevel @dbname=N'ihaccts', @new_cmptlevel=90 \r\n" ..
    "GO \r\n" ..
    "ALTER DATABASE [ihaccts] SET ANSI_NULL_DEFAULT OFF  \r\n" ..
    "GO \r\n" ..
    "ALTER DATABASE [ihaccts] SET ANSI_NULLS OFF  \r\n" ..
    "GO \r\n" ..
    "ALTER DATABASE [ihaccts] SET ANSI_PADDING OFF  \r\n" ..
    "GO \r\n" ..
    "ALTER DATABASE [ihaccts] SET ANSI_WARNINGS OFF  \r\n" ..
    "GO \r\n" ..
    "ALTER DATABASE [ihaccts] SET ARITHABORT OFF  \r\n" ..
    "GO \r\n" ..
    "ALTER DATABASE [ihaccts] SET AUTO_CLOSE OFF  \r\n" ..
    "GO \r\n" ..
    "ALTER DATABASE [ihaccts] SET AUTO_CREATE_STATISTICS ON  \r\n" ..
    "GO \r\n" ..
    "ALTER DATABASE [ihaccts] SET AUTO_SHRINK OFF  \r\n" ..
    "GO \r\n" ..
    "ALTER DATABASE [ihaccts] SET AUTO_UPDATE_STATISTICS ON  \r\n" ..
    "GO \r\n" ..
    "ALTER DATABASE [ihaccts] SET CURSOR_CLOSE_ON_COMMIT OFF  \r\n" ..
    "GO \r\n" ..
    "ALTER DATABASE [ihaccts] SET CURSOR_DEFAULT  GLOBAL  \r\n" ..
    "GO \r\n" ..
    "ALTER DATABASE [ihaccts] SET CONCAT_NULL_YIELDS_NULL OFF  \r\n" ..
    "GO \r\n" ..
    "ALTER DATABASE [ihaccts] SET NUMERIC_ROUNDABORT OFF  \r\n" ..
    "GO \r\n" ..
    "ALTER DATABASE [ihaccts] SET QUOTED_IDENTIFIER OFF  \r\n" ..
    "GO \r\n" ..
    "ALTER DATABASE [ihaccts] SET RECURSIVE_TRIGGERS OFF  \r\n" ..
    "GO \r\n" ..
    "ALTER DATABASE [ihaccts] SET AUTO_UPDATE_STATISTICS_ASYNC OFF  \r\n" ..
    "GO \r\n" ..
    "ALTER DATABASE [ihaccts] SET DATE_CORRELATION_OPTIMIZATION OFF  \r\n" ..
    "GO \r\n" ..
    "ALTER DATABASE [ihaccts] SET PARAMETERIZATION SIMPLE  \r\n" ..
    "GO \r\n" ..
    "ALTER DATABASE [ihaccts] SET  READ_WRITE  \r\n" ..
    "GO \r\n" ..
    "ALTER DATABASE [ihaccts] SET RECOVERY SIMPLE  \r\n" ..
    "GO \r\n" ..
    "ALTER DATABASE [ihaccts] SET  MULTI_USER  \r\n" ..
    "GO \r\n" ..
    "ALTER DATABASE [ihaccts] SET PAGE_VERIFY CHECKSUM   \r\n" ..
    "GO \r\n" ..
    "USE [ihaccts] \r\n" ..
    "GO \r\n" ..
    "IF NOT EXISTS (SELECT name FROM sys.filegroups WHERE is_default=1 AND name = N'PRIMARY') ALTER DATABASE [ihaccts] MODIFY FILEGROUP [PRIMARY] DEFAULT \r\n" ..
    "GO \r\n" ..
    "USE [ihaccts] \r\n" ..
    "GO \r\n" ..
    "SET ANSI_NULLS ON \r\n" ..
    "GO \r\n" ..
    "SET QUOTED_IDENTIFIER ON \r\n" ..
    "GO \r\n" ..
    "SET ANSI_PADDING ON \r\n" ..
    "GO \r\n" ..
    "CREATE TABLE [dbo].[pl_accounts]( \r\n" ..
    "[SUCODE] [varchar](10) NOT NULL, \r\n" ..
    "[SUNAME] [varchar](30) NULL, \r\n" ..
    "[SUBALANCE] [float] NULL, \r\n" ..
    "[SU_CREDIT_LIMIT] [float] NULL, \r\n" ..
    "[SUSORT] [varchar](8) NULL, \r\n" ..
    "[SU_TAX_CODE] [smallint] NULL, \r\n" ..
    "[SUADDRESS] [varchar](120) NULL, \r\n" ..
    "[SU_ADDRESS_USER1] [varchar](60) NULL, \r\n" ..
    "[SU_ADDRESS_USER2] [varchar](60) NULL, \r\n" ..
    "[SUPOSTCODE] [varchar](20) NULL, \r\n" ..
    "[SUCONTACT] [varchar](30) NULL, \r\n" ..
    "[SUPHONE] [varchar](20) NULL, \r\n" ..
    "[SUFAX] [varchar](20) NULL, \r\n" ..
    "[SU_ON_STOP] [smallint] NULL, \r\n" ..
    "[SU_DUE_DAYS] [char](1) NULL, \r\n" ..
    "[SUCOUNTRY] [varchar](4) NULL, \r\n" ..
    "[SUCURRENCYCODE] [varchar](4) NULL, \r\n" ..
    "[INTERCOMPANY] [varchar](10) NULL, \r\n" ..
    "CONSTRAINT [PK_pl_accounts] PRIMARY KEY CLUSTERED  \r\n" ..
    "( \r\n" ..
    "[SUCODE] ASC \r\n" ..
    ")WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY] \r\n" ..
    ") ON [PRIMARY] \r\n" ..
    "GO \r\n" ..
    "SET ANSI_PADDING OFF \r\n" ..
    "GO \r\n" ..
    "SET ANSI_NULLS ON \r\n" ..
    "GO \r\n" ..
    "SET QUOTED_IDENTIFIER ON \r\n" ..
    "GO \r\n" ..
    "SET ANSI_PADDING ON \r\n" ..
    "GO \r\n" ..
    "CREATE TABLE [dbo].[nl_accounts]( \r\n" ..
    "[NCOPY_ACCCODE] [char](16) NOT NULL, \r\n" ..
    "[NCC] [char](4) NULL, \r\n" ..
    "[NDEPT] [char](3) NULL, \r\n" ..
    "[NNAME] [char](30) NULL \r\n" ..
    ") ON [PRIMARY] \r\n" ..
    "GO \r\n" ..
    "SET ANSI_PADDING OFF \r\n" ..
    "GO \r\n" ..
    "SET ANSI_NULLS ON \r\n" ..
    "GO \r\n" ..
    "SET QUOTED_IDENTIFIER ON \r\n" ..
    "GO \r\n" ..
    "SET ANSI_PADDING ON \r\n" ..
    "GO \r\n" ..
    "CREATE TABLE [dbo].[sl_accounts]( \r\n" ..
    "[CUCODE] [varchar](10) NOT NULL, \r\n" ..
    "[CUNAME] [varchar](30) NULL, \r\n" ..
    "[CUBALANCE] [float] NULL, \r\n" ..
    "[CU_CREDIT_LIMIT] [float] NULL, \r\n" ..
    "[CUSORT] [varchar](8) NULL, \r\n" ..
    "[CU_TAX_CODE] [smallint] NULL, \r\n" ..
    "[CUADDRESS] [varchar](120) NULL, \r\n" ..
    "[CU_ADDRESS_USER1] [varchar](60) NULL, \r\n" ..
    "[CU_ADDRESS_USER2] [varchar](60) NULL, \r\n" ..
    "[CUPOSTCODE] [varchar](20) NULL, \r\n" ..
    "[CUCONTACT] [varchar](30) NULL, \r\n" ..
    "[CUPHONE] [varchar](20) NULL, \r\n" ..
    "[CUFAX] [varchar](20) NULL, \r\n" ..
    "[CU_EMAIL] [varchar](60) NULL, \r\n" ..
    "[CU_ON_STOP] [smallint] NULL, \r\n" ..
    "[CU_DUE_DAYS] [char](1) NULL, \r\n" ..
    "[CUPHONE2] [varchar](20) NULL, \r\n" ..
    "[CU_VAT_REG_NO] [char](10) NULL, \r\n" ..
    "[PAYMENT_TERMS] [char](10) NULL, \r\n" ..
    "[Intercompany] [varchar](10) NULL, \r\n" ..
    "[CUCURRENCYCODE] [varchar](4) NULL, \r\n" ..
    "[CUCOUNTRY] [varchar](4) NULL, \r\n" ..
    " CONSTRAINT [PK_sl_accounts] PRIMARY KEY CLUSTERED  \r\n" ..
    "( \r\n" ..
    "[CUCODE] ASC \r\n" ..
    ")WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY] \r\n" ..
    ") ON [PRIMARY] \r\n" ..
    "GO \r\n" ..
    "SET ANSI_PADDING OFF \r\n" ..
    "GO \r\n" ..
    "insert into [ihaccts].[dbo].[sl_accounts] (cucode) values('CASH')");
    end
    
    Dialog.Message("Notice", success, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
    Attached Files

  4. #19
    Join Date
    Apr 2005
    Location
    São Paulo, Brazil
    Posts
    2,451
    Hello,

    if you perform a search in these forums, you will find mentions to sqlcmd.exe, which might help you. I personally have never used SQL Server, so I am able to help very little here. But the command line syntax does not look too complicated. Looks like you have to run sqlcmd.exe -i filename.sql ...

    Ulrich
    Last edited by Ulrich; 04-11-2009 at 10:58 AM.

  5. #20
    Join Date
    Mar 2009
    Location
    -31.9554,115.85859
    Posts
    282
    Excellent, thank you! worked a treat. Managed to get project finished in time!

  6. #21
    Join Date
    Nov 2003
    Location
    Salzburg / Austria
    Posts
    312
    It would be nice if the 'EXEC' command will work too.

    e.g.
    To get all databases from an installed SQL-server instance
    result = ODBC.OpenQuery('EXEC sp_helpdb');


    p.s. I know, I can use
    result = ODBC.OpenQuery('SELECT * FROM dbo.sysdatabases');
    for this query.

    Stefan
    "With a rubber duck, one's never alone."

    Douglas Adams, The Hitchhiker's Guide to the Galaxy

  7. #22
    Join Date
    Mar 2009
    Location
    -31.9554,115.85859
    Posts
    282
    Quote Originally Posted by Stefan_M View Post
    It would be nice if the 'EXEC' command will work too.

    e.g.
    To get all databases from an installed SQL-server instance
    result = ODBC.OpenQuery('EXEC sp_helpdb');


    p.s. I know, I can use
    result = ODBC.OpenQuery('SELECT * FROM dbo.sysdatabases');
    for this query.

    Stefan
    I totally agree, it would extremely useful to be able to execute stored procedures!

    Lets hope for an update soon

  8. #23
    Join Date
    Apr 2005
    Location
    São Paulo, Brazil
    Posts
    2,451
    Hello,

    support for stored procedures is now available for registered users of this plugin. The current build at this moment (1.0.3.1) features two new actions:
    • ODBC.ExecuteDirect() - support for the execution of stored procedures, while the results are returned as a table;
    • ODBC.QueryToTable() - support for the execution of queries, while the whole resultset is returned as a table.

    Here is a sample how this works:
    Code:
    -- Execute a stored procedure and display the resultset in a grid
    result = ODBC.OpenDSNConnection("mydsn", "username", "password");
    if (result ~= 0) then
       error = Application.GetLastError();
       Dialog.Message("ODBC Actions Plugin", "Connection failed: (" .. error .. ")", MB_OK, MB_ICONSTOP);
    else
       resultset = ODBC.ExecuteDirect("{ CALL \"dbo.test\" }");
       if (resultset == nil) then
          error = Application.GetLastError();
          Dialog.Message("ODBC Actions Plugin", "Query failed (" .. error .. ")", MB_OK, MB_ICONSTOP);
       else
          numRows = Table.Count(resultset);
          for row, record in resultset do
             for col, field in record do
                if (col == 1) then
                   if (row == 1) then
                      -- set the column count of the grid only once
                      numCols = Table.Count(record);
                      Grid.SetColumnCount("Grid1", numCols);
                   else
                      -- new record starting
                      Grid.InsertRow("Grid1", -1, false);
                   end
                end
                Grid.SetCellText("Grid1", row-1, col-1, field, false);
             end
          end
          Grid.Refresh("Grid1");
       end
       result = ODBC.CloseConnection();
       if (result ~= 0) then
          error = Application.GetLastError();
          Dialog.Message("ODBC Plugin", "Could not close connection (" .. error ..")", MB_OK, MB_ICONSTOP);
       end
    end
    The exact syntax for the call to the stored procedure depends on the database that is used. Using SQL Server, I was able to get perfect results with

    rsTable = ODBC.ExecuteDirect("{ CALL \"master.dbo.sp_who\" }"); and
    rsTable = ODBC.ExecuteDirect("EXEC sp_who");

    while an instance of Firebird SQL expected a command in this format:

    rsTable = ODBC.ExecuteDirect("EXECUTE PROCEDURE \"Procedure01\"");

    These new functions are not fully implemented in the evaluation version.

    Ulrich
    Last edited by Ulrich; 08-04-2009 at 01:17 PM.

  9. #24
    Join Date
    Mar 2009
    Location
    -31.9554,115.85859
    Posts
    282
    Hi Ulrich,

    I have run into a snag (at last )

    I cannot get this SELECT statement to work, I think it is due to joins.

    ODBC.OpenQuery("SELECT \"contracts\".\"CONTNO\", \"contitems\".\"ITEMNO\", \"contitems\".\"ITEMDESC\", \"contitems\".\"QTY\", \"contracts\".\"ACCT\", \"contracts\".\"ACCTNAME\", \"contracts\".\"DELNAME\", \"contitems\".\"TYPE\", \"contitems\".\"STATUS\", "
    .."\"contitems\".\"DELDATE\", \"contitems\".\"HIREDATE\", \"stock\".\"ITEMNO\" FROM (\""..DataDB.."\".\"dbo\".\"Contracts\" \"contracts\" LEFT OUTER JOIN \""..DataDB.."\".\"dbo\".\"ContItems\" \"contitems\" ON "
    .."\"contracts\".\"CONTNO\"=\"contitems\".\"CONTNO \") LEFT OUTER JOIN \""..DataDB.."\".\"dbo\".\"Stock\" \"stock\" ON \"contitems\".\"ITEMNO\"=\"stock\".\"ITEMNO\" WHERE (\"contitems\".\"DELDATE\"={ts '"..Today.." 00:00:00'}) ORDER BY \"contracts\".\"CONTNO\"");
    Can you confirm whether or not the presence of joins are an issue?

    Kind regards.

  10. #25
    Join Date
    Apr 2005
    Location
    São Paulo, Brazil
    Posts
    2,451
    The command used as argument is passed as received by the plugin to the ODBC driver. And the ODBC driver by itself probably does not parse the command in any way, so a SELECT with JOINs should work.
    If you get an error 12004 response, this would mean that the query did execute, but the server returned an (syntax?) error. On the other hand, an error 12002 would mean that a database exception occurred, and the query probably was not run.
    I would log the query string you composed, and run the same command manually against the database, perhaps using MS Query, with the same ODBC connection, as this might give a hint about what is happening.

    Ulrich

  11. #26
    Join Date
    Aug 2004
    Location
    Somewhere in Texas, USA
    Posts
    417

    Change Log: 1.0.3.2

    What is wrong here?

    In the documentation you state:

    Change Log: 1.0.3.2
    QueryToTable() now returns one full record of the recordset in the evaluation build. Full results will be returned in the registered version only.
    I just downloaded 1.0.4.2 (as shown when compiling AMS7 for testing) and it is telling me that that feature is not available in the Eval.

    Can you please explain what I am doing wrong.

    Also on your website you state that "The plugin will work FULLY for 7 days.

    Also the BLOB function is not working in the EVAL.

    There is conflicting information on your site.

    Thanks.

  12. #27
    Join Date
    Apr 2004
    Location
    Vancouver, Canada
    Posts
    1,790
    Don't klnow about the QueryToTable but it cleary states that the BLOB feature is only in the full version.

    New function GetBlob(). [Available in full version only]
    Dermot

    I am so out of here

  13. #28
    Join Date
    Apr 2005
    Location
    São Paulo, Brazil
    Posts
    2,451
    I removed the word to avoid confusion. I thought that the web page makes it somewhat clear what the differences are between the full version and the evaluation build.

    Ulrich

  14. #29
    Join Date
    Aug 2004
    Location
    Somewhere in Texas, USA
    Posts
    417
    So the QueryToTable should pull at least the first record?

  15. #30
    Join Date
    Apr 2005
    Location
    São Paulo, Brazil
    Posts
    2,451
    Yes - the function shows the alert, but the first record of the resultset is returned.

Similar Threads

  1. What's new in AMS 5.0?
    By Ted in forum AutoPlay Media Studio 5.0
    Replies: 0
    Last Post: 09-22-2003, 04:56 PM
  2. AutoPlay Media Studio 4.0.0.3 Released
    By Brett in forum AutoPlay Media Studio 4.0
    Replies: 0
    Last Post: 12-11-2002, 09:39 AM
  3. HOWTO: AutoPlay Media Studio 4.0 and Flash Interaction
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-30-2002, 11:40 AM
  4. HOWTO: Make a Media Player Object Go Full Screen
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-23-2002, 12:23 PM
  5. INFO: Tips for Debugging Action Lists in AutoPlay Media Studio 4.0
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-03-2002, 09:38 AM

Tags for this Thread

Posting Permissions

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