/    Sign up×
Community /Pin to ProfileBookmark

Connecting to MS-SQL Using ODBC

Hi all,
I am trying to connect to SQL Server DB Using ODBC Connection.
I am authorized to access the DB on Windows Authentication Login.
I set up my ODBC and tested it and worked fine.
But, when i tried to access it with PHP using ODBC, i got the following error:

[QUOTE]

Warning: odbc_connect() [function.odbc-connect]: SQL error: [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user ‘(null)’. Reason: Not associated with a trusted SQL Server connection., SQL state 28000 in SQLConnect in C:wampwwwRMStest_connect.php on line 17
Connection Failed:

[/QUOTE]

And my Connection Code is as follows:

[code=php]
$conn=odbc_connect(“RMS”,”,”);
if (!$conn)
{
exit(“Connection Failed: ” . $conn);
} else {
echo “connected successfully<br/>”;
}
[/code]

Any idea ??

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@davidvanrJul 12.2009 — The connection timeout variable has to be properly set or you get failed connection message and then a successful connection.
Copy linkTweet thisAlerts:
@themoonauthorJul 12.2009 — The connection timeout variable has to be properly set or you get failed connection message and then a successful connection.[/QUOTE]
I don't seem to understand what you mean.


You can find top jobs in Europe in the SQL area on ...[/QUOTE]

What does the jobs has to do with my query !!!!!

I guess You are a spammer.
×

Success!

Help @themoon spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...