Showing posts with label vb6. Show all posts
Showing posts with label vb6. Show all posts

Sunday, March 25, 2012

Connet to SQL using VB6 forms via Internet

We have one system that is developed using Visual Basic 6. The system connects to MS SQL database using ODBC configuration. We have another branch that has to access the same database. We've got an Internet connection with a speed of 2MB, as we tried to connect using Virtual Private Network (VPN), but the problem we faced that the system became very slow over the Internet, its taking half an hour to open one form. Is there any way to connect to the database and via the Internet using VB6 Forms? Or its not useful as its not a web based tool.

Hi,

it′s hard for us to tell where the bottleneck in your application design is. But as of your description the application is not designed for slow connections to the database. To find out exactly what your problem is, you will either have to through the code to see which data is requested from the server, or let the profiler runn to see where the latency is based on.

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de

Sunday, March 11, 2012

Connection.CommandTimeout

Running VB6 with SQL Server 7, opening a connection and setting this
parameter by Conn.CommandTimeout does not always seem to force a
command (stored procedure) executed through Conn.Execute to timeout
after the specified period. Is anybody able to suggest what may be
going on here.

Thankspeter.dawson@.kingsch.nhs.uk (Petros) wrote in message news:<478ba33e.0309300533.2e31f9f7@.posting.google.com>...
> Running VB6 with SQL Server 7, opening a connection and setting this
> parameter by Conn.CommandTimeout does not always seem to force a
> command (stored procedure) executed through Conn.Execute to timeout
> after the specified period. Is anybody able to suggest what may be
> going on here.
> Thanks

CommandTimeout starts when the database server has accepted the
command and ends when the database server returns the first record. If
the server or network is busy (or not answering at all), this setting
won't help you to get control again.|||Petros (peter.dawson@.kingsch.nhs.uk) writes:
> Running VB6 with SQL Server 7, opening a connection and setting this
> parameter by Conn.CommandTimeout does not always seem to force a
> command (stored procedure) executed through Conn.Execute to timeout
> after the specified period. Is anybody able to suggest what may be
> going on here.

If you are also running queries from the command object, you need
to see the .CommandTimeout for that object too; the value is not
inherited from the connection object.

--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

Connection to SQL Server 2005 lost

We have developed a VB6 client program accsessing SQL Sever 7.0 via ADO
(Provider=sqloledb) and MDAC 2.8. This program has worked flawlessly for
years, but after upgrading to SQL Server 2005, the database connection is
sometimes lost during larger operation involving open/close of several
recordsets. The general error message says:
“[DBNETLIB][ConnectionOpen,Connect()).]SQL Server does not exsist or access
denied". "Simpler" parts of the program involving just a recordset or two
always work fine. Any idea of what is going on here?
Have you tried using the SQL Native Client (SNAC) instead to see if that
makes a difference?
http://msdn2.microsoft.com/en-us/data/aa937733.aspx
Andrew J. Kelly SQL MVP
Solid Quality Mentors
"Glenn Handeland" <Glenn Handeland@.discussions.microsoft.com> wrote in
message news:9A2E8820-DEFC-4209-B019-8A0996CF7FDF@.microsoft.com...
> We have developed a VB6 client program accsessing SQL Sever 7.0 via ADO
> (Provider=sqloledb) and MDAC 2.8. This program has worked flawlessly for
> years, but after upgrading to SQL Server 2005, the database connection is
> sometimes lost during larger operation involving open/close of several
> recordsets. The general error message says:
> “[DBNETLIB][ConnectionOpen,Connect()).]SQL Server does not exsist or
> access
> denied". "Simpler" parts of the program involving just a recordset or two
> always work fine. Any idea of what is going on here?
|||Thank you for the suggestion.
We have not tried the native client, because the FAQ says:
Q. Must I upgrade clients to use SQL Native Client as soon as I upgrade my
server?
A. Applications deployed before SQL Server 2005 was released can and should
continue to use MDAC.
Most likely it is a server configuration problem. Our program is used by
many clients, accessing the datebase from different computers/configurations,
and all of them experience this error message when conneting to a given SQL
Server 2005 Server. Some of our clients from other firms also have their own
SQL Server 2005 running, and they have successfully managed to connect to
their database using MDAC and never experience this error message.
"Andrew J. Kelly" wrote:

> Have you tried using the SQL Native Client (SNAC) instead to see if that
> makes a difference?
> http://msdn2.microsoft.com/en-us/data/aa937733.aspx
>
> --
> Andrew J. Kelly SQL MVP
> Solid Quality Mentors
>
> "Glenn Handeland" <Glenn Handeland@.discussions.microsoft.com> wrote in
> message news:9A2E8820-DEFC-4209-B019-8A0996CF7FDF@.microsoft.com...
>
|||Sorry I don't have another answer for you. I have not heard of or seen this
particular issue before.
Andrew J. Kelly SQL MVP
Solid Quality Mentors
"Glenn Handeland" <GlennHandeland@.discussions.microsoft.com> wrote in
message news:C425386F-DA1A-4D79-AEFB-AE29F7AC6606@.microsoft.com...[vbcol=seagreen]
> Thank you for the suggestion.
> We have not tried the native client, because the FAQ says:
> Q. Must I upgrade clients to use SQL Native Client as soon as I upgrade my
> server?
> A. Applications deployed before SQL Server 2005 was released can and
> should
> continue to use MDAC.
> Most likely it is a server configuration problem. Our program is used by
> many clients, accessing the datebase from different
> computers/configurations,
> and all of them experience this error message when conneting to a given
> SQL
> Server 2005 Server. Some of our clients from other firms also have their
> own
> SQL Server 2005 running, and they have successfully managed to connect to
> their database using MDAC and never experience this error message.
>
> "Andrew J. Kelly" wrote:
|||Ah, I would STILL upgrade to SNAC. I agree that if the application is
working and deployed it should not be disturbed, but yours is not working
and SNAC solves any number of issues like this.
__________________________________________________ ________________________
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)
__________________________________________________ __________________________________________
"Glenn Handeland" <GlennHandeland@.discussions.microsoft.com> wrote in
message news:C425386F-DA1A-4D79-AEFB-AE29F7AC6606@.microsoft.com...[vbcol=seagreen]
> Thank you for the suggestion.
> We have not tried the native client, because the FAQ says:
> Q. Must I upgrade clients to use SQL Native Client as soon as I upgrade my
> server?
> A. Applications deployed before SQL Server 2005 was released can and
> should
> continue to use MDAC.
> Most likely it is a server configuration problem. Our program is used by
> many clients, accessing the datebase from different
> computers/configurations,
> and all of them experience this error message when conneting to a given
> SQL
> Server 2005 Server. Some of our clients from other firms also have their
> own
> SQL Server 2005 running, and they have successfully managed to connect to
> their database using MDAC and never experience this error message.
>
> "Andrew J. Kelly" wrote:
|||We upgraded to SNAC, but still experience the very same error. The text of
the error message reported is a little bit different, thought. It now says
"Named Pipes Provider: No process is on the other end of the pipe." We did
get rid of the error message when we changed the recordsets cursor from
server-side to client-side (CursorLocation = adUseClient).
"William Vaughn" wrote:

> Ah, I would STILL upgrade to SNAC. I agree that if the application is
> working and deployed it should not be disturbed, but yours is not working
> and SNAC solves any number of issues like this.
> --
> __________________________________________________ ________________________
> 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)
> __________________________________________________ __________________________________________
> "Glenn Handeland" <GlennHandeland@.discussions.microsoft.com> wrote in
> message news:C425386F-DA1A-4D79-AEFB-AE29F7AC6606@.microsoft.com...
>
|||You are putting less work on the SQL Server by doing that and is generally a
good idea anyway. But you should also think about changing to TCP instead of
using named pipes.
Andrew J. Kelly SQL MVP
Solid Quality Mentors
"Glenn Handeland" <GlennHandeland@.discussions.microsoft.com> wrote in
message news:530FDB75-0B6B-46E3-A9CA-FFD3E2B3F75F@.microsoft.com...[vbcol=seagreen]
> We upgraded to SNAC, but still experience the very same error. The text of
> the error message reported is a little bit different, thought. It now says
> "Named Pipes Provider: No process is on the other end of the pipe." We did
> get rid of the error message when we changed the recordsets cursor from
> server-side to client-side (CursorLocation = adUseClient).
>
> "William Vaughn" wrote:
|||It sounds like the server is rejecting the Open. Make sure that the server
configuration is not limiting the total number of connections in any way.
These might have been configured to comply with license or other artifical
constraints.
__________________________________________________ ________________________
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)
__________________________________________________ __________________________________________
"Glenn Handeland" <GlennHandeland@.discussions.microsoft.com> wrote in
message news:530FDB75-0B6B-46E3-A9CA-FFD3E2B3F75F@.microsoft.com...[vbcol=seagreen]
> We upgraded to SNAC, but still experience the very same error. The text of
> the error message reported is a little bit different, thought. It now says
> "Named Pipes Provider: No process is on the other end of the pipe." We did
> get rid of the error message when we changed the recordsets cursor from
> server-side to client-side (CursorLocation = adUseClient).
>
> "William Vaughn" wrote:

Connection to SQL Server 2005 lost

We have developed a VB6 client program accsessing SQL Sever 7.0 via ADO
(Provider=sqloledb) and MDAC 2.8. This program has worked flawlessly for
years, but after upgrading to SQL Server 2005, the database connection is
sometimes lost during larger operation involving open/close of several
recordsets. The general error message says:
“[DBNETLIB][ConnectionOpen,Connect()).]SQL Server does not exsist
or access
denied". "Simpler" parts of the program involving just a recordset or two
always work fine. Any idea of what is going on here?Have you tried using the SQL Native Client (SNAC) instead to see if that
makes a difference?
http://msdn2.microsoft.com/en-us/data/aa937733.aspx
Andrew J. Kelly SQL MVP
Solid Quality Mentors
"Glenn Handeland" <Glenn Handeland@.discussions.microsoft.com> wrote in
message news:9A2E8820-DEFC-4209-B019-8A0996CF7FDF@.microsoft.com...
> We have developed a VB6 client program accsessing SQL Sever 7.0 via ADO
> (Provider=sqloledb) and MDAC 2.8. This program has worked flawlessly for
> years, but after upgrading to SQL Server 2005, the database connection is
> sometimes lost during larger operation involving open/close of several
> recordsets. The general error message says:
> “[DBNETLIB][ConnectionOpen,Connect()).]SQL Server does not exsis
t or
> access
> denied". "Simpler" parts of the program involving just a recordset or two
> always work fine. Any idea of what is going on here?|||Thank you for the suggestion.
We have not tried the native client, because the FAQ says:
Q. Must I upgrade clients to use SQL Native Client as soon as I upgrade my
server?
A. Applications deployed before SQL Server 2005 was released can and should
continue to use MDAC.
Most likely it is a server configuration problem. Our program is used by
many clients, accessing the datebase from different computers/configurations
,
and all of them experience this error message when conneting to a given SQL
Server 2005 Server. Some of our clients from other firms also have their own
SQL Server 2005 running, and they have successfully managed to connect to
their database using MDAC and never experience this error message.
"Andrew J. Kelly" wrote:

