Showing posts with label setup. Show all posts
Showing posts with label setup. Show all posts

Friday, March 30, 2012

how can i connect with lank password

hi all
i setup my sqlserver2000 on win 2000 and let him to take username and password from windows
so how can i connect to it with blank uid,pwd?
thanxYou can use trusted connection as :
"Server=Aron1;Database=pubs;Trusted_Connection=True;"

FYI: http://www.connectionstrings.com

Regards,|||thanx alot|||hello aain
i tried to connect but an eror msg appears:
Exception Occurred: Login failed for user 'COMPU-DSW51C8DZ\ASPNET'.

i'm using this code:

SqlConnection cn;
SqlCommand cm;
String strSQL;

cn = new SqlConnection ("server=localhost;database=Northwind;Trusted_Connection=true;");
strSQL = "INSERT INTO Employees " +
"(EmployeeID,FirstName,LastName,City) " +
"VALUES ('" + txtID.Text + "', '" +
txtFirstName.Text + "', '" +
txtLastName.Text + "', '" +
ChkToInt(chkCity) + "')";

cm = new SqlCommand(strSQL, cn);

// ** Open connection
try
{
cn.Open();
// ** Execute command
cm.ExecuteNonQuery();
}
catch(SqlException sx)
{
Response.Write("Exception Occurred: " + sx.Message);
}
finally
{
if (cn.State == ConnectionState.Open)
cn.Close();
}|||This means you need to set up COMPU-DSW51C8DZ\ASPNET as a login in SQL Server.

Do you have Query Analyzer? Running this will create the login:

exec sp_grantlogin 'COMPU-DSW51C8DZ\ASPNET'

And running this will give permission to the database:
exec sp_grantdbaccess 'COMPU-DSW51C8DZ\ASPNET'

Make sure that northwind is the current database before running executing sp_grantdbaccess.

Terri

Monday, March 26, 2012

How can i change security mode of SQL Server Express 2005

Hello,
I have created one application in visual studio 2005 and also created setup project of that application. now i want to install SQL Server Express edition with my application. so i have checked SQL Server Express 2005 in Setup Project Properities(Prerequisites...). now i want to change SQL Secirty Mode during setup. and i don't know how can we do this?

Any idia?

Thread moved to the appropriate forum|||

hi,

SQLExpress setup boostrapper accept "parameters" to define the "final" settings of the installed instance at install time..

the parameter you are looking for is SECURITYMODE=SQL to enable standard SQL Server authenticated connections..

please have a look at http://msdn2.microsoft.com/en-us/library/ms144259.aspx for all supported parameters..

regards

|||

Thank for sujession, but still it is not work.
i have entered following line for change SQL Server Security Mode Windows Auth. To SQL Auth.

Start /wait setup.exe /qb INSTANCENAME=SQLEXPRESS SECURITYMODE=SQL SAPWD=pwd12345

i have also tried this :

Start /wait setup.exe /qb UPGRADE=Client_Components INSTANCENAME=SQLEXPRESS SECURITYMODE=SQL SAPWD=pwd12345

but still it is not work. i got the same error when i run my program "Login fail for user sa. The user is not associated with a trusted SQL Server connection.

|||

hi,

the exception is correctly related to not enabled SQL Server authenticated connections..

but the SECURITYMODE=SQL parameter is there for the case, and it "must" work as expected, as it really does since MSDE 2000 installer...

please pardon me, but are you sure you are later connecting to the correct SQLExpress instance?

regards

|||

Yes i connecting to correct SQLExpress instance.

but don't warry, it's solve now bcoz i directly change parameter in package.xml(Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\SqlExpress\en) file.

How can i change security mode of SQL Server Express 2005

Hello,
I have created one application in visual studio 2005 and also created setup project of that application. now i want to install SQL Server Express edition with my application. so i have checked SQL Server Express 2005 in Setup Project Properities(Prerequisites...). now i want to change SQL Secirty Mode during setup. and i don't know how can we do this?

Any idia?

Thread moved to the appropriate forum|||

hi,

SQLExpress setup boostrapper accept "parameters" to define the "final" settings of the installed instance at install time..

the parameter you are looking for is SECURITYMODE=SQL to enable standard SQL Server authenticated connections..

please have a look at http://msdn2.microsoft.com/en-us/library/ms144259.aspx for all supported parameters..

regards

|||

