Showing posts with label connections. Show all posts
Showing posts with label connections. Show all posts

Wednesday, March 28, 2012

Problems with SQL Server connection string

I am slightly confused about SQL Server connections strings. When I used the following connection string:

string strConn = "server=decius\awa;database=xxxx;uid=xxxx;pwd=xxxx";

I get an error saying "Format of the initialization string does not conform to specification starting at index 13. "

I spent ages trying to figure out why this was and I eventually discovered that adding an "@." symbol before the string fixed it, i.e.

string strConn = @."server=decius\awa;database=xxxx;uid=xxxx;pwd=xxxx";

Most of the examples I have seen to not use the "@." symbol so I am just wondering what is does and when you need to use it?

Thanks,

Mark

The @. fixed your problem because it designates a literal string. Basically, when the processor sees @. before the string it knows to ignore all special characters within that string that would otherwise need to be used with an escape character. In C#, the '\' is an escape character that means 'do not read the following character as a special character. It would be used like so:

string path = "files\\filename.doc";

That will read to the processor as 'files\filename.doc";

As you've found out, you can also use the @. for the same result. These next 2 strings will have the same output:

string path = "files\\filename.doc";

string path = @."files\filename.doc";

...Hope that helps.

|||

Thanks Stew, that's great.

Mark

sql

Friday, March 23, 2012

Problems with remote connections to Express

Hi,

I'm having problems getting a remote connection to sql server express.

The application connects fine on the local PC (using SQL server authentication), however a networked laptop cannot connect to sql.

The PC/Laptop have been networked using the network wizard, and files on the PC are accesible from the laptop.

tcp/ip is enabled on express and the browser service is running. All firewalls have been switched off.

Any ideas?

pse post back the error no and description you gets. Also post back the connection string

Madhu

|||

Hi

Have a look at this post, it may be useful.

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1576999&SiteID=1

Tailor

|||Thanks both, the problem I have is that it's one of my users having the problem & I'm having trouble replicating it here. The port stuff sounds interesting & I'll have a play with that & report back.

Problems with remote connections to Express

Hi,

I'm having problems getting a remote connection to sql server express.

The application connects fine on the local PC (using SQL server authentication), however a networked laptop cannot connect to sql.

The PC/Laptop have been networked using the network wizard, and files on the PC are accesible from the laptop.

tcp/ip is enabled on express and the browser service is running. All firewalls have been switched off.

Any ideas?

pse post back the error no and description you gets. Also post back the connection string

Madhu

|||

Hi

Have a look at this post, it may be useful.

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1576999&SiteID=1

Tailor

|||Thanks both, the problem I have is that it's one of my users having the problem & I'm having trouble replicating it here. The port stuff sounds interesting & I'll have a play with that & report back.

Wednesday, March 21, 2012

Problems With OLE DB Command Transformer

I am trying to use the OLE DB Command Transformation to update rows in my table. When I make the connections and select the connectionmanager I get the following error:


Error at Data Flow Task [OLE DB Command [6624]]: An OLE DB error has occurred. Error code: 0x80040E0C.
An OLE DB record is available. Source: "Microsoft SQL Native Client" Hresult: 0x80040E0C Description: "Command text was not set for the command object.".

I cannot figure out what to do. The connection is valid. I have used it in many places in the data stream. I also see that there are no output columns available for mapping. I didn't see a place to select the table.

Can anyone please help.

Thanks,

Lee


Make sure you are setting the SQLCommand property (on the Component Properties tab) with your UPDATE statement.|||Thanks. One more question - Do you have to use ? (i.e. scope = ?) for the parameters in the SQL statement or can you use something that is more meaningful?|||With most OLE DB drivers, you do need to use ?. That is the way the drivers expect to see parameter placeholders.

Wednesday, March 7, 2012

Problems With Client Connections

