Showing posts with label ado. Show all posts
Showing posts with label ado. Show all posts

Tuesday, March 27, 2012

Connecting to SQL Server 2000 from a VB 6.0 app using ADO

How to connect to real ip such as 202.28.94.10 from DCHP ip by use VB 6 .. I don't know about to use connection string ...
My PC is insatalled My SQL Server2000 and has ip 10.98.10.97 that is DHCP ip and another ones is installed the same but that it real ip. Both PC can't to see them together in network

This problem make my first PC can't access database to another one.
Help me plssss...I'm not entirely certain I understood your question. It appears that your SQL server is a DHCP client (and thus it is possible that the IP address will periodically change due to a reboot or a lease renewal (should not happen often, but it is possible).

Is it not possible to connect to the server via its name instead of the IP? Ie, use the DNS server to resolve the IP address?

On the other hand, re-reading your question seems to indicate that you have 2 client workstations, one DHCP and one static. It appears that the static IP client can connect to SQL and the DHCP client cannot. If that is the case, then you appear to have a network issue unrelated to SQL and you must work with the network admin to ensure that connectivity is not being blocked by routing rules.

If I have misunderstood your question, please forgive me.

Sorry, I guess I need a bit more info to help.

Regards,

Hugh Scott

Originally posted by cs423326
How to connect to real ip such as 202.28.94.10 from DCHP ip by use VB 6 .. I don't know about to use connection string ...
My PC is insatalled My SQL Server2000 and has ip 10.98.10.97 that is DHCP ip and another ones is installed the same but that it real ip. Both PC can't to see them together in network

This problem make my first PC can't access database to another one.
Help me plssss...|||Hi hmscott .
What is connection string in VB
My connection string to DHCP ip is "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=G7;Data Source=NUT"

when I will change Data Source from NUT to 10.98.10.97 (This is My DHCP Client IP) it work...
But when i change to Static ip (202.xxx.xxx.xxx) it does not work
How will i do??Please tell me about connection string that can be access to SQL Server..
thx|||Some things to test:

1. Can you Ping the static IP from your workstation (Ping 202.xxx.xxx.xxx).

If not, you need to see your network admin.

2. If you have query analyzer on your client, can you log in to the static IP server?

Again, iff not, you need to see your network admin.

HTH, my understanding gets much fuzzier once you get down to the network layer...

Regards,

Hugh Scott

Originally posted by cs423326
Hi hmscott .
What is connection string in VB
My connection string to DHCP ip is "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=G7;Data Source=NUT"

when I will change Data Source from NUT to 10.98.10.97 (This is My DHCP Client IP) it work...
But when i change to Static ip (202.xxx.xxx.xxx) it does not work
How will i do??Please tell me about connection string that can be access to SQL Server..
thx|||Hi again hmscott.
I ping the static ip from my PC is work..
and I can't use query analyzer log in to static ip server

..my PC (installed SQL Server 2000) and the static ip PC (installed the same) not in the same network ...then Both of them can't connect through SQL Tools.

How can I solve this problem??
and How can I code to connect them with VB?

Please help me again...
Thx.|||Perhaps it would help if you posted the actual error message text. I suggest that you try to set up a registration for the other machine in SQL Enterprise Manager and then copy the text of the error message and post it here|||thx MealinA

This is error message when I tried to Register with SQL Enterprise Manager:

xxx.xxx.xxx.xxx-Login fail for user 'userName'.Reason :Not Associated with a trusted SQL Server Connection;

and

and this is error message when i tried to create DSN :

Connection failed:
SQL State:'28000'
SQL Server Error:18452
[Microsoft][ODBC SQL Server Driver][SQL Server]Login fail for user 'user'.Reason :Not Associated with a trusted SQL Server Connection.

Help me plsss...|||See if you can connect with this connection string:

"Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Password=<sa password>;Initial Catalog=G7;Data Source=<ip address>"

If this connects OK then your problem is authentication. I can give you some advice if that is the case...|||Hi MealinA.
I tried to connect my SQL Server with a connection string :
"Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Password=<sa password>;Initial Catalog=G7;Data Source=<ip address>"

but is not work ...
Error :

Runtime error 'xxxxx'
[DBNETLIB][ConnectionOpen(Connect()).]SQL Server does not exist or access denied.

How can I solve that??|||did you replace <sa password> with the sa password for your server and <ip address> with the ip address for your server in the connection string before trying it?|||Yes I do,MealinA.
But It does not work..
and if I tried to connect with my user(created) it show the same result..|||On the server if you go (start->run) svrnetcn.exe and make sure only TCP/IP is listed under enabled protocols. Click on TCP/IP then Properties. The default port should be 1433 and the hide server box should be unchecked.

Also in SQL-EM on the server choose the local machine and then go (Tools->SQL Server Configuration Properties). Go to the Security tab and check that Authentication is set to SQL Server and Windows.

On the client go (start->run) cliconfg.exe and make sure that TCP/IP is the only (or at least the first) protocol listed. Click on TCP/IP then Properties. The default port should be 1433.

Tip: (This assumes you have MDAC 2.6 or higher on your CLIENT pc) Something I do is to use the Alias tab to set and alias for the server. Click Add, then enter MySQLServer in the Server alias box. Choose TCP/IP in the Network Libraries list. Under Connection parameters set Server name to <your server ip address> and check Dynamically determine port. Then use MySQLServer in the connection string. This means if the server ip address changes you can run cliconfg and change the alias without needing to change the connectiion string.

