Showing posts with label local. Show all posts
Showing posts with label local. Show all posts

Thursday, March 22, 2012

ASP AND SQL SERVER 2005

i cannot connect to my local server.my code is

<%
ad=request.form("ad")
soyad=request.form("soyad")
email=request.form("email")
dim conn
set conn=CreateObject("ADODB.Connection")
conn.open "Server=./SQLEXPRESS;Database=NEWSWORLD;Trusted_Connection=True;"
sqlifadesi="insert into user_info(ad,soyad,email) values('"&ad&"','"&soyad&"','"&email&"')"
conn.execute(sqlifadesi)
conn.close
set conn=nothing
response.write "bilgileriniz kayit edildi,Ilginiz i?in tesekkür ederiz"
%>

it shows error page in

conn.open "Server=./SQLEXPRESS;Database=NEWSWORLD;Trusted_Connection=True;"

i dont use native client because i dont use .net i want to make a connection to sql server 2005 with classic ASP.

Thanks for replies

Hi Ibrahim,

which error are you getting ?

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de|||

thnx for reply Jens Suessmeyer

when i use this code i get this error .... Microsoft OLE DB Service Components (0x80040E21) Work isnt done

<%

ad=request.form("ad")

soyad=request.form("soyad")

email=request.form("email")

dim conn

set conn=CreateObject("ADODB.Connection")

conn.open "data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|NEWSWORLD.mdf;User Instance=true"

sqlifadesi="insert into user_info(ad,soyad,email) values('"&ad&"','"&soyad&"','"&email&"')"

conn.execute(sqlifadesi)

conn.close

set conn=nothing

response.write "bilgileriniz kayit edildi,Ilginiz i?in tesekkür ederiz"

%>

when i use this code i get this error...Microsoft OLE DB Provider for ODBC Drivers (0x80004005)

<%

ad=request.form("ad")

soyad=request.form("soyad")

email=request.form("email")

dim conn

set conn=CreateObject("ADODB.Connection")

conn.open "Server=.\SQLEXPRESS;Database=NEWSWORLD;Trusted_Connection=True;"

sqlifadesi="insert into user_info(ad,soyad,email) values('"&ad&"','"&soyad&"','"&email&"')"

conn.execute(sqlifadesi)

conn.close

set conn=nothing

response.write "bilgileriniz kayit edildi,Ilginiz i?in tesekkür ederiz"

%>

i have been working on it cant find a solution.when i use vb.net i can connect to sql server 2005 by using this "Server=.\SQLEXPRESS;Database=NEWSWORLD;Trusted_Connection=True;" but in classic asp i cant connect

Thank u

|||

i have solved my problem thank u i have done like this

<%
ad=request.form("ad")
soyad=request.form("soyad")
email=request.form("email")
dim conn
set conn=CreateObject("ADODB.Connection")
conn.open "Provider=SQLNCLI;Server=.\SQLEXPRESS;Database=NEWSWORLD;Tru sted_Connection=yes;"
sqlifadesi="insert into user_info(ad,soyad,email) values('"&ad&"','"&soyad&"','"&email& ; ;"')"
conn.execute(sqlifadesi)
conn.close
set conn=nothing
response.write "bilgileriniz kayit edildi,Ilginiz i?in tesekkür ederiz"
%>

i have done it with SQL Native Client with no username and password.

Thanks for replies

sql

ASP and MSDE Connection Problems

