473,226 Members | 1,569 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,226 software developers and data experts.

Connecting to SQL database

Hi

I have successfully connected to SQL2000 and MSDEE databases in the
past, however I have to move to SQL2005 and SQLEXPRESS databases now.

I've tried the following but with no luck [this is what i used in the
earlier incarnation except the Provider resource was SQLOLEDB.1]

Conn = Dispatch('ADODB.Connection')
Conn.ConnectionString = "Provider=SQLNCLI;Server=10.1.1.2;
Database=csrctest;Uid=bill;Pwd=bill"
print Conn.ConnectionString

try:
print 'trying to open'
Conn.Open()
etc.
All I ever get to is the trying to openline, then it times out.

I have tried all of the following combinations too:

Provider=SQLNCLI;Server=localhost;Database=csrctes t;Uid=bill;Pwd=bill;

Provider=SQLNCLI;Server=localhost\SQLEXPRESS;Datab ase=csrctest;Uid=bill;Pwd=bill;

The SQLEXPRESS database for testing purposes is on my home PC
[10.1.1.2]

Any clues s to where I am going wrong?

Look forward to hearing from someone, anyone!!

Kind regards

Bill


Dec 15 '07 #1
6 3060
En Fri, 14 Dec 2007 23:24:24 -0300, Unknown <un*****@unknown.invalid>
escribió:
I have successfully connected to SQL2000 and MSDEE databases in the
past, however I have to move to SQL2005 and SQLEXPRESS databases now.
Conn.ConnectionString = "Provider=SQLNCLI;Server=10.1.1.2;
Database=csrctest;Uid=bill;Pwd=bill"
Look for the right spelling at http://www.connectionstrings.com/

--
Gabriel Genellina

Dec 15 '07 #2
On Fri, 14 Dec 2007 23:35:00 -0300, "Gabriel Genellina"
<ga*******@yahoo.com.arwrote:
>En Fri, 14 Dec 2007 23:24:24 -0300, Unknown <un*****@unknown.invalid>
escribió:
>I have successfully connected to SQL2000 and MSDEE databases in the
past, however I have to move to SQL2005 and SQLEXPRESS databases now.
> Conn.ConnectionString = "Provider=SQLNCLI;Server=10.1.1.2;
Database=csrctest;Uid=bill;Pwd=bill"

Look for the right spelling at http://www.connectionstrings.com/

looks like my spelling is ok, any other ideas?

thanks for the suggestion above.

kind regards

bill

Dec 20 '07 #3
On Dec 14, 8:24 pm, bill ramsay <blah@blahdeblahwrote:
Hi

I have successfully connected to SQL2000 and MSDEE databases in the
past, however I have to move to SQL2005 and SQLEXPRESS databases now.

I've tried the following but with no luck [this is what i used in the
earlier incarnation except the Provider resource was SQLOLEDB.1]

Conn = Dispatch('ADODB.Connection')
Conn.ConnectionString = "Provider=SQLNCLI;Server=10.1.1.2;
Database=csrctest;Uid=bill;Pwd=bill"
print Conn.ConnectionString

try:
print 'trying to open'
Conn.Open()

etc.

All I ever get to is the trying to openline, then it times out.

I have tried all of the following combinations too:

Provider=SQLNCLI;Server=localhost;Database=csrctes t;Uid=bill;Pwd=bill;

Provider=SQLNCLI;Server=localhost\SQLEXPRESS;Datab ase=csrctest;Uid=bill;Pwd=bill;

The SQLEXPRESS database for testing purposes is on my home PC
[10.1.1.2]

Any clues s to where I am going wrong?

Look forward to hearing from someone, anyone!!

Kind regards

Bill
What Python module are you using? At first I thought you were using
the adodb module for Python, but your syntax doesn't look right for
that one.

Mike
Dec 20 '07 #4
On Dec 14, 8:24 pm, bill ramsay <blah@blahdeblahwrote:
Hi

I have successfully connected to SQL2000 and MSDEE databases in the
past, however I have to move to SQL2005 and SQLEXPRESS databases now.

I've tried the following but with no luck [this is what i used in the
earlier incarnation except the Provider resource was SQLOLEDB.1]

Conn = Dispatch('ADODB.Connection')
Conn.ConnectionString = "Provider=SQLNCLI;Server=10.1.1.2;
Database=csrctest;Uid=bill;Pwd=bill"
print Conn.ConnectionString

try:
print 'trying to open'
Conn.Open()

etc.

All I ever get to is the trying to openline, then it times out.

I have tried all of the following combinations too:

Provider=SQLNCLI;Server=localhost;Database=csrctes t;Uid=bill;Pwd=bill;

Provider=SQLNCLI;Server=localhost\SQLEXPRESS;Datab ase=csrctest;Uid=bill;Pwd=bill;

The SQLEXPRESS database for testing purposes is on my home PC
[10.1.1.2]

Any clues s to where I am going wrong?

Look forward to hearing from someone, anyone!!

Kind regards

Bill
You might try pymssql:

http://pymssql.sourceforge.net/

I've only used it with MSSQL2000, but according to the website, it
should work with 2005 too.

If you wrapped your database interface with SQLObject or SQLAlchemy,
then (as I understand it) the sql connector module can be swapped out
with little to no work. I hope to move to one of those sooner or
later:

http://www.sqlobject.org/
http://www.sqlalchemy.org/

Mike
Dec 20 '07 #5
On Dec 20, 10:01 pm, bill ramsay <blah@blahdeblahwrote:
On Fri, 14 Dec 2007 23:35:00 -0300, "Gabriel Genellina"

<gagsl-...@yahoo.com.arwrote:
En Fri, 14 Dec 2007 23:24:24 -0300, Unknown <unkn...@unknown.invalid>
escribió:
I have successfully connected to SQL2000 and MSDEE databases in the
past, however I have to move to SQL2005 and SQLEXPRESS databases now.
Conn.ConnectionString = "Provider=SQLNCLI;Server=10.1.1.2;
Database=csrctest;Uid=bill;Pwd=bill"
Look for the right spelling athttp://www.connectionstrings.com/

looks like my spelling is ok, any other ideas?

thanks for the suggestion above.

kind regards

bill
This is working for me to the internal network (I'm using adodbapi,
but the connection string should be the same)

'Provider=sqloledb;Data Source=dbserv;Initial Catalog=ndb;User
Id=foo;Password=bar;'

I just tested, and this works well too

'Provider=SQLNCLI;Data Source=dbserv;Initial Catalog=ndb;User
Id=foo;Password=bar;'

and to my local instance (Hermes is my machine)

'Provider=SQLNCLI;Data Source=HERMES\\SQLEXPRESS;Initial
Catalog=;User Id=sa;Password=pw666;'

Can you connect to the server using SqlServer Management Studio? Can
you create an odbc connection to the server? Unlike 2000, SqlServer
2005 has tcp/ip connections turned off by default, so you might want
to check that with the SqlServer Surface Area Configuration tool.

Externally we're still running 2000, so I don't know how connecting
over the interweb differs.

When you've figured out how to connect, and if you're open to a
suggestion, you might want to try out the adodbapi package (http://
adodbapi.sourceforge.net/). It is a thin wrapper over ADO, and works
quite well. Then you'll get to use the Python db-api v.2.0 syntax,
which is oodles less typing than straight ADO.

-- bjorn

Dec 20 '07 #6
bill ramsay wrote in news:5r********************************@4ax.com in
comp.lang.python:
Hi

I have successfully connected to SQL2000 and MSDEE databases in the
>
Conn = Dispatch('ADODB.Connection')
Conn.ConnectionString = "Provider=SQLNCLI;Server=10.1.1.2;
Database=csrctest;Uid=bill;Pwd=bill"
By default SQL 2005 doesn't enable the TCP/IP protocol, if your app'
is running on the same machine use either the machine name or a
period (.) and it will use the Shared Memory protocol.

You will also need the server instance name(*), so it would be:

"Provider=SQLNCLI;Server=.\SQLEXPRESS;Datab... "

*) IIRC you can't install express as the "Default" instance so
this will be required.

If you need to enable TCP/IP use the "SQL Server Configuration Manager"
about 4 levels deep from the "Start" menu. Remember to enable it for
the server and SQLNCLI.

Rob.
--
http://www.victim-prime.dsl.pipex.com/
Dec 20 '07 #7

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

Similar topics

4
by: John Morgan | last post by:
I have Enterprise Manager on my local machine. For the last twelve months it has been connecting without problem to my online SQL Server database provided by my ISP. Three weeks ago the ISP...
4
by: CodeImp | last post by:
A simple app I quickly wrote to try getting info from a database. Here is the first part of its code. The rest of the code is irellevant. using System; using System.Data; using...
12
by: Ann Marinas | last post by:
Hi all, I would like to ask for some help regarding separating the asp.net webserver and the sql server. I have created an asp.net application for a certain company. Initially, we installed...
5
by: Sebastian | last post by:
I'm using the following code to connect to an access 2000 database. (with reference to adodb) Public DBvar As New ADODB.Connection() DBvar.Open("Provider=Microsoft.Jet.OLEDB.4.0; Data...
3
by: GTDriver | last post by:
I'm trying to connect my application with a web service located on my own web server(localhost). I guess when the solution/proect is built it makes a file called 'Web...
5
by: nielsgron | last post by:
Hi, I have created a database on DB2 8.1 and 8.2 for Windows using the codeset "Big5" with the command: db2 CREATE DATABASE TWBIG5 USING CODESET BIG5 TERRITORY TW When I try to connect to...
5
by: Odd Bjørn Andersen | last post by:
I have installed DB2 9 Enterprise Edition on my laptop and created the sample database. Now I'm having truble connecting to the database from Command Editor. If I connect from Command Window it's...
0
by: =?Utf-8?B?R2lkaQ==?= | last post by:
Hi, I've my win32 application which connecting to my sql database. till now i used MSDE as my database and now i want to upgrade to sql express 2005. after the upgrade i tried to connect to the...
3
by: Sebouh | last post by:
Hi guys. I'm completely new to databases, so i wanna ask you if this is achievable. I've been learning how to connect to an MS SQL database file with java. I've finally learned the basics,...
2
by: bobt1991 | last post by:
I just installed Microsoft Visual Studio 2008 Express edition, and it installs some sort of stripped down version of SQL Server. It comes with no tools for connecting to your "local" database,...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...

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.