> Have you tried using the SQL Native Client (SNAC) instead to see if that
> makes a difference?
> http://msdn2.microsoft.com/en-us/data/aa937733.aspx
>
> --
> Andrew J. Kelly SQL MVP
> Solid Quality Mentors
>
> "Glenn Handeland" <Glenn Handeland@.discussions.microsoft.com> wrote in
> message news:9A2E8820-DEFC-4209-B019-8A0996CF7FDF@.microsoft.com...
>|||Sorry I don't have another answer for you. I have not heard of or seen this
particular issue before.
Andrew J. Kelly SQL MVP
Solid Quality Mentors
"Glenn Handeland" <GlennHandeland@.discussions.microsoft.com> wrote in
message news:C425386F-DA1A-4D79-AEFB-AE29F7AC6606@.microsoft.com...[vbcol=seagreen]
> Thank you for the suggestion.
> We have not tried the native client, because the FAQ says:
> Q. Must I upgrade clients to use SQL Native Client as soon as I upgrade my
> server?
> A. Applications deployed before SQL Server 2005 was released can and
> should
> continue to use MDAC.
> Most likely it is a server configuration problem. Our program is used by
> many clients, accessing the datebase from different
> computers/configurations,
> and all of them experience this error message when conneting to a given
> SQL
> Server 2005 Server. Some of our clients from other firms also have their
> own
> SQL Server 2005 running, and they have successfully managed to connect to
> their database using MDAC and never experience this error message.
>
> "Andrew J. Kelly" wrote:
>|||Ah, I would STILL upgrade to SNAC. I agree that if the application is
working and deployed it should not be disturbed, but yours is not working
and SNAC solves any number of issues like this.
________________________________________
__________________________________
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)
________________________________________
____________________________________
________________
"Glenn Handeland" <GlennHandeland@.discussions.microsoft.com> wrote in
message news:C425386F-DA1A-4D79-AEFB-AE29F7AC6606@.microsoft.com...[vbcol=seagreen]
> Thank you for the suggestion.
> We have not tried the native client, because the FAQ says:
> Q. Must I upgrade clients to use SQL Native Client as soon as I upgrade my
> server?
> A. Applications deployed before SQL Server 2005 was released can and
> should
> continue to use MDAC.
> Most likely it is a server configuration problem. Our program is used by
> many clients, accessing the datebase from different
> computers/configurations,
> and all of them experience this error message when conneting to a given
> SQL
> Server 2005 Server. Some of our clients from other firms also have their
> own
> SQL Server 2005 running, and they have successfully managed to connect to
> their database using MDAC and never experience this error message.
>
> "Andrew J. Kelly" wrote:
>

Saturday, February 25, 2012

Connection string with sa password

My application designed with VB6.0 is connected to MS SQL Server 7.0.
Server has password for sa login. The VB code for connection is next:
Dim Conn As ADODB.Connection
Set Conn = New ADODB.Connection
Conn.ConnectionTimeout = 30
Conn.ConnectionString = Provider=SQLOLEDB.1;Persist Security
Info=False;User ID=sa;Initial Catalog=master;Data
Source=server;Password=mypassword;
Conn.Open
Connection performs successfully but after that Conn.ConnectionStrring
value has changed and equals
Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial
Catalog=master;Data Source=retiv;Use Procedure for Prepare=1;Auto
Translate=True;Packet Size=4096;Workstation ID=USER;Use Encryption for
Data=False;Tag with column collation when possible=False
There is no any information about sa password which is not blank.
Connection object Conn is a global object in my application which is
used after, so I get a error
Login failed for user sa
How can I save my sa password in connection string?First of all, you shouldn't be using 'sa' to connect to SQL Server, from
your applications. This is a security threat, as 'sa' happens to be a
powerful login.
Then, you should be either using a DSN, or store your connection string
somewhere (Global.asa may be?), so that it is there at a specific location,
and that it never changes.
--
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
"Vadim Bulat" <bulat@.asuxxivek.spb.ru> wrote in message
news:7e1d1f98.0407150731.78249213@.posting.google.com...
> My application designed with VB6.0 is connected to MS SQL Server 7.0.
> Server has password for sa login. The VB code for connection is next:
> Dim Conn As ADODB.Connection
> Set Conn = New ADODB.Connection
> Conn.ConnectionTimeout = 30
> Conn.ConnectionString = Provider=SQLOLEDB.1;Persist Security
> Info=False;User ID=sa;Initial Catalog=master;Data
> Source=server;Password=mypassword;
> Conn.Open
> Connection performs successfully but after that Conn.ConnectionStrring
> value has changed and equals
> Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial
> Catalog=master;Data Source=retiv;Use Procedure for Prepare=1;Auto
> Translate=True;Packet Size=4096;Workstation ID=USER;Use Encryption for
> Data=False;Tag with column collation when possible=False
> There is no any information about sa password which is not blank.
> Connection object Conn is a global object in my application which is
> used after, so I get a error
> Login failed for user sa
> How can I save my sa password in connection string?