Hello
I have a simple MSDE database set up on this local machine. I have a small
asp.net web page that tries to query the database and returns a list from
one of the columns. Nothing fancy, just trying to set it all up and get it
all working.
I get an error on the page when I run it.
Exception Details: System.Data.SqlClient.SqlException: Login failed for
user 'BBAISLEY\ASPNET'.
I assume this means that the user account isn't set up right, but I am not
telling it to use this account. I have the following connection string:
Dim connectionString As String = "server='BBAISLEY\MSDEBBAISLEY';
trusted_connection=true; database='music_cds'; user id=SQL;
password=xxxxxxxxxx;"
Can someone help me get this working? I would like to make a simple account
for all of my apps to use, don't really care what its called for now.
When I log in, I can only use the windows authencation method, so maybe my
MSDE instance isn't set for SQL passwords? How can I check this?
Thanks
Brett
You are using ASP.NET?
This is a common error as the applications default to using the ASPNET
account.
You have two choices:
1. Give access to the ASPNET account. (I dont think you want to do this
though).
2. Modify the AUTHENTICATION heading in the web.config file, & also the
virtual directory/site/directory property to only allow windows
authenticated users into the folder:
Under the AUTHENTICATION heading add:
<identity impersonate="true" />
Modify IIS to only allow windows authenticated users through...
Cheers,
James Goodman
"Brett Baisley" <baisley@.hotmail.com.REMOVETHIS> wrote in message
news:e$TLLgdLEHA.3292@.TK2MSFTNGP11.phx.gbl...
> Hello
> I have a simple MSDE database set up on this local machine. I have a small
> asp.net web page that tries to query the database and returns a list from
> one of the columns. Nothing fancy, just trying to set it all up and get it
> all working.
> I get an error on the page when I run it.
> Exception Details: System.Data.SqlClient.SqlException: Login failed for
> user 'BBAISLEY\ASPNET'.
> I assume this means that the user account isn't set up right, but I am not
> telling it to use this account. I have the following connection string:
> Dim connectionString As String = "server='BBAISLEY\MSDEBBAISLEY';
> trusted_connection=true; database='music_cds'; user id=SQL;
> password=xxxxxxxxxx;"
> Can someone help me get this working? I would like to make a simple
account
> for all of my apps to use, don't really care what its called for now.
> When I log in, I can only use the windows authencation method, so maybe my
> MSDE instance isn't set for SQL passwords? How can I check this?
> Thanks
> Brett
>
|||Whoops, I misread!
It looks like you do want to use the first suggestion I made.
By default, msde is only setup for Windows Authentication, rather than sql
authentication.
See this link for information on how to modify this:
http://support.microsoft.com/default...en-us%3B319930
http://support.microsoft.com/default...n-us%3BQ322336
Cheers,
James Goodman
"Brett Baisley" <baisley@.hotmail.com.REMOVETHIS> wrote in message
news:e$TLLgdLEHA.3292@.TK2MSFTNGP11.phx.gbl...
> Hello
> I have a simple MSDE database set up on this local machine. I have a small
> asp.net web page that tries to query the database and returns a list from
> one of the columns. Nothing fancy, just trying to set it all up and get it
> all working.
> I get an error on the page when I run it.
> Exception Details: System.Data.SqlClient.SqlException: Login failed for
> user 'BBAISLEY\ASPNET'.
> I assume this means that the user account isn't set up right, but I am not
> telling it to use this account. I have the following connection string:
> Dim connectionString As String = "server='BBAISLEY\MSDEBBAISLEY';
> trusted_connection=true; database='music_cds'; user id=SQL;
> password=xxxxxxxxxx;"
> Can someone help me get this working? I would like to make a simple
account
> for all of my apps to use, don't really care what its called for now.
> When I log in, I can only use the windows authencation method, so maybe my
> MSDE instance isn't set for SQL passwords? How can I check this?
> Thanks
> Brett
>
|||Ahh, that fixed it up. Thanks James
"James" <jamesATnorton-associates.co.ukREMOVE> wrote in message
news:e6GypgfLEHA.1644@.TK2MSFTNGP09.phx.gbl...[vbcol=seagreen]
> Whoops, I misread!
> It looks like you do want to use the first suggestion I made.
> By default, msde is only setup for Windows Authentication, rather than sql
> authentication.
> See this link for information on how to modify this:
> http://support.microsoft.com/default...en-us%3B319930
> http://support.microsoft.com/default...n-us%3BQ322336
>
> --
> Cheers,
> James Goodman
> "Brett Baisley" <baisley@.hotmail.com.REMOVETHIS> wrote in message
> news:e$TLLgdLEHA.3292@.TK2MSFTNGP11.phx.gbl...
small[vbcol=seagreen]
from[vbcol=seagreen]
it[vbcol=seagreen]
not[vbcol=seagreen]
> account
my
>

Tuesday, March 20, 2012

ASP - SQL server connection Issue

Hello All,

I am building an application using SQL server 2000. When I was using SQL database on my local machine it works great but now I moved the database on the server and as soon as I try to connect it gives me this error message.

What I am doing wrong?

An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)**

Thanks

Check web.config if it is pointing to the right server.

bullpit

|||

Bingo...

Thanks

ASKING FOR JDBC AND SQL92 COMPATIBILITY