Thank for sujession, but still it is not work.
i have entered following line for change SQL Server Security Mode Windows Auth. To SQL Auth.

Start /wait setup.exe /qb INSTANCENAME=SQLEXPRESS SECURITYMODE=SQL SAPWD=pwd12345

i have also tried this :

Start /wait setup.exe /qb UPGRADE=Client_Components INSTANCENAME=SQLEXPRESS SECURITYMODE=SQL SAPWD=pwd12345

but still it is not work. i got the same error when i run my program "Login fail for user sa. The user is not associated with a trusted SQL Server connection.

|||

hi,

the exception is correctly related to not enabled SQL Server authenticated connections..

but the SECURITYMODE=SQL parameter is there for the case, and it "must" work as expected, as it really does since MSDE 2000 installer...

please pardon me, but are you sure you are later connecting to the correct SQLExpress instance?

regards

|||

Yes i connecting to correct SQLExpress instance.

but don't warry, it's solve now bcoz i directly change parameter in package.xml(Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\SqlExpress\en) file.

Wednesday, March 21, 2012

HOW CAN I ATTACH DATABASE TO MSDE ?

I am having little problem with it , I am using installshield for setup program and at the end when I finish with msde installation I try to attach a database, I would like to use SQL-DMO , but I dont have much clue how can I do it I need some examples sc
ripts
Thanks a lot
While you can use SQL DMO, it's really easier to simply use ADO or ADO.NET.
When you "open" a database connection against SQL Server and point to the
MDF file, ADO does an attach for you (unless the database is already
attached). This code is from a yet-to-be-published article on SQL Server
Express where I attach a new database to the local SQLEXPRESS named
instance.
Try
cn = New SqlConnection("Data Source=.\SQLExpress;" _
& "Integrated Security=True;Database=Biblio;" _
& "Timeout=60;" _
& "Application Name=SQLExpress Test;" _
& "AttachDBFilename=" & strFn)
da = New SqlDataAdapter("SELECT AU_ID, Author, Year_Born from
authors", cn)
ds = New DataSet
da.Fill(ds)
DataGridView1.DataSource = ds.Tables(0)
Catch ex As Exception
MsgBox(ex.ToString)
End Try
hth
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
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.
__________________________________
"Robert" <Robert @.discussions.microsoft.com> wrote in message
news:1F642E5F-37AB-4BA7-88DF-5159C607AA0C@.microsoft.com...
> I am having little problem with it , I am using installshield for setup
program and at the end when I finish with msde installation I try to attach
a database, I would like to use SQL-DMO , but I dont have much clue how can
I do it I need some examples scripts
> Thanks a lot
>
|||Hello Robert.
U have said th@. u installed MSDE 2000 using installsheild. How did u do this. Pls help me as im unable to install MSDE itself. Also its givin me a message a strong SA id and password is required.
"Robert" wrote:

> I am having little problem with it , I am using installshield for setup program and at the end when I finish with msde installation I try to attach a database, I would like to use SQL-DMO , but I dont have much clue how can I do it I need some examples
scripts
> Thanks a lot
>

Sunday, February 19, 2012

HostName and ReinitializeSubscription

Hello all,

I'm having trouble with my Merge Replication setup in regards to changing the HostName property of the SqlCeReplication object. As we all know, if you modify the HostName value, you must then call the ReinitializeSubscription(true) method before calling Synchronize(). Unfortunately, this isn't working for me. Following this sequence of steps consistently results in error messages saying that I need to either call ReinitializeSubscription, or change my HostName back to it's original value. Has anyone ever experienced this problem?

Regards,

Rob Tiffany

Hey Rob,

You are correct, once you specify a HostName value for a subscriber, if you want to change that value later, you must call SqlCeReplication.ReinitializeSubscription(True) followed by .Synchronize() to effectively make the change.

I built an app recently for a large field service scenario where the mobile device can change hands from field worker to field worker. I decided to use the field worker's unique identifier as the value for HostName so that I could replicate only the appropriate data for a given worker to a given SQL Mobile database. If the device changes hands, here is the process of making the change to HostName and reinitializing:

Public Function Synchronize() As Boolean

Dim retVal As Boolean = False

Dim repl As SqlCeReplication = GetReplication()

If repl Is Nothing Then
Return False
End If

Try

If Globals.GetInstance().HostNameChanged Then
repl.ReinitializeSubscription(True)
Globals.GetInstance().HostNameChanged = False
End If

repl.Synchronize()

etc etc etc

If you are doing something similar and getting an error, could you post the details on the error itself and Laxmi and I can look into it? Also, some info on your configuration (assume you are talking about SQL Mobile and SS2005?)

Regards,

Darren

|||

Yeah, that's what I'm doing too. My Sync code blocks looks like the following:

private void replicate(bool reInit)

{

SqlCeReplication repl = new SqlCeReplication();

repl.InternetUrl = Settings1.Default.InternetURL;

repl.InternetLogin = Settings1.Default.InternetLogin;

repl.InternetPassword = Settings1.Default.InternetPassword;

repl.Publisher = Settings1.Default.Publisher;

repl.PublisherDatabase = Settings1.Default.PublisherDatabase;

repl.Publication = Settings1.Default.Publication;

repl.PublisherSecurityMode = SecurityType.NTAuthentication;

repl.SubscriberConnectionString = @."Data Source=" + localFolder + "MyDB.sdf;Password=p@.ssw0rd;";

repl.Subscriber = Settings1.Default.Subscriber;

repl.HostName = txtAgentId.Text;

repl.CompressionLevel = Settings1.Default.CompressionLevel;

repl.ExchangeType = ExchangeType.BiDirectional;

try

{

if (!File.Exists(localFolder + "MyDB.sdf"))

{

repl.AddSubscription(AddOption.CreateDatabase);

}

if (reInit == true)

{

repl.ReinitializeSubscription(true);

}

// Synchronize with SQL Server 2005

repl.Synchronize();

}

finally

{

repl.Dispose();

}

}

If the user changes the HostName, then I pass "true" to the method above to call ReinitializeSubscription(true).

Thanks,

Rob

|||

there is a possible code path in your code where the database does not exist and you (are going to create it using AddOption.CreateDatabase on the first replication), but reinit can also be true - this won't work - you cannot mix CreateDatabase and Reinit in the same call to Synchronize.

Could that be what's happening? What error messages are you getting?

Darren

|||

I don't have the exact error message in front of me now, but is says something like:

Error: Changing the HostName requires a call to ReinitializeSubscription() or change your HostName back to the original value. HostName = 2, Original HostName = 1.

Something like that. Keep in mind that it will even throw this same error when I call ReinitializeSubscription().

To answer your other question, I haven't experienced the possible code path error you described where the database doesn't exist. It should also be known that this is a desktop XP project and not on Windows Mobile. Just in case we have subtle differences or issues between the desktop and handheld dlls. I'm trying to do some load testing and the desktop is the only way to create enough clients.

Rob

Hosting an SQL database on remote share

Hi,
I would really appreciate help with this query.

I have an SQL 2000 server setup with 2 databases. My boss would like to setup another database but wants the actual database to reside on a different server share.

Is is possible for one database on an SQL server to be hosted on a remote share ?

appreicate any info
thanksIt can be done, but it is difficult, complex, and unsupported. I wouldn't go there, the risk is way too high.

-PatP|||Main point to think about is Performance and is there any reason why your boss is thinking in such a high-fly idea.

Hosted SQL and Replication

I have a hosted SQL database.
The hosting company does not offer to setup merge replication for me.
1) Is there a hosting company that offers replication too ?
2) If I can't do replication, is there anyway to merge two databases using a
DTS package or something ?
Thanks.
Michael Tissington
http://www.oaklodge.com
http://www.tabtag.com
Hi Michael Tissington,
From your descriptions, I understood that you would like to know whether
there is an workaround when you do not have the authority to make
replication. Have I understood you? If there is anything I misunderstood,
please feel free to let me know
Unfortunately, I dont think DTS could be used to replace Replication. From
BooksOnline or MSDN Online, we could fine the descriptions like these
--DTS--
Data Transformation Services (DTS) can be used to import and export data
between heterogeneous OLE DB and ODBC data sources. A DTS package is
defined that specifies the source and target OLE DB data sources; the
package can then be executed on an as-required basis or at scheduled times
or intervals.
--Replication--
Using replication, you can distribute data to different locations, to
remote or mobile users over a local area network, using a dial-up
connection, and over the Internet. Replication also allows you to enhance
application performance, physically separate data based on how it is used
(for example, to separate online transaction processing (OLTP) and decision
support systems), or distribute database processing across multiple servers.
If there is only a tiny modification in a large database, you will have to
make a whole new Data Transformation, which will must be cost huge of time
and sometimes money. while Replication will use little transactions to make
it
In the meanwhile, we could use DTS to transfer data between different data
source while replication has rather limitations.
Hope it helps and thank you for your patience and cooperation. If you have
any questions or concerns, don't hesitate to let me know. We are here to be
of assistance!
Sincerely yours,
Mingqing Cheng
Microsoft Developer Community Support
Introduction to Yukon! - http://www.microsoft.com/sql/yukon
This posting is provided "as is" with no warranties and confers no rights.
Please reply to newsgroups only, many thanks!
|||Michael,
there are many hosting companies out there who offer hosting with SQL Server
installed. Off the top of my head I don't know of any who offer replication
publishing services but the first one I found in a Google search offers
replication subscriber services:
http://www.1stchoiceinternational.com/sqlhosting.htm.
Using DTS to merge databases is not at all simple, but it is possible - you
can use binary checksums for each table to determine differences. BTW,
there's nothing inbuilt to allow you to do this, so all the code is to be
written in custom executesql tasks.
hth,
Paul Ibison
|||Paul,
Thanks for the link, just what I'm looking for.
Michael Tissington
http://www.oaklodge.com
http://www.tabtag.com
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:e7Ck3xeVEHA.2700@.TK2MSFTNGP10.phx.gbl...
> Michael,
> there are many hosting companies out there who offer hosting with SQL
Server
> installed. Off the top of my head I don't know of any who offer
replication
> publishing services but the first one I found in a Google search offers
> replication subscriber services:
> http://www.1stchoiceinternational.com/sqlhosting.htm.
> Using DTS to merge databases is not at all simple, but it is possible -
you
> can use binary checksums for each table to determine differences. BTW,
> there's nothing inbuilt to allow you to do this, so all the code is to be
> written in custom executesql tasks.
> hth,
> Paul Ibison
>

