473,386 Members | 1,621 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

DSN-less Problems - MS SQL server

Hi,

I have MS SQL Server set up on a win2k box (and am running
my PHP scripts on the same box that
SQL Server is on) ... not connected to a network and
just using the command line version of PHP ... (no web server)

I set up ODBC with a DSN for the login and password I installed in SQLServer

I set up the DSN for "local" i.e. on the local server
(I also tried it using the server name (in this case TASK5E01 with similar
results)
using ADOdb with a few drivers that reqire a DSN ... it all works fine.
This worked fine for example:

$db =& ADONewConnection('odbc_mssql');
$db->PConnect('test1');

where test1 is the DSN I set up for ... local ... tomjones ... and password
However I tried the DSNless versions as follows:

$dsn = "Driver={SQL Server};Server=localhost;Database=northwind;";
$db->Connect($dsn,'tomjones','password');

this fails with the following error:

C:\php1>php tlj4_DSNless.php
PHP Warning: SQL error: [Microsoft][ODBC SQL Server Driver][SQL
Server]Login fa
iled for user 'tomjones'. Reason: Not associated with a trusted SQL Server
conne
ction., SQL state 28000 in SQLConnect in
C:\php1\adodb\drivers\adodb-odbc.inc.ph
p on line 164
PHP Fatal error: Call to undefined function: close() in
C:\php1\tlj4_DSNless.p
hp on line 31

SO I went one step further and loaded the native PHP mssql stuff and ran it
as follows:

$dsn = mssql_connect("localhost", 'tomjones','password') or die
("mssql_connect failed"); //test PHP mssql directly
with the following identical result:

C:\php1>php tlj4_native.php
PHP Warning: mssql_connect(): message: Login failed for user 'tomjones'.
Reason
: Not associated with a trusted SQL Server connection. (severity 14) in
C:\php1\
tlj4_native.php on line 13
PHP Warning: mssql_connect(): Unable to connect to server: localhost in
C:\php
1\tlj4_native.php on line 13

SOOO --- what is up with this ... it must be a windows thing or the
DSNless stuff just won't work. I did some searching and found lots of
people
complaining about this error but the fixes they suggested didn't work ... I
am thinking it is a MS SQL Server set up issue but what is the point
of DSNlessness if one still has the tune the DBMS in order to get
connected ... why not just stick with ODBC which works. I wanted to be able
to connect without the hastles of using some MS GUI to set stuff up.

Thoughts? ... ideas for tests to run? ... suggestions on setting
up MS SQL Server or win2k to get around this?

As a work around, does anyone know how to set up ODBC DSNs under
program control in order to bypass the GUI?

thanks for wading though this ...

Tom
Jul 17 '05 #1
1 8134
I found a reference saying change the default ... mssql.secure_connection =
off ... to on in the php.ini file.

I tried it and now the native PHP mssql stuff works ... ADOdb is still a
problem but looking into whether a similar fix will work.

Tom
"Tom Jones" <to******@lucent.com> wrote in message
news:br********@netnews.proxy.lucent.com...
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Plunaldo | last post by:
Hi All I use a ODBC Connection to Connect to a AS400 System. I created a new DSN in the Windows System. The Databaseaccess is made directly out of the Crystal Report...so the Crystal Report is...
3
by: F. Michael Miller | last post by:
I can't find the file dsn for an Access DB. I can refresh the tables, and I've looked for all of the *.dsn files on the drives where it might be and I can't seem to find it. Is there any way...
2
by: Tina Robichaux | last post by:
I have found info on this problem at MS, but they say this problem does not occur with SQL 2K and MDAC 2.6 SP2, yet I am still experiencing it: I have a SQL user specifically created to SELECT...
2
by: kathyk | last post by:
Hi All, I am using Access 2003. I have a function that I have been using to log on to linked tables using the system ODBC and it has been working great. Now I want to do the same thing using a...
6
by: Andi Reisenhofer | last post by:
Hallo C# folks, Somebody know how to create a ODBC DSN dynamically in c# program. Also interesting for me would be the connectionstring for an Access Database. Thinks a lot Andreas
4
by: Steve Sweales | last post by:
I'm trying to find some code on how to create a DSN using C# and SQLConfigDataSource. Can anybody help me please, before I tear my hair out!! *** Sent via Devdex http://www.devdex.com ***...
0
by: Neo | last post by:
Hello All, ODBCAD32.exe launches DSN Setup. But then I have to select DSN and click configure to configure DSN. Is there any way, I could invoke configuration dialog box for particular DSN...
7
by: Alan.Squires | last post by:
Hi, I need to create a DB2 system DSN programmatically. I need to set the currentschema parameter to be equal to the appropriate database name. I am able to create the DSN ok, but am unable to...
0
by: senthildb2 | last post by:
Hi there, I want to create DSN for DB2 database through my VB application. I have installed DB2 v8.2 with FixPack6.0 ESE. (The actual version shown in Control Center is DB2 V8.1.13.193) The...
4
by: bytesbytes | last post by:
Hi, Im using VB6.0, Crystal report 10 and MSaccess Database. I was using Crystal report 6 and later upgraded to CR10. In VB6 i used DSN like .Connect = "DSN=DBName" & ";UID=admin;PWD=;" Now in...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.