We try to compare Postegesql/Oracle/Sql Server/Ingres
for a local application developped in Java.
Could you confirm by mail that oracle database server is SQL92 (Level entry)
compatible, and support JDBC1/JDBC2 and JDBC3.
Thanks for your respons.
Regards,
Lionel MICHAUT
Areva T&D
"villeurbanne" <villeurbanne@.discussions.microsoft.com> wrote in message
news:8559FF49-4432-49FB-A9DD-2A902C1F9B2E@.microsoft.com...
> We try to compare Postegesql/Oracle/Sql Server/Ingres
> for a local application developped in Java.
> Could you confirm by mail that oracle database server is SQL92 (Level
> entry)
> compatible, and support JDBC1/JDBC2 and JDBC3.
Looks like you bought a ticket to the wrong show.
|||Hi
Yes, 10g is....got a lot of money?
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Michael C#" <xyz@.yomomma.com> wrote in message
news:uXHU7PJMFHA.1144@.TK2MSFTNGP09.phx.gbl...
> "villeurbanne" <villeurbanne@.discussions.microsoft.com> wrote in message
> news:8559FF49-4432-49FB-A9DD-2A902C1F9B2E@.microsoft.com...
> Looks like you bought a ticket to the wrong show.
>
|||"Mike Epprecht (SQL MVP)" <mike@.epprecht.net> wrote in message
news:ep%23$lEMMFHA.3760@.TK2MSFTNGP12.phx.gbl...
> Hi
> Yes, 10g is....got a lot of money?
One needle deserves another:
Apparently alot of companies do
|||Sorry, I did copy my question from my oracle support web support a little to
quickly.
My real question was :
Could you confirm that SQL Serveur (last release) is SQL92 (Level entry)
compatible, and support JDBC1/JDBC2 and JDBC3.
Thanks for your respons.
Regards,
Lionel MICHAUT
Areva T&D

ASKING FOR JDBC AND SQL92 COMPATIBILITY

We try to compare Postegesql/Oracle/Sql Server/Ingres
for a local application developped in Java.
Could you confirm by mail that oracle database server is SQL92 (Level entry)
compatible, and support JDBC1/JDBC2 and JDBC3.
Thanks for your respons.
Regards,
Lionel MICHAUT
Areva T&D"villeurbanne" <villeurbanne@.discussions.microsoft.com> wrote in message
news:8559FF49-4432-49FB-A9DD-2A902C1F9B2E@.microsoft.com...
> We try to compare Postegesql/Oracle/Sql Server/Ingres
> for a local application developped in Java.
> Could you confirm by mail that oracle database server is SQL92 (Level
> entry)
> compatible, and support JDBC1/JDBC2 and JDBC3.
Looks like you bought a ticket to the wrong show.|||Hi
Yes, 10g is....got a lot of money?
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Michael C#" <xyz@.yomomma.com> wrote in message
news:uXHU7PJMFHA.1144@.TK2MSFTNGP09.phx.gbl...
> "villeurbanne" <villeurbanne@.discussions.microsoft.com> wrote in message
> news:8559FF49-4432-49FB-A9DD-2A902C1F9B2E@.microsoft.com...
> Looks like you bought a ticket to the wrong show.
>|||"Mike Epprecht (SQL MVP)" <mike@.epprecht.net> wrote in message
news:ep%23$lEMMFHA.3760@.TK2MSFTNGP12.phx.gbl...
> Hi
> Yes, 10g is....got a lot of money?
One needle deserves another:
Apparently alot of companies do|||Sorry, I did copy my question from my oracle support web support a little to
quickly.
My real question was :
Could you confirm that SQL Serveur (last release) is SQL92 (Level entry)
compatible, and support JDBC1/JDBC2 and JDBC3.
Thanks for your respons.
Regards,
Lionel MICHAUT
Areva T&D

ASKING FOR JDBC AND SQL92 COMPATIBILITY