If this is all set up then there is no reason why the client should not connect to the server from SQL Server's perspective. If it still will not connect then I would suggest you carefully analyse your network configuration on the computers involved.

Friday, February 24, 2012

Connecting MSDE using ADO over TCPIP, XP

Gurus,
I've installed MSDE on an XP Professional server - to be used by the public
as part of a forum I'm building.
I can connect locally but fails when I connect locally using the option:
Network Library=dbmssocn
Please help me out here, I'm not a network/XP person and I'd like to get it
so that anyone can connect for testing and discussion purposes.
(I did manage to at least figure out how to enable connections to the web
server on the same machine where the forum is hosted but can't find any
switches for SQLServer..')
Mike Collier BSc( Hons) Comp Sci
Get a copy of AdoAnywhere Browser FREE if you register for the forum
quickly...
http://www.adoanywhere.com/forumCheck your NT Application Event log and verify that SQL Server is listening
on TCP.
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.|||Micke
1. Open up the Client Network Utility, located at:
c:\Windows\system32\cliconfg.exe
2. Click n the Alias Tab, make sure you add an Alias to access your MSDE
from either TCP/IP or Named Pipes.
We also use the same network library, and we have had to add the Name Pipes
Alias. This name can be any name you choose.
Peace in Christ
Marco Napoli
http://www.ourlovingmother.org
"Mike Collier" <mike@.adoanywhere.com> wrote in message
news:unqOqW52DHA.3224@.tk2msftngp13.phx.gbl...
quote:

> Gurus,
> I've installed MSDE on an XP Professional server - to be used by the
> public
> as part of a forum I'm building.
> I can connect locally but fails when I connect locally using the option:
> Network Library=dbmssocn
> Please help me out here, I'm not a network/XP person and I'd like to get
> it
> so that anyone can connect for testing and discussion purposes.
> (I did manage to at least figure out how to enable connections to the web
> server on the same machine where the forum is hosted but can't find any
> switches for SQLServer..')
> --
> Mike Collier BSc( Hons) Comp Sci
> Get a copy of AdoAnywhere Browser FREE if you register for the forum
> quickly...
> http://www.adoanywhere.com/forum
>
>

Sunday, February 12, 2012

Connect to SQL2000 & SQL 2005

Our current program use ADO to connect oto SQL2000 and run fine.
We are planning to migrate to SQL2005.
When we clean install the SQL2005, create the database, set compatibility
level to 80 and generate the db structure, and migrate data.
When everything is done, we try to use our program to connect to SQL2005
database and find the connection fail.
Even when we use sa as login user and still fail to connect.
Is there any different in connection for SQL2000 & SQL2005?
I remember I have tried upgrade SQL2000 to SQL2005 before and the connection
had no problem to sql2005.
Is there something I forgot to set?
KanAm Tue, 29 Aug 2006 17:38:51 +0800 schrieb Ivan:

> Our current program use ADO to connect oto SQL2000 and run fine.
> We are planning to migrate to SQL2005.
> When we clean install the SQL2005, create the database, set compatibility
> level to 80 and generate the db structure, and migrate data.
> When everything is done, we try to use our program to connect to SQL2005
> database and find the connection fail.
> Even when we use sa as login user and still fail to connect.
> Is there any different in connection for SQL2000 & SQL2005?
> I remember I have tried upgrade SQL2000 to SQL2005 before and the connecti
on
> had no problem to sql2005.
> Is there something I forgot to set?
> Kan
If you did a standard installation then SQL2005 uses the named instance
SQLExpress wich you have to use in your connect string.
If your SQL2005 runs on the same machine as your SQL2000 then maybe SQL2005
listen on another port than the standard port.
And have you allowed remote access in SQL2005?
bye, Helmut|||No, MDAC will work fine with the SQL Server 2005 instance. Although you
can=B4t use some of the new cool features its compatible. Which error do
you get ? Is the SQL Server 2k5 located on the same machine as the 2k
instance ?
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
--

connect to sql server via aps page ado :(

Microsoft OLE DB Provider for SQL Server error '80004005'

[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.

This the error message that i get when connect the sql server via asp page using ado.

the sql server is a default instance on a fail over cluster.

name pipes is enabled both on server network and at client network

any help.

--sanjayNormally, this occurs when you have not granted access to the iusr account that iis uses. Also, the following article list several other areas:

article (http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q306518&)

Let me know if you need further assistance.

Good luck.|||Originally posted by sanjay_kumar_r
Microsoft OLE DB Provider for SQL Server error '80004005'

[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.

This the error message that i get when connect the sql server via asp page using ado.

the sql server is a default instance on a fail over cluster.

name pipes is enabled both on server network and at client network

any help.

--sanjay

Guys,

I have this same problem...

Until yesterday averything is fine but since today I receive this error message.

Any help?

What does it means: "Normally, this occurs when you have not granted access to the iusr account that iis uses"?
I have just the "sa" usar in SQL...
What I need to check?|||I found the error.

My firewall blocked the dllhost.exe .
I give the permition and everything is fine again...