Connection string with sa password

My application designed with VB6.0 is connected to MS SQL Server 7.0.
Server has password for sa login. The VB code for connection is next:
Dim Conn As ADODB.Connection
Set Conn = New ADODB.Connection
Conn.ConnectionTimeout = 30
Conn.ConnectionString = Provider=SQLOLEDB.1;Persist Security
Info=False;User ID=sa;Initial Catalog=master;Data
Source=server;Password=mypassword;
Conn.Open
Connection performs successfully but after that Conn.ConnectionStrring
value has changed and equals
Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial
Catalog=master;Data Source=retiv;Use Procedure for Prepare=1;Auto
Translate=True;Packet Size=4096;Workstation ID=USER;Use Encryption for
Data=False;Tag with column collation when possible=False
There is no any information about sa password which is not blank.
Connection object Conn is a global object in my application which is
used after, so I get a error
Login failed for user sa
How can I save my sa password in connection string?
First of all, you shouldn't be using 'sa' to connect to SQL Server, from
your applications. This is a security threat, as 'sa' happens to be a
powerful login.
Then, you should be either using a DSN, or store your connection string
somewhere (Global.asa may be?), so that it is there at a specific location,
and that it never changes.
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
"Vadim Bulat" <bulat@.asuxxivek.spb.ru> wrote in message
news:7e1d1f98.0407150731.78249213@.posting.google.c om...
> My application designed with VB6.0 is connected to MS SQL Server 7.0.
> Server has password for sa login. The VB code for connection is next:
> Dim Conn As ADODB.Connection
> Set Conn = New ADODB.Connection
> Conn.ConnectionTimeout = 30
> Conn.ConnectionString = Provider=SQLOLEDB.1;Persist Security
> Info=False;User ID=sa;Initial Catalog=master;Data
> Source=server;Password=mypassword;
> Conn.Open
> Connection performs successfully but after that Conn.ConnectionStrring
> value has changed and equals
> Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial
> Catalog=master;Data Source=retiv;Use Procedure for Prepare=1;Auto
> Translate=True;Packet Size=4096;Workstation ID=USER;Use Encryption for
> Data=False;Tag with column collation when possible=False
> There is no any information about sa password which is not blank.
> Connection object Conn is a global object in my application which is
> used after, so I get a error
> Login failed for user sa
> How can I save my sa password in connection string?

Sunday, February 19, 2012

connection string & location problems

In a VB6 app, I am using the following connection string to connect with a SQL Server 2005 database:

strDbConn = "Provider=SQLOLEDB;Integrated Security=SSPI;" & _
"Persist Security Info=False;Database=" & strDbName & ";" & _
"AttachDBFileName=" & DbPath & ";" 'Data Source=.\mssqlserver;"

I am getting the following error message:

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

All help appreciated.

Did you try to replace "." with the machine name?|||

I could do that but I shouldn't have to: at least not according to ms documentation. Besides, it doesn't help.

The following connection string for sqlexpress also works in the development subdirectory but nowhere else:

strDbConn = "Provider=SQLNCLI;Integrated Security=SSPI;" & _
"Persist Security Info=False;Database=" & strDbName & ";" & _
"AttachDBFileName=" & DbPath & ";Data Source=.\sqlexpress;" & _
"User Instance=True"

In any other directory, it gives the error:

Invalid connection string attribute

Obviously, that can't be true because it works in that one directory. It has something to do with the location.

After more than two weeks of seeking answers, I can only access databases that are in a development subdirectory, but the minute I try to deploy an app - sql server 2005 is lost.

Doesn't anybody have any idea what causes this?

|||

rwbogosian wrote:

In a VB6 app, I am using the following connection string to connect with a SQL Server 2005 database:

strDbConn = "Provider=SQLOLEDB;Integrated Security=SSPI;" & _
"Persist Security Info=False;Database=" & strDbName & ";" & _
"AttachDBFileName=" & DbPath & ";" 'Data Source=.\mssqlserver;"

I am getting the following error message:

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

All help appreciated.

hi rwbogosian,