hosted sql 2005 databases

We are hosting multiple sql server 2005 databases on a windows 2003 server.
I've setup restricted growth on the databases to 50 mb. What would be a good
setting for the log files? I have all of the databases setup in Simple
recovery mode. Is Auto Shrink = True a good idea?
Please advise.
Thanks!
Hi
The best way to get these values is to monitor it during you normal working
period (e.g. a week and take the values from that). If the files are often
growing then you may want to increase the size they grow by, or put in a
system when the files are increased at a time when it will not impact users.
For log file sizes hopefully you can set a maximum ceiling that will rarely
be expanded.
Growing the files frequently may lead to disc fragmentation and decreases in
performance, therefore auto shrink is not a good idea.
You should monitor the space available on your disc so that you can prevent
the sort of situation where there is not enough room to expand the database.
MOM is a very useful to monitor your SQL Server in this respect.
John
"mp3nomad" wrote:

> We are hosting multiple sql server 2005 databases on a windows 2003 server.
> I've setup restricted growth on the databases to 50 mb. What would be a good
> setting for the log files? I have all of the databases setup in Simple
> recovery mode. Is Auto Shrink = True a good idea?
> Please advise.
> Thanks!

hosted sql 2005 databases

We are hosting multiple sql server 2005 databases on a windows 2003 server.
I've setup restricted growth on the databases to 50 mb. What would be a good
setting for the log files? I have all of the databases setup in Simple
recovery mode. Is Auto Shrink = True a good idea?
Please advise.
Thanks!Hi
The best way to get these values is to monitor it during you normal working
period (e.g. a week and take the values from that). If the files are often
growing then you may want to increase the size they grow by, or put in a
system when the files are increased at a time when it will not impact users.
For log file sizes hopefully you can set a maximum ceiling that will rarely
be expanded.
Growing the files frequently may lead to disc fragmentation and decreases in
performance, therefore auto shrink is not a good idea.
You should monitor the space available on your disc so that you can prevent
the sort of situation where there is not enough room to expand the database.
MOM is a very useful to monitor your SQL Server in this respect.
John
"mp3nomad" wrote:
> We are hosting multiple sql server 2005 databases on a windows 2003 server.
> I've setup restricted growth on the databases to 50 mb. What would be a good
> setting for the log files? I have all of the databases setup in Simple
> recovery mode. Is Auto Shrink = True a good idea?
> Please advise.
> Thanks!