In trying to connect to a MS SQL Server 2008 database, I am not able to connect using either one of the three options to connect from the loading demo. I keep receiving a invalid parameter was passed error.
: IMSSP Error Code: -14 Message: An invalid parameter was passed to sqlsrv_query. – select top (1+0)
Hello Stanley,
This is very unique.
Can you send me the SQL query / grid file with sample table dump, so that i can regerate the case.
Regards,
Case resolved on chat, and issue was in database configuration, which resolved afterwards.
I have an email in to Abu, but I am getting the same message. Can the fix be posted here?
This was the array that i used for connecting:
$db_conf = array();
$db_conf["type"] = "mssqlnative"; // or mssql
$db_conf["server"] = "10.0.1.205"; // ip:port
$db_conf["user"] = "username";
$db_conf["password"] = "password";
$db_conf["database"] = "databasename";
And also that if your server name is "ipaddress.ip.ip/testing"
It does not work. It has to be an absoilute domain or IP
I hope this is helpful
ALSO:
If setting a databsase table for CRUD operations, I had to use the schema:
$g->table = "[database].[dbo].[tablename]";
But subqueries are still:
$g->select_command = "SELECT * from table name";
Stan made some configuration changes on his side, after which it went smooth.
He also replied on this thread, please review.
PS: It is not supported in free version
I just bought the developer version and I am usering SQL Server 2012.
I have also tried all examples from the loading demo but still get the error:
Couldn't execute query. SQLState: IMSSP Error Code: -14 Message: An invalid parameter was passed to sqlsrv_query. – select top (1+0) * FROM [dbname].[dbo].[Accounts] WHERE 1=1
I am using config similair to Stan's:
$db_conf = array();
$db_conf["type"] = "mssqlnative"; // or mssql
$db_conf["server"] = "127.0.0.1"; // ip:port
$db_conf["user"] = "user";
$db_conf["password"] = "pw";
$db_conf["database"] = "dbname";
Regards
Pasting Mike's reply to help others: Got it working, it was the account that IIS is using for Anonymous Authentication. Co worker that setup the new SQL box was unaware that I had a user that needed DB rights
Finally got it working. My sqlserver settings were not correct. I have used the command tool sqlcmd to test this. The previously mentioned settings were the right one.
And thanks Abu, for guiding me to the right direction!!
Joost or Stan, my config section looks the same as you show. Are there changes I need on the SQL server itself?