PHP odbc_connect doesn't... when via DSN
Posted by: kiernan7 (---.socal.res.rr.com)
Date: September 15, 2019 04:26AM

I have an ODBC Connection that works:

$cqmconn = odbc_connect("Driver={SQL Server Native Client 10.0}; Server=JOHN-HP; Database=cqmla;", "sa", "sa" ) or die ("Unable to connect to CQM site." );

However, I have an existing ODBC Driver called "cqm2" that connects to cqmla, but the line below does NOT make a connection (with or without the "SQL_CUR_USE_ODBC"

$cqmconn = odbc_connect("cqm2","sa","sa", SQL_CUR_USE_ODBC) or die ("Unable to connect to CQM site." )

I can, however, use that ODBC connection (and credentials) with Visual FoxPro and the DSN connection works fine. What am I missing?

I ask this because while I certainly can use the first method here, I have ANOTHER proprietary system that I cannot get to work, although it does have an ODBC connection I can access via other software using the:
$cqmconn = odbc_connect("cqm2","sa","sa" )
format. If I can get my existing connection to work here, I figure I should then be able to call the other one.

What am I missing? Thanks in advance!



Edited 2 time(s). Last edit at 09/16/2019 11:47AM by RiggsFolly.

Options: ReplyQuote
Re: PHP odbc_connect doesn't... when via DSN
Posted by: aresko (---.215.238.99.dynamic.ttnet.com.tr)
Date: November 22, 2019 06:39PM

I'm attempting to connect to a database via ODBC, and I am finding no help through Google/the internet. Our ERP uses OMNIS as a framework, which provides an ODBC driver for querying OMNIS' proprietary database outside of the program. I've created the driver and DSN, but I cannot begin manipulating data or sending queries with PHP.
emi calculator gst login ifsc code



Edited 1 time(s). Last edit at 11/22/2019 07:16PM by aresko.

Options: ReplyQuote
Re: PHP odbc_connect doesn't... when via DSN
Posted by: Otomatic (Moderator)
Date: November 22, 2019 07:01PM

Hi,

See PHP documentation about ODBC: https://www.php.net/manual/en/book.uodbc.php

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote


Sorry, only registered users may post in this forum.