Load Data from Microsoft SQL Server Management Studio Fail

Hello,

I ran into 2 issues while trying to implement the Scheduler, the first seems to be an issue with the view whereby the forward and backward button on the calendar does not display correct, it works fine and I can navigate but the arrow does not display correctly like in the demo.

My second problems is with my DB, I’ve followed the instructions but am not able to load data from it or save. I am using Microsoft SQL Server Management Studio.

Here are my code pieces, the first one is the main code.

[code]

How to start html, body { margin: 0px; padding: 0px; height: 100%; overflow: hidden; }
 
 
[/code]

This is my connector and I am using a modified events.php from the demo.

[code]<?php
require_once(’…/scheduler/scheduler_connector.php’);
include (’…/scheduler/config.php’);

$scheduler = new SchedulerConnector($res,“dbtype”);
$scheduler->render_table(“events”);
?>[/code]

From here I am using a modified version of the config.php also from the demo.

[code]<?php

//require("…/scheduler/scheduler_connector.php");
require("…/scheduler/db_mssql.php");

//require_once(dirname(__FILE__).'/connector/db_sqlite3.php');

// SQLite
//$dbtype = "SQLite3";
//$res = new SQLite3(dirname(__FILE__)."/database.sqlite");

// Mysql
// $dbtype = "MySQL";
// $res=mysql_connect("192.168.1.251", "scheduler", "scheduler");
// mysql_select_db("schedulertest");

// MSSQL
$dbtype = “MsSQL”;
$res=mssql_connect(’\SYEAP1-MOBL1\FGDDASHBOARD’, “sql_dashboard”, “dashboard.2014”, false);
mssql_select_db(“downtime”);

//$schedulerConn->render_table(“events”)

?>[/code]

Unfortunately no events are displayed even though I have added events into my db.

Any help that can be provided to resolve my 2 issues would be greatly appreciated.

Thanks and regards,

Brax

(1)
Be sure that both css and images from the original package is included in your app, and their relative position is the same ( css has relative references to images, so if you have a different folders structure - they can be broken )

(2)
Try to load …/scheduler/events.php directly in browser. If it doesn’t show any valid output - try to enable server side logs ( add $scheduler->enable_log(“some.txt”) before render_table command )

If script outputs valid data - check that dates in data feed are formatted the same as you have specified in the scheduler.config.xml_date

Hi Stanislav,

Thanks for getting back to me so quickly, your assistance is very much appreciated. Regarding what you have told me to try

On (1) it works beautifully now, I tested on a few of the images and I realized that my folder structure is a tad different which caused the issue.

On (2), I am still stuck. Navigating directly to events.php gets me a "HTTP Error 404.3 Not Found error.
I tried enabling the log per your instructions below but the log file is not generated. I’m not sure if I have done this correctly so I have the code attached. I added the line to generate the log in events.php before the render table command as shown below.

[code]<?php
require_once(’…/scheduler/scheduler_connector.php’);
include (’…/scheduler/config.php’);

$scheduler = new SchedulerConnector($res,“dbtype”);
$scheduler->enable_log(“some.txt”)
$scheduler->render_table(“events”);
?>[/code]

Do let me know if I did this incorrectly, thanks again for your time.

Best Regards,

Brax

Error 404

Normally it is a sign of incorrect path - the url is wrong.
In case of problem with server side code you will have an empty response or Error 500

The server side code is valid. The only thing that can be changed - the render_table instruction, it will be better to clearly provide used fields

$scheduler->render_table(“events”, “id”, “start_date, end_date, text”);

Ok…I tried specifying the fields exactly and still no luck. I’m not able to return any data from my DB.
I queried my DB to check on the datetime string and when I do a select the query returns 2014-08-01 08:00:00.000

I amended the date config to include the seconds like below but still no luck.

scheduler.config.xml_date="%Y-%m-%d %H:%i:%s";

Could my db table be the problem? Here is my code to create the table, I created using the wizard so to get this code I actually script the table as create to get it.

[code]USE [downtime]
GO