We try to compare Postegesql/Oracle/Sql Server/Ingres
for a local application developped in Java.
Could you confirm by mail that oracle database server is SQL92 (Level entry)
compatible, and support JDBC1/JDBC2 and JDBC3.
Thanks for your respons.
Regards,
Lionel MICHAUT
Areva T&D"villeurbanne" <villeurbanne@.discussions.microsoft.com> wrote in message
news:8559FF49-4432-49FB-A9DD-2A902C1F9B2E@.microsoft.com...
> We try to compare Postegesql/Oracle/Sql Server/Ingres
> for a local application developped in Java.
> Could you confirm by mail that oracle database server is SQL92 (Level
> entry)
> compatible, and support JDBC1/JDBC2 and JDBC3.
Looks like you bought a ticket to the wrong show.|||Hi
Yes, 10g is....got a lot of money?
--
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Michael C#" <xyz@.yomomma.com> wrote in message
news:uXHU7PJMFHA.1144@.TK2MSFTNGP09.phx.gbl...
> "villeurbanne" <villeurbanne@.discussions.microsoft.com> wrote in message
> news:8559FF49-4432-49FB-A9DD-2A902C1F9B2E@.microsoft.com...
> > We try to compare Postegesql/Oracle/Sql Server/Ingres
> > for a local application developped in Java.
> > Could you confirm by mail that oracle database server is SQL92 (Level
> > entry)
> > compatible, and support JDBC1/JDBC2 and JDBC3.
> Looks like you bought a ticket to the wrong show.
>|||"Mike Epprecht (SQL MVP)" <mike@.epprecht.net> wrote in message
news:ep%23$lEMMFHA.3760@.TK2MSFTNGP12.phx.gbl...
> Hi
> Yes, 10g is....got a lot of money?
One needle deserves another:
Apparently alot of companies do:)|||Sorry, I did copy my question from my oracle support web support a little to
quickly.
My real question was :
Could you confirm that SQL Serveur (last release) is SQL92 (Level entry)
compatible, and support JDBC1/JDBC2 and JDBC3.
Thanks for your respons.
Regards,
Lionel MICHAUT
Areva T&D

Sunday, March 11, 2012

AS2005: write a cube to a local .cub via xmla?

Hi,

i wonder if it is possible to write a cube (in AS2005) to a local .CUB file using xmla instead of the "old" CREATE GLOBAL CUBE statement ...
I haven't found anything in the msdn ... perhaps I've been blind?

background of this question:
http://forums.microsoft.com/msdn/ShowPost.aspx?postid=463952&siteid=1

Thanks for your answers and for tolerating my bad english
best regards,
Sven

Yes, it is possible. The easiest way to get an example of how to do it is to run a CREATE GLOBAL CUBE statement on your cube while you have a Profiler trace running - the CREATE GLOBAL CUBE statement gets translated to AS's XML/A scripting language in the background and you'll see that script in the trace. You can then change it as you need and possibly fix your problem.

Chris

|||Thanks for your quick reply!

We used the Profiler before and found the xmla-statement that is used

to create the new cube ... no problem so far; it creates a new database

with the cube as we want it to be.

But we didn't find the xmla-statement that writes the cube into the .cub file.

There are 3 lines in the Profiler where the filename of the .cub

appears: 2 times in the context of a copy of the original CREATE GLOBAL

CUBE statement and the last time in the line where we found the

statement that creates the cube.

The Profiler says something like this:

"CREATE GLOBAL CUBE-Instruction | FILENAME=c:\newcube.cub | DDL | <batch>...</batch>"

The <batch> we can extract to create our cube, but the part before is no scripting-language we know.

Perhaps it makes sense for you? ;)

Greetings,

Sven|||I think it's just extra information flagging the fact that this is a local cube being created and where the .cub file is located, and not DDL. Certainly when I remove it and just run the Batch statement (in MDX Sample app - not SQLMS, where for some reason I can't connect to an empty .cub file to run the DDL to create the local cube) then it all works ok.|||

Hi, Can you explain how exactly you run the BATCH statement in order to get the .CUB file?

I am using ADOMD.NET.

When I run the statement using management studio, the query succeed but nothing is created and there is no place to set the local file location.

Thanks,

Ofer

|||Hi Chris,
I'm reading your book on MDX (MDX Solutions 2ndEd.) and am currently struggling with the creation of local cubes. I want to create a local cube in Excel via VBA, but notice that the CREATE CLOBAL CUBE statement doesn't correctly save all data, so I'm experimenting with the ASSL approach.
In your book you write (p. 528) "...to create a local cube using ASSL,...:You open a connection to your target (in this case a .cub file), then execute your ASSL statement."
I'm wondering how you do this, apparently not with the MDX Sample app.?
What kind of connection is that if I need to do this using VB(A), or should I use .NET?|||

Hi Christopher,

Take a look at:
http://cwebbbi.spaces.live.com/blog/cns!7B84B0F2C239489A!877.entry

Regards,

Chris

|||

in MDX Sample app - not SQLMS, where for some reason I can't connect to an empty .cub file to run the DDL to create the local cube

The reason is that local cubes don't support more than one connection to the cube file, and Management Studio usually wants to open two connections (one for AMO), even if you only want to send MDX queries.

AS2005: write a cube to a local .cub via xmla?

Hi,

i wonder if it is possible to write a cube (in AS2005) to a local .CUB file using xmla instead of the "old" CREATE GLOBAL CUBE statement ...
I haven't found anything in the msdn ... perhaps I've been blind?

background of this question:
http://forums.microsoft.com/msdn/ShowPost.aspx?postid=463952&siteid=1

Thanks for your answers and for tolerating my bad english
best regards,
Sven

Yes, it is possible. The easiest way to get an example of how to do it is to run a CREATE GLOBAL CUBE statement on your cube while you have a Profiler trace running - the CREATE GLOBAL CUBE statement gets translated to AS's XML/A scripting language in the background and you'll see that script in the trace. You can then change it as you need and possibly fix your problem.

Chris

|||Thanks for your quick reply!
We used the Profiler before and found the xmla-statement that is used to create the new cube ... no problem so far; it creates a new database with the cube as we want it to be.
But we didn't find the xmla-statement that writes the cube into the .cub file.
There are 3 lines in the Profiler where the filename of the .cub appears: 2 times in the context of a copy of the original CREATE GLOBAL CUBE statement and the last time in the line where we found the statement that creates the cube.
The Profiler says something like this:
"CREATE GLOBAL CUBE-Instruction | FILENAME=c:\newcube.cub | DDL | <batch>...</batch>"
The <batch> we can extract to create our cube, but the part before is no scripting-language we know.
Perhaps it makes sense for you? ;)
Greetings,
Sven
|||I think it's just extra information flagging the fact that this is a local cube being created and where the .cub file is located, and not DDL. Certainly when I remove it and just run the Batch statement (in MDX Sample app - not SQLMS, where for some reason I can't connect to an empty .cub file to run the DDL to create the local cube) then it all works ok.|||

Hi, Can you explain how exactly you run the BATCH statement in order to get the .CUB file?

I am using ADOMD.NET.

When I run the statement using management studio, the query succeed but nothing is created and there is no place to set the local file location.

Thanks,

Ofer

|||Hi Chris,
I'm reading your book on MDX (MDX Solutions 2ndEd.) and am currently struggling with the creation of local cubes. I want to create a local cube in Excel via VBA, but notice that the CREATE CLOBAL CUBE statement doesn't correctly save all data, so I'm experimenting with the ASSL approach.
In your book you write (p. 528) "...to create a local cube using ASSL,...:You open a connection to your target (in this case a .cub file), then execute your ASSL statement."
I'm wondering how you do this, apparently not with the MDX Sample app.?
What kind of connection is that if I need to do this using VB(A), or should I use .NET?|||

Hi Christopher,

Take a look at:
http://cwebbbi.spaces.live.com/blog/cns!7B84B0F2C239489A!877.entry

Regards,

Chris

|||

in MDX Sample app - not SQLMS, where for some reason I can't connect to an empty .cub file to run the DDL to create the local cube

The reason is that local cubes don't support more than one connection to the cube file, and Management Studio usually wants to open two connections (one for AMO), even if you only want to send MDX queries.

AS2005: write a cube to a local .cub via xmla?

Hi,

i wonder if it is possible to write a cube (in AS2005) to a local .CUB file using xmla instead of the "old" CREATE GLOBAL CUBE statement ...
I haven't found anything in the msdn ... perhaps I've been blind?

background of this question:
http://forums.microsoft.com/msdn/ShowPost.aspx?postid=463952&siteid=1

Thanks for your answers and for tolerating my bad english
best regards,
Sven

Yes, it is possible. The easiest way to get an example of how to do it is to run a CREATE GLOBAL CUBE statement on your cube while you have a Profiler trace running - the CREATE GLOBAL CUBE statement gets translated to AS's XML/A scripting language in the background and you'll see that script in the trace. You can then change it as you need and possibly fix your problem.

Chris

|||Thanks for your quick reply!