I will try to keep this as concise as possible. I am trying to set up a new
SQL Server 2005 Express server.
The OS is Windows XP Pro SP2. SQL Express is SP2.
I am able to connect to the instance locally through shared memory. I am
also able to connect to the instance locally with TCP by selecting browsing
and the network tab.
I have been able to connect through ODBC from one client desktop through MS
Access.
I am unable to establish a connection from any other client. They are all
on the same subnet. I have tried updating the driver to SQL Native Client
but still cannot connect. I receive the very long error message that
essentially states that it doesn't exist or I do not have permission to it.
I hope that this will be enough information for someone to make some
suggestions.
Thanks in advance for reading this post.
Bill
Perhaps these articles will help:
Configuration -Configure SQL Server 2005 to allow remote connections
http://support.microsoft.com/default.aspx?scid=kb;EN-US;914277
Configuration -Connect to SQL Express from "downlevel clients"
http://blogs.msdn.com/sqlexpress/archive/2004/07/23/192044.aspx
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
You can't help someone get up a hill without getting a little closer to the
top yourself.
- H. Norman Schwarzkopf
"William Downey" <wdowney@.mclean.harvard.edu> wrote in message
news:%23emSqz9FHHA.4588@.TK2MSFTNGP05.phx.gbl...
>I will try to keep this as concise as possible. I am trying to set up a
>new SQL Server 2005 Express server.
> The OS is Windows XP Pro SP2. SQL Express is SP2.
> I am able to connect to the instance locally through shared memory. I am
> also able to connect to the instance locally with TCP by selecting
> browsing and the network tab.
> I have been able to connect through ODBC from one client desktop through
> MS Access.
> I am unable to establish a connection from any other client. They are all
> on the same subnet. I have tried updating the driver to SQL Native Client
> but still cannot connect. I receive the very long error message that
> essentially states that it doesn't exist or I do not have permission to
> it.
> I hope that this will be enough information for someone to make some
> suggestions.
> Thanks in advance for reading this post.
> Bill
>
|||Thanks for the article links.
Unfortunately, it seems I have tried nearly everything I can think of to get
clients to access the instance.
I did notice a previous thread that mentioned a similar issue.
The troubleshooting path I am headed down now is one of network-related
issues.
I wonder if anyone has had similar connectivity issues and had to tweak lan
settings?
Bill Downey
"Arnie Rowland" <arnie@.1568.com> wrote in message
news:%237eThA%23FHHA.4652@.TK2MSFTNGP04.phx.gbl...
> Perhaps these articles will help:
> Configuration -Configure SQL Server 2005 to allow remote connections
> http://support.microsoft.com/default.aspx?scid=kb;EN-US;914277
> Configuration -Connect to SQL Express from "downlevel clients"
> http://blogs.msdn.com/sqlexpress/archive/2004/07/23/192044.aspx
>
> --
> Arnie Rowland, Ph.D.
> Westwood Consulting, Inc
> Most good judgment comes from experience.
> Most experience comes from bad judgment.
> - Anonymous
> You can't help someone get up a hill without getting a little closer to
> the top yourself.
> - H. Norman Schwarzkopf
>
> "William Downey" <wdowney@.mclean.harvard.edu> wrote in message
> news:%23emSqz9FHHA.4588@.TK2MSFTNGP05.phx.gbl...
>
|||You need to enable SQL Browser service (automatic), else the clients do
not know which dynamic TCP-port the should connect to. SQL Browser (UDP
1434) helps with this.
Default instance uses TCP 1433, which works without SQL Browser, but
all instances need SQL Browser.
In the SQL Area configuration guide, I think it should ask if you want
to start SQL Browser when you enable TCP-connections on an instance
other than default instance.
Best regards
Niklas Engfelt
William Downey skrev:
[vbcol=seagreen]
> Thanks for the article links.
> Unfortunately, it seems I have tried nearly everything I can think of to get
> clients to access the instance.
> I did notice a previous thread that mentioned a similar issue.
> The troubleshooting path I am headed down now is one of network-related
> issues.
> I wonder if anyone has had similar connectivity issues and had to tweak lan
> settings?
> Bill Downey
> "Arnie Rowland" <arnie@.1568.com> wrote in message
> news:%237eThA%23FHHA.4652@.TK2MSFTNGP04.phx.gbl...
|||I dont know if it is the same situation but I am having a problem with native
clients also... Essentiallly I CAN NOT INSTALLED SQL Express 2005 because I
keep getting an error almost at the end of the installation that read like
this: "[Microsoft][SQL Native Client]SSL Provider: The certificate's CN name
does not match the passed value" I have no idea what to do. I am practically
new to this. I just wanted to install SQL to follow up with the Visual Studio
C# lessons I am taking. I am stuck in chapter 8 because I need to install SQL
in order to follow up with the lessons and I can not do it... HELP!!!! Can
someone out there tell me what I need to do to install this package? (SQL
Express 2005). I would appreciate if beside posting something that person
would email me at waltersantiago@.msn.com. I just found this group while
looking for answers to my problem and I am afraid I may not get to see the
responses, if any, to my plight... Again... I just want to be able to install
the product. The above mentioned error stop me every time... I cleaned up and
uninstalled both automatically (with the program the SQL people provide) and
manually (by following their instructions) everything they asked to be
uninstalled before trying an installation. I still get the error... What is
CN? and where is lookling for the certificate? Do I need to delete or create
a especial certificate in order to install this product? If yes then how?
Anyway any help would be greatly appreciated. I would like to keep my journey
into becoming a Visual Studio C# programmer. THanks
"William Downey" wrote:

> I will try to keep this as concise as possible. I am trying to set up a new
> SQL Server 2005 Express server.
> The OS is Windows XP Pro SP2. SQL Express is SP2.
> I am able to connect to the instance locally through shared memory. I am
> also able to connect to the instance locally with TCP by selecting browsing
> and the network tab.
> I have been able to connect through ODBC from one client desktop through MS
> Access.
> I am unable to establish a connection from any other client. They are all
> on the same subnet. I have tried updating the driver to SQL Native Client
> but still cannot connect. I receive the very long error message that
> essentially states that it doesn't exist or I do not have permission to it.
> I hope that this will be enough information for someone to make some
> suggestions.
> Thanks in advance for reading this post.
> Bill
>
>
|||I've been having similar issues with regards to connectiong to SQL Server
Express Edition. I've installed it at several locatoins with little to no
problems. But, at a current client site things are not working as they have
at other client sites, which has really frustrated me.
I've made a post in SQL Server Access ADP regarding my problem, but have
decided to search a little more for a solution. My SQL Express has SQL
Browser Started. Initally, my Access application was not able to list my
databases for my server, but after Starting my SQL Browser my application now
lists the databases on my Server, but does not allow my client to connect to
the database. This same client application is installed on the server and
loads just fine, so I kinow my logon credentials are all correct.
Your comments regarding Port 1433. Is this a port that is commonly blocked
by firewalls? If so, could this be causeing a problem with me connecting? I
have little knowledge of TCP/IP and Ports, so I do not know where to work on
this items.
I understand SQL Server and Development against it but am finding connecting
to it to be very frustrating as I'm at the point I have no clue as to what
trouble-shooting to do. Most posts I've ready make it sound like it should be
simple, but I'm still missing something.
So, In my situation, my application can "see" the Server as it lists all of
my current databases, but when I attempt to log on using SQL Authentication
it fails. I'm using Mixes Mode (Win/SQL). And, the SQL Login works fine on my
Server. What has me puzzled is that my application sees all my databases but
will no accept logon credentials that work on my Server at my Client PC.
I'm very frustated. Any suggestions on how I can do further troubleshooting.
This just seems way more complicated that Microsoft claimed when I switched
from Access to SQL Server.
Thanks, Greg
"engfelt@.gmail.com" wrote:

> You need to enable SQL Browser service (automatic), else the clients do
> not know which dynamic TCP-port the should connect to. SQL Browser (UDP
> 1434) helps with this.
> Default instance uses TCP 1433, which works without SQL Browser, but
> all instances need SQL Browser.
> In the SQL Area configuration guide, I think it should ask if you want
> to start SQL Browser when you enable TCP-connections on an instance
> other than default instance.
> Best regards
> Niklas Engfelt
>
> William Downey skrev:
>
>

Saturday, February 25, 2012

Problems with "Local connections only"

Hello,
Our application is running very slow, we have an application installed
on (XP professional or Windows 2003) running SQL Server 2005 or
SQLExpress on the same pc.
We have realized that if we change "Local connections only" for "Local
and remote connections", our application (VB6) runs much faster
(Normally I'd say).
We need to run our application in the same computer where the server
is running with "Local connections only".
Can anyone help to us?
Thanks,
Laslo
Let's see your ConnectString.
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
------
"lalo_losla" <lalo_losla@.hotmail.com> wrote in message
news:1182795665.411020.31170@.c77g2000hse.googlegro ups.com...
> Hello,
> Our application is running very slow, we have an application installed
> on (XP professional or Windows 2003) running SQL Server 2005 or
> SQLExpress on the same pc.
> We have realized that if we change "Local connections only" for "Local
> and remote connections", our application (VB6) runs much faster
> (Normally I'd say).
> We need to run our application in the same computer where the server
> is running with "Local connections only".
> Can anyone help to us?
> Thanks,
> Laslo
>
|||Conn As ADODB.Connection
Conn.Open ODBCName, Login, Pwd

Problems with "Local connections only"

Hello,
Our application is running very slow, we have an application installed
on (XP professional or Windows 2003) running SQL Server 2005 or
SQLExpress on the same pc.
We have realized that if we change "Local connections only" for "Local
and remote connections", our application (VB6) runs much faster
(Normally I'd say).
We need to run our application in the same computer where the server
is running with "Local connections only".
Can anyone help to us?
Thanks,
LasloLet's see your ConnectString.
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
----
---
"lalo_losla" <lalo_losla@.hotmail.com> wrote in message
news:1182795665.411020.31170@.c77g2000hse.googlegroups.com...
> Hello,
> Our application is running very slow, we have an application installed
> on (XP professional or Windows 2003) running SQL Server 2005 or
> SQLExpress on the same pc.
> We have realized that if we change "Local connections only" for "Local
> and remote connections", our application (VB6) runs much faster
> (Normally I'd say).
> We need to run our application in the same computer where the server
> is running with "Local connections only".
> Can anyone help to us?
> Thanks,
> Laslo
>|||Conn As ADODB.Connection
Conn.Open ODBCName, Login, Pwd