/****** Object: Table [dbo].[events] Script Date: 08/06/2014 17:20:52 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[events](
[id] [int] IDENTITY(1,1) NOT NULL,
[start_date] NOT NULL,
[end_date] NOT NULL,
[text] varchar NOT NULL,
CONSTRAINT [PK_events] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

[/code]

Any suggestions on what else I can try?

Db structure looks fine
If you still have error 404 - check the http url mapping, most probably the url that you are using in the load command just doesn’t point to valid php file.

Hello,

Thanks for all the effort in helping me, I checked my file mapping and looks good. I know it’s correct because the scheduler displays correctly :smiley: and it’s using the same folder structure.

Would using maybe the java connector or .net connector make a difference?

I’ve attached my entire project here to see if that would help see where I went wrong.

I’m using VS2013 and SQL Server 2008 R2…not sure if this makes a difference.
calendar.zip (129 KB)

Hello,

Some additional information after messing around a bit trying to fix this, am still stuck at the same point but i realized after trying to analyze if the call is being made to the db is that somehow I am not able to get connector.php.

The error is saying either it is missing a handler or it’s because it’s a MIME type or an incorrect path, I’ve confirmed the path is right but am not sure what the rest is.

I’ve modified my events.php to connector.php so the file namings are clearer and also made slight changes, as usual the logging still does not work.

[code]<?php
require_once(’/connector/scheduler_connector.php’);
require_once("/connector/db_mssql.php");
//include (’/scheduler/config.php’);

$res=mssql_connect("SYEAP1-MOBL1\FGDDASHBOARD","sql_dashboard","dashboard.2014",false);
mssql_select_db("downtime");

$schedulerConn = new SchedulerConnector($res,“MsSQL”);
$schedulerconn->enable_log(“log.txt”);
$schedulerConn->render_table(“events”,“id”,“start_date,end_date,text”);
?>[/code]

Is it my connection string to the DB having issues causing the connector.php not to load? I’ve tried changing the PC name to having \ before and also withuot but no changes.

Thanks for any help provided.

What response you have when loading connector.php in the browser

  • empty or error message - server side errors
  • you can see a php code - mime type is not configured, php file not processed
  • xml data - check format of dates is it the same as scheduler.config.xml_date

Hello,

When I navigate directly to connector.php through VS2013 I get the below error

HTTP Error 404.3 - Not Found

The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.

Most likely causes:
•It is possible that a handler mapping is missing. By default, the static file handler processes all content.
•The feature you are trying to use may not be installed.
•The appropriate MIME map is not enabled for the Web site or application. (Warning: Do not create a MIME map for content that users should not download, such as .ASPX pages or .config files.)
•If ASP.NET is not installed.

Would this be considered a server side error?

Thanks and regards,

Brax

It seems that PHP processing is not enabled at all in your case.

You need to use a web server that will handle PHP, or you can use different connectors for appropriate platfoms - there are .Net and Java packages.

Hello,

Thanks for the information, I am using ISS and I assumed PHP would run fine on it without any additional things.

I’m looking into installing PHP, in the mean time I have tried the Java connector but that also has the exact same problem as the PHP connector.

I’ve modified my main page to call myconnector.do and following is the code in myconnector.do, considering I am getting the exact same error. I am wondering if there is something else wrong, or something I am missing.

[code]import java.sql.Connection;
import java.sql.DriverManager;

import com.dhtmlx.connector.*;

/**

  • The Class BasicConnector.
    */
    public class BasicConnector extends ConnectorServlet {
    @Override
    protected void configure() {
    //obtain DB connection
    Connection conn=null;
    try {
    Class.forName (“com.mssql.jdbc.Driver”).newInstance ();
    conn = DriverManager.getConnection(“jdbc:mssql://SYEAP1-MOBL1/FGDDASHBOARD”, “downtime”, “sql_dashboard”, “dashboard.2014”);
    } catch (Throwable e) {
    e.printStackTrace();
    }

             //Initializes connector
     schedulerConnector c = new schedulerConnector(conn,DBType.MSSQL);
             //configures the used table and fields
     c.render_table("events");
    

}[/code]

Best regards,

Brax

Hello,

I actually tried out the java connector but ran into the same problem and could not figure it out. So I fell back to using PHP, I have installed and configured PHP correctly and am able to parse other PHP files with no problems.

I configured my connector.php once again as below with mysql to try to follow the example/samples even closer.

Now I am hitting a 500 error or general The Website cannot display the page error. I have attached the server side code here, can’t see what is wrong :frowning:

[code]<?php
include(’/connector/scheduler_connector.php’);
//include("/connector/db_mssql.php");
//include (’/scheduler/config.php’);

$res=mysql_connect("localhost","sql_dashboard","dashboard.2014");
mysql_select_db("downtime");

//$schedulerConn = new SchedulerConnector($res,“MySQL”);
$scheduler = new SchedulerConnector($res);
$scheduler->render_table(“events”, “id”, “start_date, end_date, text”);
?>[/code]

I have checked my date format and it looks good.

Thanks for any help that can be provided.

Add the next line

$scheduler = new SchedulerConnector($res); $scheduler->enable_log("log.txt"); //this one!

Check the content of log.txt - it must contains details about the error

Hello,

Thanks for getting back to me so promptly, I followed the steps provided but nothing appears in the log. I’m not too sure if I am doing this incorrectly?

I’m running this from VS2013 so I put a log.txt for it to write to, I also tried to put a log.txt in my C:\ to see if it would write there like below.

[code]<?php
include(‘/connector/scheduler_connector.php’);
//include(“/connector/db_mssql.php”);
//include (‘/scheduler/config.php’);

$res=mysql_connect("localhost","sql_dashboard","dashboard.2014");
mysql_select_db("downtime");

//$schedulerConn = new SchedulerConnector($res,“MySQL”);
$scheduler = new SchedulerConnector($res);
$scheduler->enable_log(“/scheduler/log.txt”); //this one!
$scheduler->enable_log(“C:\Downloads\log.txt”); //this one!
$scheduler->render_table(“events”, “id”, “start_date, end_date, text”);
?>[/code]

I looked at how to enable logging on the Guide but looks like I did everything correctly.

Funny thing is since I was able to load PHP pages and since I hit the 500 error each time I load the scheduler I get this pop up which looks like a warning icon. Screenshot attached.

I feel i am close to getting this working but I can’t see why it won’t connect or why the logger does not work.

Is there something else that I need to enable or change to get the logger to work?


Popup appears because the response text is empty ( it is normal for error 500 )
If log file not created the error must occur on php compilation stage, try to check the web-server log file, it must contain error records from all php scripts

Unfortunately no logs are being generated, I tried varying files and other .php files do show up in the log but not my connector.php

here is my connector.php code

[code]<?php

require_once("/connector/scheduler_connector.php");

//include("/connector/db_mssql.php");
//include (’/scheduler/config.php’);
$scheduler=mysql_connect(“localhost”,“sql_dashboard”,“dashboard.2014”);
mysql_select_db(“downtime”);

//$schedulerConn = new SchedulerConnector($res,“MySQL”);
$scheduler = new SchedulerConnector($res);
$scheduler->enable_log("/scheduler/log.txt", true); //this one!
$scheduler->enable_log(“C:\Downloads\log.txt”); //this one!
$scheduler->render_table(“events”, “id”, “start_date, end_date, text”);

?>[/code]

Just wondering, on the very first line I am using require_once…but on a few examples I see include instead.

I’ve tried both but no difference, am just wondering what is the difference in using both?

I am able to load from an xml directly, but not to the DB.

In VS2013 when I debug in IE, the function code does not return anything though.

I’ve changed the xml date, but could that potentially be a problem why i’m not getting any response?

After a few tries seems like something got logged on iss logs when i manually call the file through my local host.

doesn’t provide any information though.

2014-08-29 02:48:29 127.0.0.1 GET /connector.php - 80 - 127.0.0.1 Mozilla/5.0+(compatible;+MSIE+10.0;+Windows+NT+6.2;+WOW64;+Trident/6.0;+Touch) - 500 0 0 2
2014-08-29 02:48:32 127.0.0.1 GET /connector.php - 80 - 127.0.0.1 Mozilla/5.0+(compatible;+MSIE+10.0;+Windows+NT+6.2;+WOW64;+Trident/6.0;+Touch) - 500 0 0 2
2014-08-29 02:48:37 127.0.0.1 GET /connector.php - 80 - 127.0.0.1 Mozilla/5.0+(compatible;+MSIE+10.0;+Windows+NT+6.2;+WOW64;+Trident/6.0;+Touch) - 500 0 0 1
2014-08-29 02:48:46 127.0.0.1 GET /connector.php - 80 - 127.0.0.1 Mozilla/5.0+(compatible;+MSIE+10.0;+Windows+NT+6.2;+WOW64;+Trident/6.0;+Touch) - 500 0 0 3
2014-08-29 02:48:49 127.0.0.1 GET /connector.php - 80 - 127.0.0.1 Mozilla/5.0+(compatible;+MSIE+10.0;+Windows+NT+6.2;+WOW64;+Trident/6.0;+Touch) - 500 0 0 2
2014-08-29 02:48:55 127.0.0.1 GET /connector.php - 80 - 127.0.0.1 Mozilla/5.0+(compatible;+MSIE+10.0;+Windows+NT+6.2;+WOW64;+Trident/6.0;+Touch) - 500 0 0 2
2014-08-29 02:48:58 127.0.0.1 GET /connector.php - 80 - 127.0.0.1 Mozilla/5.0+(compatible;+MSIE+10.0;+Windows+NT+6.2;+WOW64;+Trident/6.0;+Touch) - 500 0 0 2
2014-08-29 02:48:59 127.0.0.1 GET /connector.php - 80 - 127.0.0.1 Mozilla/5.0+(compatible;+MSIE+10.0;+Windows+NT+6.2;+WOW64;+Trident/6.0;+Touch) - 500 0 0 2

Sorry, but I’m not sure what else can be done. If you don’t have log file created - there must be error during php file compilation ( mailformed php, or invalid local path, etc. )