We used the Profiler before and found the xmla-statement that is used

to create the new cube ... no problem so far; it creates a new database

with the cube as we want it to be.

But we didn't find the xmla-statement that writes the cube into the .cub file.

There are 3 lines in the Profiler where the filename of the .cub

appears: 2 times in the context of a copy of the original CREATE GLOBAL

CUBE statement and the last time in the line where we found the

statement that creates the cube.

The Profiler says something like this:

"CREATE GLOBAL CUBE-Instruction | FILENAME=c:\newcube.cub | DDL | <batch>...</batch>"

The <batch> we can extract to create our cube, but the part before is no scripting-language we know.

Perhaps it makes sense for you? ;)

Greetings,

Sven|||I think it's just extra information flagging the fact that this is a local cube being created and where the .cub file is located, and not DDL. Certainly when I remove it and just run the Batch statement (in MDX Sample app - not SQLMS, where for some reason I can't connect to an empty .cub file to run the DDL to create the local cube) then it all works ok.|||

Hi, Can you explain how exactly you run the BATCH statement in order to get the .CUB file?

I am using ADOMD.NET.

When I run the statement using management studio, the query succeed but nothing is created and there is no place to set the local file location.

Thanks,

Ofer

|||Hi Chris,
I'm reading your book on MDX (MDX Solutions 2ndEd.) and am currently struggling with the creation of local cubes. I want to create a local cube in Excel via VBA, but notice that the CREATE CLOBAL CUBE statement doesn't correctly save all data, so I'm experimenting with the ASSL approach.
In your book you write (p. 528) "...to create a local cube using ASSL,...:You open a connection to your target (in this case a .cub file), then execute your ASSL statement."
I'm wondering how you do this, apparently not with the MDX Sample app.?
What kind of connection is that if I need to do this using VB(A), or should I use .NET?|||

Hi Christopher,

Take a look at:
http://cwebbbi.spaces.live.com/blog/cns!7B84B0F2C239489A!877.entry

Regards,

Chris

|||

in MDX Sample app - not SQLMS, where for some reason I can't connect to an empty .cub file to run the DDL to create the local cube

The reason is that local cubes don't support more than one connection to the cube file, and Management Studio usually wants to open two connections (one for AMO), even if you only want to send MDX queries.

Monday, February 13, 2012

ArgumentNullException thrown after second connection

Hi,

Our application has two parts: one is Windows application and the other

one is Windows service. The service runs under Local system accont. We

use third party application to log into database which uses instance of

SQL Server 2005 Express . We use same methods for logging for Windows

application and for Windows service. Both, application and the service