You're trying to access sql server using the SQLOLEDB provider, just change the provider to the Sql Client : SQLNCLI.1
Is the (.\mssqlserver) instance existing? From your connectionstring it seems you want to connect to the local server with an instance name=MSSQLSERVER. You can substitute the dot(.) with <SERVERNAME>\<INSTANCENAME> or if it is using the default instance use the syntax <SERVERNAME>.

HTH,|||

Isn't SQLNCLI for sqlexpress? I've found sqlexpress far too troublesome to be useful and do not wish to use it. The server MSSQLSERVER does indeed exist. I have tried the connection string with the servername; it didn't help. Also, the software will be deployed to another computer(s) and it would not be practical to hardcode the servername. Thanks anyway.

I've resolved the problem by first creating a connection to master, then using sp_attach_single_file_db, then closing the connection, and finally, opening a new connection that attaches to the database.

|||

SQLNCLI is the Bative Client for SQLServer which ships with the Native Client from SQL Server. You can still use the SQLOLEDB Provider, to support features at SQL 2k level, but you wont get any feature at SQL2k5 level. THe SQLNCLI isn′t only for SQL Server Express, its the new SQL Native Client library which was divided form MDAC.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

Tuesday, February 14, 2012

connection string

In a VB6 app, I am using the following connection string to connect with a SQL Server 2005 database:

strDbConn = "Provider=SQLOLEDB;Integrated Security=SSPI;" & _
"Persist Security Info=False;Database=" & strDbName & ";" & _
"AttachDBFileName=" & DbPath & ";" 'Data Source=.\mssqlserver;"

I am getting the following error message:

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

All help appreciated.

Did you try to replace "." with the machine name?|||

I could do that but I shouldn't have to: at least not according to ms documentation. Besides, it doesn't help.

The following connection string for sqlexpress also works in the development subdirectory but nowhere else:

strDbConn = "Provider=SQLNCLI;Integrated Security=SSPI;" & _
"Persist Security Info=False;Database=" & strDbName & ";" & _
"AttachDBFileName=" & DbPath & ";Data Source=.\sqlexpress;" & _
"User Instance=True"

In any other directory, it gives the error:

Invalid connection string attribute

Obviously, that can't be true because it works in that one directory. It has something to do with the location.

After more than two weeks of seeking answers, I can only access databases that are in a development subdirectory, but the minute I try to deploy an app - sql server 2005 is lost.

Doesn't anybody have any idea what causes this?

|||

rwbogosian wrote:

In a VB6 app, I am using the following connection string to connect with a SQL Server 2005 database:

strDbConn = "Provider=SQLOLEDB;Integrated Security=SSPI;" & _
"Persist Security Info=False;Database=" & strDbName & ";" & _
"AttachDBFileName=" & DbPath & ";" 'Data Source=.\mssqlserver;"

I am getting the following error message:

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

All help appreciated.

hi rwbogosian,

You're trying to access sql server using the SQLOLEDB provider, just change the provider to the Sql Client : SQLNCLI.1
Is the (.\mssqlserver) instance existing? From your connectionstring it seems you want to connect to the local server with an instance name=MSSQLSERVER. You can substitute the dot(.) with <SERVERNAME>\<INSTANCENAME> or if it is using the default instance use the syntax <SERVERNAME>.

HTH,|||

Isn't SQLNCLI for sqlexpress? I've found sqlexpress far too troublesome to be useful and do not wish to use it. The server MSSQLSERVER does indeed exist. I have tried the connection string with the servername; it didn't help. Also, the software will be deployed to another computer(s) and it would not be practical to hardcode the servername. Thanks anyway.

I've resolved the problem by first creating a connection to master, then using sp_attach_single_file_db, then closing the connection, and finally, opening a new connection that attaches to the database.

|||

SQLNCLI is the Bative Client for SQLServer which ships with the Native Client from SQL Server. You can still use the SQLOLEDB Provider, to support features at SQL 2k level, but you wont get any feature at SQL2k5 level. THe SQLNCLI isn′t only for SQL Server Express, its the new SQL Native Client library which was divided form MDAC.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de