Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

trouble connecting to SQL 2005 db.

0 views
Skip to first unread message

mrecomm101

unread,
Oct 6, 2009, 3:50:06 PM10/6/09
to
I have a program that normally uses an ACCESS db. It uses a file "conn.inc"
to connect to the access db. This is how it looked:

<%
dim conn,strcon
set conn=server.createobject("adodb.connection")
strcon = "PROVIDER=MSDASQL;"
strcon = strcon & "DRIVER={Microsoft Access Driver (*.mdb)};"
strcon = strcon & "DBQ=" & Server.mappath("alt.mdb")&";"
conn.open=strcon
%>

I used the following modifications to connect to the new SQL 2005 db:

<%
dim conn,strcon
set conn=server.createobject("adodb.connection")
strcon =
"PROVIDER=SQLOLEDB;SERVER=00.000.000.000;UID=user;PWD=password;DATABASE=ALT;"
conn.open=strcon
%>

When I try to connect, it waits a bit then errors. Any other changes and it
errors immediately, so I think I'm close.

Any suggestions?

Erland Sommarskog

unread,
Oct 6, 2009, 5:39:50 PM10/6/09
to
mrecomm101 (mreco...@discussions.microsoft.com) writes:
> I used the following modifications to connect to the new SQL 2005 db:
>
><%
> dim conn,strcon
> set conn=server.createobject("adodb.connection")
> strcon =
>
"PROVIDER=SQLOLEDB;SERVER=00.000.000.000;UID=user;PWD=password;DATABASE=ALT;
"
> conn.open=strcon
> %>
>
> When I try to connect, it waits a bit then errors. Any other changes and
> it errors immediately, so I think I'm close.

From where did you get 00.000.000.000? That does not look like a good
server address to me. You should specify the server name there.


--
Erland Sommarskog, SQL Server MVP, esq...@sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

mrecomm101

unread,
Oct 7, 2009, 10:51:12 AM10/7/09
to
Thank you for the tutorial links. I was unable to find anythingthat would
help me solve the problem at hand, however.

mrecomm101

unread,
Oct 7, 2009, 11:01:01 AM10/7/09
to
The "00.000.000.00" was just to show that I was using the IP address of the
server.

Erland Sommarskog

unread,
Oct 7, 2009, 5:45:44 PM10/7/09
to
mrecomm101 (mreco...@discussions.microsoft.com) writes:
> The "00.000.000.00" was just to show that I was using the IP address of
> the server.

Well, what I know now is that you use this connection string:



PROVIDER=SQLOLEDB;SERVER=00.000.000.000;UID=user;PWD=password;DATABASE=ALT;

Where the zeroes is probably a placeholder for an IP-adress. And I know
this:

>>> When I try to connect, it waits a bit then errors. Any other changes
>>> and it errors immediately, so I think I'm close.

I'm afraid that is very little information to work with, so don't expect
any bright answers. Bear in mind that solving connection issues require
knowledge about your local environment, about which I know nada.

Anyway, with the above you say that it errors after waiting a while.
By chance, you don't happen to be willing to share the error message?
When it errors directly what error message do you get?

The fact that it waits, indicate you are not specifying the correct
server. That is, there is no server on that IP-address, or it is
not listening on port 1433. Or there is a server, but it is not accepting
remote connections. Or it is not running.

William Vaughn (MVP)

unread,
Oct 10, 2009, 10:45:15 PM10/10/09
to
Or a dozen other issues. Search my blog for "connecting". When referencing a
server by IP address you also need to determine the port--and it's probably
not 1433 if you've installed SQL Server as an instance. Generally, we don't
reference SQL Server by IP address as it's not particularly safe.

--
__________________________________________________________________________
William R. Vaughn
President and Founder Beta V Corporation
Author, Mentor, Dad, Grandpa
Microsoft MVP
(425) 556-9205 (Pacific time)
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
http://betav.com http://betav.com/blog/billva
____________________________________________________________________________________________

"Erland Sommarskog" <esq...@sommarskog.se> wrote in message
news:Xns9C9DF1C7D...@127.0.0.1...

mrecomm101

unread,
Oct 22, 2009, 12:14:01 PM10/22/09
to
I tried using just the server name and it performed in the same manner. I
ended up abandoning the project and just using the Access db, which is
working fine.
0 new messages