are compiled with .Net framework 2.0 and VS 2005 (C#).

The application always logs into the database succesfuly. The problem

is with the service. The code for the service works like this: first

login into database to retrieve some data, after that log off and

disconnect, and after that immediately tries to login again using the

the same credentials. The first login is always succesful, but the

second one fails with error message:

Type:System.ArgumentNullException

Message:Value cannot be null.

Parameter name: Value is

null.

If we set the Service to run under User windows

account - everything works fine. Does anyone have similar

problems? What can be the problem here? Can anyone help me?

Thanks.

Could you provide the code that is causing the problem and identify the line that thows the exception?

Mike

|||The code is below. The same code works fine for the windows application

and when service connects for the first time. Database path, user name

and password are the same. The code crashes when Windows service tries

to connect for the second time (after LogOff) on line framework.LogOn( sDatabaseFullPath, sUserName, sUserPassword ) and it throws Exception:

Type:System.ArgumentNullException

Message:Value cannot be null.

Parameter name: Value is

null.

Parameters are not null, not even empty string. They contain valid string values (I checked with the debugger).

Framework is namespace from the third party application SDK. I

contacted this third party support also, but they didn't try to help me.

Please note that this code was working fine with .Net framework 1.1, VS 2003 and SQL Server 2000 DE.

public override void LogOn( DBCredentials dbCredentials

)

{

string sDatabaseFullPath =

dbCredentials.DBFileNameFullPath;

string sUserName =

dbCredentials.UserName;

string sUserPassword =

dbCredentials.Password;

try

{

if( IsConnectionLive

)

framework.LogOff();

framework.LogOn(sDatabaseFullPath, sUserName,

sUserPassword);

}

catch( InvalidLogonException

ile )

{

throw new InvalidLogonException(

ile.Message, dbCredentials);

}

catch( ThreadAbortException

ex )

{

throw

ex;

}

catch( LockDatabaseException lde )

{

throw new LockDatabaseException(

lde.Message );

}

catch( Exception

ex)

{

throw new Exception(

ex.Message );

}

}

|||

I don't know anything about this framework namespace or what happens when you call framework.LogOn so it's tough to give you any advice. If you can look at the code in framework, that would be a place to start, if you can't, you'll likely need to push back on the vendor that sold you this framework as this seems to be a problem with their code. There is likely something within framework that is causing the ArgumentNullException and it is just bubbling up.

As a troubleshooting measure, you could try creating your own LogOff and LogOn procedures and use them in your service. You need to try and isolate the "black box" and ensure that SQL Server is working correctly and that the action you are trying to perform is working without the call to framework.

Mike

|||Thanks.

Arghhhh Alias (local)\FOOBAR -> TCP/IP,ditto

I've just spent days trying to get no-network protocol access to a local
(MSDE )database working. Everything I tried failed, all hints from the
documentation failed.
Eventually...I found cliconfg.exe and found out about Aliases and found the
stupid alias I referred to in the subject line, i.e.
(local)\FOOBAR -> DBMSSOCN,(local)\FOOBAR
No wonder things didn't work when I removed TCP/IP from the server's
protocol set!
So:
1. Why do none of the utilities report the existense of this Alias. Not
osql when I connect, no "using alias" line.
I would like it to say "Using Alias" if it was, e.g.
C:\>osql -S (local)\FOOBAR -U sa
Password:
Using Alias.
[TCP/IP Sockets]Specified SQL server not found.
[TCP/IP Sockets]ConnectionOpen (Connect()).
C:\>
Not from "osql -L", though perhaps the existence of multiple lines of output
was a hint.
Nor when using odbcad32. It does not show that Aliases exist at all; it
does not show the Alias panel. In its "Client Configuration" window, it
uses the term "Server alias", but that's not the same thing I think...it's
just a hold-over from that dialog's use in cliconfg.exe? It certainly does
not show cliconfg.exe's Aliases panel and no alias is created when I try
putting things in there now.
2. Why does none of the documentation mention anything about this?
There's very little mention of aliases at all.
In troubleshooting sections, there's no mention of the possibility of an
alias making the system lie to you.
There's little mention of the client network configuration utility. And
particularly no mention of where it is located and what it is called. I
don't know where I found out is was called cliconfg.exe and it was in
system32. I don't know where I found this, maybe I even in the end
did a search for "cli" on my hard-disk.
3. How did that alias get created?
Was it created by the people who provided the installer for the database'
If so, they better beware. Was it created by some automatic step in using
the database' I certainly didn't create it intentionally and no-one else
has access to my machine.
So just a long complaint really. But hopefully of use to someone. Maybe
even the docuemntation could be improved based on it... :-)
BTW. I'm never really sure of what Power Users can and cannot do, but...
The registry permissions allow a Power User to change aliases. Can power
users normally make such globally significant changes?
--
Alan J. McFarlane
http://homepage.ntlworld.com/alanjmcf/
Please follow-up in the newsgroup for the benefit of all.The client network utilities and other GUI utilities don't ship with MSDE.
Client aliases have been around since SQL 4.2.
SQLDiag.exe will report that aliases are configured on the server as well.
aliases are stored in the registry on the client machine.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MS
SQLServer\Client\ConnectTo
Q. Why does none of the documentation mention anything about this?
Answer:
See: Books Online: Configuring Client Net-Libraries
There are lots of articles that discuss the use of aliases to connect.
328383 INF: SQL Server Clients May Change Protocols When They Try to Connect
http://support.microsoft.com/?id=328383
265808 INF: How to Connect to an SQL Server 2000 Named Instance with the
http://support.microsoft.com/?id=265808
Q. How did that alias get created?
Answer: SQL setup and MDAC setup don't create any aliases. They are
created by the user. Either using SQL Client network Utility, or creating
a ODBC DSN and using the Client Configuration Button.
With MSDE, you also have the option of having it only listen on Shared
Memory. This would only allow local connections to succeed.
This is documented in the sp3 readme as well as the following article.
814130 INF: How to Secure Network Connectivity for SQL Server 2000 Local
http://support.microsoft.com/?id=814130
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.