codeigniter connectivity with mssql using sqlsrv driver in wamp server - sql-server

I am not able to connect the mssql with codeigniter in wamp server
I am getting the following error
A Database Error Occurred
Unable to connect to your database server using the provided settings.
Filename: C:\wamp\www\secure.leaftrack.com\system\database\DB_driver.php
Line Number: 124

After a few day of problems my company was able to solve this.
We were using the dll for mssql from PHP version 5.2.11. Once we updated to 5.2.17 it was fixed!

Related

why does 'Django mssql connection error' happen?

i have an ready database and I wanna use it in django web project. but I have an error about connection.
here is the error
raise NotSupportedError('SQL Server v%d is not supported.' % ver) django.db.utils.NotSupportedError: SQL Server v16 is not supported.
here is the packeges
asgiref 3.5.2
Django 2.1.15
django-mssql-backend 2.8.1
django-pyodbc-azure 2.1.0.0
django-pyodbc-azure-2019 2.1.0.0
mssql-django 1.2
pip 22.0.4
pyodbc 4.0.35
pytz 2022.7
setuptools 58.1.0
sqlparse 0.4.3
tzdata 2022.6
and database settings
DATABASES = {
'default': {
'ENGINE': 'sql_server.pyodbc',
'NAME':'veritabanıProje2',
'USER': 'sa',
'PASSWORD':'**',
'HOST':'DESKTOP-MDLFE99',
'PORT':'',
'OPTIONS':{
'driver':'ODBC Driver 17 for SQL Server',
},
},
}
I'm using SQL server 2022.
also the db file's name DB.sql in project directory. but I write here the name that is written while I create database. (I tried with DB.sql also of course)
I can understand the fault is about version but which one is wrong I dont know.
It may be due to several reasons such as-
Incorrect database connection settings: Make sure that you have entered the correct database name, server name, and login credentials in your Django settings.
Network issues: If your Django application is unable to connect to the database server, it could be due to network issues such as a firewall blocking access or a network configuration problem.
Incorrect version of Django or Python: Make sure that you are using a version of Django and Python that is compatible with the version of the Microsoft SQL Server database you are trying to connect to
I will update if i can get more source

Laravel database connection to separate SQL Server

I have a tricky one here that I'm looking for advice to see how much flexibility we have with a project.
We have a database that is hosted on a server locally that we can remote desktop into. I have the credentials and the domain example: SQL-CVW\BRADNAMS and I have the database name BRENT and the user and login that works for the program that the database feeds.
I can login to the remote desktop and open the database using SQL Server Management Studio but I need to be able to access it through Laravel.
I have tried using the sqlsrv setup in my .env file and I have the pdo_sqlsrv and sqlsrv php extensions installs.
I try to run php artisan migrate and I get the following error:
SQLSTATE[08001]: [Microsoft][ODBC Driver 17 for SQL Server]TCP Provider: The wait operation timed out.
(SQL: select * from sysobjects where type = 'U' and name = migrations)

How to connect MSSQL using symfony odm

I am using symfony and try to connect with windows MSSQL Server using odm pdo_sqlsrv driver but getting the following error
[Doctrine\DBAL\Driver\PDOException]
SQLSTATE[HYT00]: [unixODBC][Microsoft][ODBC Driver 17 for SQL Server]Login timeout expired
even though i am able to connect using sql cmd.
Both Machines are on MS Azure.
Any Suggestion would be appreciated.
You can alter your connection string and add Timeout=[seconds] to your connection string.

Cant query in Using Laravel 5.2 at MSSQL 2008 R2

I have this error. I searched at google for some possible solution and followed some steps but still I still get this error.
PDOException in Connector.php line 55:
SQLSTATE[08001]: [Microsoft][ODBC Driver 11 for SQL Server]TCP Provider: No connection could be made because the target machine actively refused it.
My .env looks like this
DB_CONNECTION=sqlsrv
DB_HOST=localhost
DB_PORT=1433
DB_DATABASE=database
DB_USERNAME=sa
DB_PASSWORD=1234
when I test my data source (ODBC) I get successful connection. But when I try to query at my program. I have this error. BTW I'm using Laravel 5.2 and MSSQL 2008 R2.
The database in installed locally.

Java SQL Server 2014 Cannot open database error

(not same case as: Java SQL Server 2012 Cannot open database error)
I have an environment running iReport 4.7.1, and I connect it to SQL Server 2014 using the driver from JBoss 6 lib folder: sqljdbc4.jar.
This same driver, on the same porto (1433) is not working to connect Eclipse Mars2 64bits to SQL Server.
When creating the driver I did select "Microsoft SQL Server 2008 JDBC Driver" (the most recent on the list), but I hope this is only a name, as I selected the jar I'm successfully using to connect iReport (sqljdbc4.jar).
I got
com.microsoft.sqlserver.jdbc.SQLServerException: Cannot open database
"databaseName=MY_DB" requested by the login. The login failed.
My Connection URL is the same that's working on iReport:
jdbc:sqlserver://localhost:1433;databaseName=databaseName=MY_DB
Also, Eclipse is running under Java 8, and iReport under Java 6, but I believe this is not the issue.
Any idea what's wrong?
Your connection URL sets "databaseName=" twice. Try changing it to:
jdbc:sqlserver://localhost:1433;databaseName=MY_DB

Resources