Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connect to SQL Server database on a specified port. #624

Closed
sigurdne opened this issue Aug 6, 2020 · 5 comments
Closed

Connect to SQL Server database on a specified port. #624

sigurdne opened this issue Aug 6, 2020 · 5 comments
Assignees
Labels
enhancement mssqlnative Native driver for SQL Server driver (Tier 1)
Milestone

Comments

@sigurdne
Copy link

sigurdne commented Aug 6, 2020

The port information is missing.
One will need to set the port - if anything else than standard.

Something like this in the function ADODB_mssqlnative::_connect()

if (!empty($this->port)) { $argHostname .= ", $this->port"; }

Regards

@dregad
Copy link
Member

dregad commented Aug 6, 2020

This is included in upcoming 5.21.0 release, see #314

@dregad dregad closed this as completed Aug 6, 2020
@sigurdne
Copy link
Author

sigurdne commented Aug 8, 2020

Yes, that is true for ADODB_mssql, but I can't see it in ADODB_mssqlnative.

Regards

@dregad dregad added enhancement mssqlnative Native driver for SQL Server driver (Tier 1) and removed duplicate labels Aug 10, 2020
@dregad dregad added this to the v5.21.0 milestone Aug 10, 2020
@dregad
Copy link
Member

dregad commented Aug 10, 2020

Right, sorry... So not a duplicate then.

@mnewnham as I don't use mssql, would appending the port number to the hostname before calling sqlsrv_connect() at line 493, like so, be sufficient ?

if (!empty($this->port)) {
    $argHostname .= "," . $this->port;
}

@dregad dregad reopened this Aug 10, 2020
@mnewnham
Copy link
Contributor

Yes, absolutely. I think I've done this before. I think I've not done anything official because unlike most connections , its server,port instead of server:port. It doesn't appear to be a widely used option either.

mnewnham added a commit that referenced this issue Dec 12, 2020
Enhancement allows use of a specfic database connection port
mnewnham added a commit that referenced this issue Dec 12, 2020
… …

Enhancement allows use of a specfic database connection port
@mnewnham mnewnham self-assigned this Dec 12, 2020
@mnewnham mnewnham modified the milestones: v5.21.0, 5.20.19 Dec 12, 2020
@mnewnham
Copy link
Contributor

Will appear in 5.20.19

@mnewnham mnewnham changed the title mssqlnative: Connect on a specified port. Connect to SQL Server database on a specified port. Dec 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement mssqlnative Native driver for SQL Server driver (Tier 1)
Projects
None yet
Development

No branches or pull requests

3 participants