Hello, sorry but new on php 4 grid , tryin to connect to MS sql server
my configuraion is
$db_conf = array();
$db_conf[“type”] = “mssqlnative”;
$db_conf[“server”] = “sqlsrv:server=192.168.0.240\SAGE100”;
$db_conf[“user”] = ‘myuser’; // username
$db_conf[“password”] = ‘mypassword’; // password
$db_conf[“database”] = ‘MAS_001’; // database
any sugestions
Error is SQLState: 08001
Error Code: -1
Message: [Microsoft][ODBC Driver 17 for SQL Server]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online
If you are using PDO based connection string you need to specify pdo instead of mssqlnative.
$db_conf[“type”] = “pdo”;
Sorry keep tryin , try pdo not work, my sqlconnection string for sqlsrv work, not pdo,
but when I put varaibles of grid4php unable to connect. Thanks
$connectionInfo = array( “Database”=>”MAS_001”, “UID”=>”myuser”, “PWD”=>”mypass”, ‘ReturnDatesAsStrings’ => true,”CharacterSet” =>”UTF-8″,”ConnectionPooling” => “1” ,”MultipleActiveResultSets”=>true);
$conn = sqlsrv_connect( $serverName, $connectionInfo);
Hello again,
I’ve created a sample that uses a PDO based sql server connection to a testing database.
You can refer code here: