Attaching, Restoreing, Backup DB In MSDE , How??

Oct 14, 2004

Hi all;





I created a DB in MS SQL Server 2000.. (has Tables, SPs, Views..etc.) and I want to attached to a customer that has ONLY MSDE?





How?





Also, how can my customer make Backup & Restore from his MSDE? (BTW: can I do that in code (VB.NET/ASP.NET)??








Thanks in advanced!

View 1 Replies


ADVERTISEMENT

Detaching DB From MSDE And Attaching To SQL Express Using SQLDMO.

Dec 19, 2007

All,

I wanted to to detach a DB say MyDB from MSDE and wanted to attach it to SQL Express.
It could able to Detach the DB from MSDE,but attachment to SQL 2005 is failing. When I verified MSDE Instance through Managment studio "MyDB" wasnot there ; means it got detached.I couldnt find the DB in SQL 2005. When I tried manually through command prompt I was able to attach "MyDB" to SQL2005.
Please help me out!!
Here is the code which I have written.

if SUCCEEDED(hr = CoCreateInstance (CLSID_SQLDMOServer, NULL, CLSCTX_INPROC_SERVER,
IID_ISQLDMOServer, (LPVOID*)&pSQLServer))
{

pSQLServer->SetLoginSecure (TRUE);
SQLDMO_LPCSTR DB = OLESTR("MyDB");
//Connect to MSDE First
if SUCCEEDED(hr = pSQLServer->Connect (szDbServer, szUserName, szPassword))
{

pSQLServer->DetachDB(DB,lpszResult); //Detach the DB
pSQLServer->DisConnect(); //Disconnect MSDE
LPBSTR lpszResult2 = NULL;
long lNumDB;
//Connect to SQL 2005
if SUCCEEDED(hr = pSQLServer->Connect (szSQLExpDbServer, szUserName, szPassword))
{
//LPCOLESTR lpo = A2COLE(sTemp);
//sTemp.operator LPCTSTR
pSQLServer->GetDatabaseCount (&lNumDB);
SQLDMO_LPCSTR files = OLESTR("C:\Program Files\Microsoft SQL Server\MSSQLData\MyDB.mdf,C:\Program Files\Microsoft SQL Server\MSSQL\Data\MyDB_log.ldf");
pSQLServer->AttachDB(DB,files,lpszResult2); // Attach the DB to SQL 2005

pSQLServer->DisConnect(); // Disconnect SQL 2005}

View 1 Replies View Related

Error In Attaching MSDE Database To SQL Server 2005 Express

Jul 3, 2006

I'm trying to attach a MSDE 2000 database to SQL Server 2005 Express.

I simply issue sp_detach_db XXX where XXX is the name of my MSDE database. Then sp_attach_db or create database ... with attach and both way gets the following message:

Event ID. : 3415

Description: Database 'XXX' cannot be upgraded because it is
read-only or has read-only files. Make the database or files writeable, and
rerun recovery.

What does it mean?

Thanks for any help,

Peter

View 4 Replies View Related

Is It Possible To Make A Backup From MSDE ?? (Y/N)

Jul 19, 2004

Hi all;

Is it possible to make a backup from MSDE ?? (Y/N)

The problem: I am going to develop an application for a small company and it don't like to spend more $$ rather than some $$ for the App.

So, I don't know if it is possible to do a backup from MSDE or not?

BTW: How much MS SQL Sever200 will cost per a PC? (any idea even approx.)??


Thanks in advanced!

~~CS4Ever~~

View 2 Replies View Related

Backup && Restore In MSDE, How ???

Aug 6, 2004

Hi all;

I am looking to add "Make Bakup" and "Make Restore" functionalty in my applicayion menu which uses MSDE for database.

My question is How to add these two functionalty (What is the source code)??


Thanks in advanced!

View 1 Replies View Related

Backup MSDE Database

May 4, 2006

Hi,

we have about 12 databases in an MSDE server.

We can install the enterprise manager, but cant get the maintenance plans to work. (fields stay empty and setting dont get saved)
I've searched a bit, but couldn't fix it.

No problem, i created a job, with 12 T-SQL commands, and the backups are working perfect.

Now we wanne backup with a history (we take a backup every 4 hours of the day), because now they always get overwritten.

So im trying to change my transactSQL to create dynamic files.

The code i'm using right now :

BACKUP DATABASE PW0001A00 TO DISK = 'C:SQLBACKUPPW0001A00.BAK' WITH INIT, NOUNLOAD, NOSKIP, STATS=10, NOFORMAT


I've tried different things like

BACKUP DATABASE PW0001A00 TO DISK = 'C:SQLBACKUPPW0001A00' + DATEPART(month, GETDATE()) + '.BAK' WITH INIT, NOUNLOAD, NOSKIP, STATS=10, NOFORMAT


but nothing worked.

so basically I wanne be able to create dynamic filenames in the above command.

You got any ideas/solutions.

tnx.

View 2 Replies View Related

MSDE Backup/Migration

Sep 20, 2007

Can anyone tell me how to backup an MSDE database and then restore it to a second server?

View 1 Replies View Related

How To Make Self-backup Log In Msde?

Jul 20, 2005

Hi.I am trying to automatically backup transaction log when error 9002happened. So i have created appropriate job and alert to catch this error.I have two instances of sql server under Windows 2000. One of them is fullSQL Server, another is msde.When transaction log is full in full SQL Server error 9002 severity 17state 2 is logged in sql server log and in Windows Application log. Myalert firing my job. All is fine.But when transaction log is full in MSDE error 9002 severity 17 state 6 islogged only in sql server log. It is not logged into Windows Applicationlog so my alert does not work.So here is my questions:1. Why MSDE does not log error into Windows Application log?2. Why error 9002 has severity 19 in sysmessages table but is generatedwith severity 17?3. Why state of error 9002 differs under sql server and msde?Thank you.--Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

View 5 Replies View Related

Backup SQL Using MSDE Writer

Jan 19, 2007

How do I backup my SQL Databases using MSDE Writers?

I do not see MSDE Writers under NT Backup.

Thanks

Santhosh

View 1 Replies View Related

MSDE Db Backup To SQL Express

Oct 1, 2007



Hi everyone!

We are trying to restore a database backup created o MSDE 2000 server to SQL Express 2005.
The collation settings of both SQL Express and MSDE are the same: Turkish_CI_AS

The problem is that the log of restore operation has some warnings like:

Processed 344 pages for database 'MYDB', file 'MYDB_Data' on file 1.
Processed 1 pages for database 'MYDB', file 'MYDB_Log' on file 1.
Converting database 'MYDB' from version 539 to the current version 611.
Database 'MYDB' running the upgrade step from version 539 to version 551.

Warning: The index "myt_idx01" on "dbo"."myt" may be impacted by the
collation upgrade. Run DBCC CHECKTABLE.
Warning: The index "PK_BankLDef" on
"dbo"."BankLDef" may be impacted by the collation
upgrade. Run DBCC CHECKTABLE.
Warning: The index "AgreeHist_idx1" on
"dbo"."AgreeHist" may be impacted by the collation upgrade.
Run DBCC CHECKTABLE.
....
....
Database 'MYDB' running the upgrade step from version 551 to version 552.
Database 'MYDB' running the upgrade step from version 552 to version 553.
Database 'MYDB' running the upgrade step from version 553 to version 554.
Database 'MYDB' running the upgrade step from version 554 to version 589.
Database 'MYDB' running the upgrade step from version 589 to version 590.
Database 'MYDB' running the upgrade step from version 590 to version 593.
Database 'MYDB' running the upgrade step from version 593 to version 597.
Database 'MYDB' running the upgrade step from version 597 to version 604.
Database 'MYDB' running the upgrade step from version 604 to version 605.
Database 'MYDB' running the upgrade step from version 605 to version 606.
Database 'MYDB' running the upgrade step from version 606 to version 607.
Database 'MYDB' running the upgrade step from version 607 to version 608.
Database 'MYDB' running the upgrade step from version 608 to version 609.
Database 'MYDB' running the upgrade step from version 609 to version 610.
Database 'MYDB' running the upgrade step from version 610 to version 611.

RESTORE DATABASE successfully processed 345 pages in 0.420 seconds
(6.712 MB/sec).

What is the severity of this warnings? Is there a way to make them disappear?
Thanks in Advance.

Adnan

View 1 Replies View Related

Backup And Restore Databases In My MSDE

Jul 13, 2004

Hi all! How can i backup databases which are running in my MSDE 2000 & then how can i restore them with all the data, Yes i know that their is no visual tool for doing this in MSDE but can we do it with scripts, if Yes then how

View 1 Replies View Related

Dbbackup.exe To Backup MSDE Instance

Feb 16, 2007

I'm running a Scheduled Task to execute dbbackup.exe to backup a local MSDE Instance for Live Comm. Server. When I save it to the local drive it works fine but I'm trying to save the backup to a remote server. I can't seem to get it to work. The account being used has full access to the remote computer and backup folder share.

Syntax:

"C:program filesms lcs 2005serversupportdbbackup.exe" /backupfile:\servernameackupmsdebackup

but when I run the following it works fine:
"C:program filesms lcs 2005serversupportdbbackup.exe" /backupfile:c:ackupmsdebackp

Any ideas? Thanks for any help!!!

View 3 Replies View Related

Backup / Restore Question - MSDE

Jul 20, 2005

MSDE2000I have an application in which I am running a TSQL command of BACKUP DATABASE and RESTORE DATABASE for the backup and restore commands for my application. For testing purposes, i did the following:1) Ran a BACKUP DATABASE command to a file named C:TEST.BAK.2) Deleted the database completely.3) Ran a RESTORE DATABASE on the same file (note, I did NOT recreate the database)Now I have the database back with all my data. What are the gotchas when doing a backup and restore using this method? I am not relying on transaction logs to restore to a certain point, the user can only restore back to their last backup (may be daily, weekly or monthly)TIA-- Tim Morrison

View 3 Replies View Related

Automatic Backup Of MSDE Database.

Jul 20, 2005

Hi,How to automate database backup (MSDE server v8.0)? Is some free toolwhich can help on this or can I use some stored procedure? Plan:Complete - 1 per weekDifferential - 1 per day--*Best regards,*Klaudiusz Bryja

View 3 Replies View Related

Backup Agent For Msde Sql Version 2005

Jan 15, 2007

please help me, i need to know if i need to purchase a sql agent for veritas backup exec. i am using the sql msde version only, not the full scale version. any help would be great.

View 4 Replies View Related

MSDE Text Datatype - Unable To Store More Than 900 Characters. (msde + Visual Studio 2003)

Jun 6, 2005

Hello,

I'm not sure if it's the setup I did wrong, but I can't seem to get my
text datatype in my database to store more than 900 characters. 
I'm trying to setup a news database for my website, which will populate
the information into a datagrid.  To test, I manually added a news
item in the database through the visual studio 2003 gui.  I
immediately noticed a problem as the I was getting an error after a
long news item saying:

"The value you entered is not consistent with the data type or length of the column, or over grid buffer limit."

I couldn't find anthing to set the buffer limit and the datatype is
"text" filled with simple text in the column.  As a further test,
I
simply entered 12334567890123... up to 900 characters and still
recevied the error.

I would appreciate someone leading me in the right direction on this one.

Thanks a lot.

View 1 Replies View Related

How Do I Change The Name Of A Computer Running MSDE With Out Reinstalling MSDE

May 27, 2000

I am trying to change the computer name of a machine running MSDE but I get an error when SQL Server starts. With regular SQL when I change the name of a computer I re-run setup and setup fixes this problem. MSDE can only be installed from unattended mode so I can’t rerun setup and fix the problem.

My question is "How do I change the name of a computer running MSDE with out reinstalling MSDE"

View 1 Replies View Related

MSDE: Renaming Machine Without Reinstall Of MSDE

Mar 27, 2001

We currently have the problem, that all our machines are produced with the
same name and afterwards the name is changed. So we have the problem that
the checksum key for the MSDE isn't valid anymore. As MSDE can only be installed
from unattended mode so I can’t rerun setup and fix the problem. Does anyone
know a solution for this problem ?? A program recalculating the cheksum ??

regards,

Manfred

View 3 Replies View Related

MSDE Worth Using Or Should I Invest In MySQL? (was MSDE)

Mar 9, 2005

I'm not sure if this is the correct forum for this this question but I'll give it a shot.

The only db development that I have ever done is in MS Access. I have a project at work that is being accomplished in VB and I need a db engine to use as the back end. Visual studio came with a copy of MSDE. Is this tool worth using or should I invest in mySQL? Are there any advantages to using MSDE over mySQL?

View 4 Replies View Related

BACKUP LOG Cannot Be Performed Because There Is No Current Database Backup. BACKUP LOG Is Terminating Abnormally.

Jan 31, 2008



Hi there

I'm getting this message on my third automated backup of the transaction logs of the day. Both databases are in full recovery mode, both successfully backed up at 01.00. The transaction logs backed up perfectly happily at 01:30 and 05:30, but failed at 09:30.

The only difference between 05:30 and 09:30's backups is that the log files were shrunk at 08:15 (the databases in question are the ones that sit under ILM2007, and keeping the log files small keeps the system running better).


Is it possible that shrinking the log files causes the database to think that there hasn't been a full database backup?

Thanks

Jane

View 3 Replies View Related

Re-Attaching DB

Aug 10, 2005

Forgive my ignorance, but I'm just working thru some examples, and I tried to reattach a db to another server, without the log file I created for the db. Having reattached it, it worked fine - without the log file??? Where does it make any log records? Why didn't it complain?

View 3 Replies View Related

Attaching MDF Without LDF

Oct 27, 2005

Hi GuysI'm recovering from a hard disk crash, trying to reattach recoveredfiles.The MDF file seems fine, but I get:"Server: Msg 9004, Level 23, State 1, Line 1An error occurred while processing the log for database'NetCoverAdmin'."when I try to include the LDF file. My command was:EXEC sp_attach_db @dbname = N'NetCoverAdmin',@filename1 = N'c:Program FilesMicrosoft SQLServerMSSQLDataNetcoverAdmin_Data.MDF',@filename2 = N'c:Program FilesMicrosoft SQLServerMSSQLDataNetcoverAdmin_Log.LDF'Is there any way I can restore the database without the LDF file?My backups where on another disk that mysteriously failed at the sametime, so I have to work what I got...Any help appreciated!!Thanks

View 2 Replies View Related

Attaching Files

Jun 21, 2005

I have just started using ASP.net.I have to develop a system that attaches word and PDF files to form.  I also need to be able to do a full text search on the documents attached.I'm currently using SQL server 2000 as my backend DBMS, but I have never used it to attach files. My mates recommend using BLOGS but I'm not sure how to do this and I'm not sure if I can do a full text search using this solution.Could some body please recommend a solution to get me started.Thanks in advancedPaddy

View 1 Replies View Related

Error Attaching .mdf

Feb 2, 2006

I have been asked to edit a web based database and have been given the site on cd.
I have installed IIS, sql server express and Visual Web Developer express.
I am having problems getting the mdf database connected. It works at the school where they have it installed and as far as I know I have mirrored the configuration they have on one  of my test servers.
The database is in App_Data
the connection string is "Data Source=.SQLEXPRESS;AttachDbFilename=c:inetpubwwwrootApp_Datacampbell.mdf;Integrated Security=True;User Instance=True"
And the state is closed.
When I view one of the aspx pages in IE I get the following.

Server Error in '/' Application.


Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level.  This error can be caused by a virtual directory not being configured as an application in IIS.Source Error:



Line 6: <compilation defaultLanguage="vb" debug="true" />
Line 7: <customErrors mode="Off" />
Line 8: <authentication mode="Windows" />
Line 9: <trace enabled="false" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="true" />
Line 10: <sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;user id=sa;password=" cookieless="false" timeout="20" />Source File: c:inetpubwwwrootappcampbell_houseweb.config    Line: 8
The common error is:
"Error 1 It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level.  This error can be caused by a virtual directory not being configured as an application in IIS. c:inetpubwwwrootAppCampbell_HouseWeb.config 8 "
When I test the database connection I get a message
The header file for 'c:inetpubwwwrootApp_Datacampbell.mdf ' is not a valid database file header. The File Size property is incorrect. An attempt to attach an auto named database  for file 'c:inetpubwwwrootApp_Datacampbell.mdf ' failed.A database with the same name existsor the specified file cannot be opened or it is located on a UNC share
Any help would be great.

View 3 Replies View Related

Attaching 6.5 Databases To 7.0

Mar 17, 2001

Hi there:

Can any one help me for attaching the 6.5 databases to 7.0

Thanks,Jay

View 3 Replies View Related

Re-Attaching Databases

May 5, 2004

Haven't posted in a while but got great advice the last time I did - http://www.dbforums.com/t573220.html
I hope someone can give me some advice this time.

Due to a flawed Microsoft hotfix the o/s on which my SQL Server was trashed completely causing me to lose some databases completely. The o/s and SQL Server have now been reinstalled (same version as before).

I have about 716 databases and logfiles which I need to re-attach to the server. I don't have the old master db or a db of all the database names. I was thinking I could write an asp script using FSO to get all the database & log file names & paths and attach them using sp_attach_db.

If anyone knows an easier way to do it or has advice to give, I would be really greatful.

View 5 Replies View Related

Detaching And Attaching

Dec 10, 2006

Hi,
Im not new to SQL Server but I am new to v.2005. We have done a class project and to finish up I am creating schemas, logins and different user roles and permissions.
I now need to detach the DB and send it to our team leader for submission. I'm scared to do this because I don't know if all the logins and passwords I've created will appear in it's new location. Will they be there in the new server's security folder just as I created them or will they dissapear into the ether?
Signed:
Sweating very much


It is better to be prepared and not have an opportunity than to not be prepared and have an opportunity

View 7 Replies View Related

Renaming While Attaching

Apr 26, 2007

I am using SQL Server Management Studio with SQL Server 2005. On my development SQL server, I have developers using a database named TestData. An off-site developer has sent new versions of TestData.MDF and TestData.LDF. I want to attach this new database to the same development server for testing, without overwriting the existing database in use by the developers. How can I rename this new TestData to something like TestDataNew while attaching it? I only have the MDF and LDF files.

Thanks.

View 2 Replies View Related

Attaching A Database

Apr 2, 2008



The situation :
I am making mass changes to my program and database.
The goal is to not make changes to the database at the customer sites, but to clone their current database, and work with that one.

The solution:
I wrote code and queries to detach the database, copy it to another directory on the same computer with a different name, then attach it with the new name.
The process is:
run : sp_detach_db "' + aDatabase + '", ''false'';' (aDatabase is the original database name)
Then, in code, delete the original .ldf file, and copy the database.mdf file to new directory with new name.
then run (for both the new and the original databases):

Create Database "' + aDatabase + '" on
(NAME = ''' + aDatabase + ''', FILENAME = ''' + FormatFilePath(aPath) + aDatabase + '.mdf''
For Attach

This works, up to a point.
The problem :
When I inspect the properties of the newly attached database, with the new name and new directory, the logical name of the database is still the original name.


I TRIED running this query :
sp_attach_single_file_db @dbName= "' + aDatabase + '",'
@physname= ''' + FormatFilePath(aPath) + aDatabase + '.mdf'

but it returns(even though I have deleted the .ldf files for the original dataset) :
Could not open new database 'Test62'. CREATE DATABASE is aborted.
Cannot create file 'E:Data6Test62Test62_log.LDF' because it already exists. Change the file path or the file name, and retry the operation.
File activation failure. The physical file name "E:Data6TestTest_log.LDF" may be incorrect.

(original database name = data6 est est, new database name is data6 est62 est62)
Is there a way to do this? Or do I just need to give it up?

View 1 Replies View Related

Attaching DB Without .ldf File ???

Aug 12, 2006

hi !!

I want to attach database to SQL Server, but I'hv only .mdf file.

I lost .ldf file, how should i attach this DB to server ?

Thanks

SP



View 38 Replies View Related

Help Attaching The Database

Oct 11, 2007



hello
i am having a problem attaching database.
The Problem :


I have created a database using sqlserver express edition.now i have installed enterprise edition ,so i am attaching the database which is created in sqlserver express edition into the enterprise edition.it is showing error


TITLE: Microsoft SQL Server Management Studio
------------------------------
Attach database failed for Server 'SRINIVAS'. (Microsoft.SqlServer.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.1399.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Attach+database+Server&LinkId=20476
------------------------------
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
------------------------------
Could not find row in sysindexes for database ID 13, object ID 1, index ID 1. Run DBCC CHECKTABLE on sysindexes.
Could not open new database 'FMS'. CREATE DATABASE is aborted. (Microsoft SQL Server, Error: 602)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=602&LinkId=20476
------------------------------
BUTTONS:
OK
------------------------------
Can anyone Help me

thanks

View 1 Replies View Related

Attaching A DB In Express 2005

Jun 14, 2007

I am having trouble attaching a db to ms sql express 2005.I have the db in a folder deep down in my drive, within an asp.net website project. For some wierd reason i can't drill down more than two levels to get to the DB Anyone have any ideas why? Ilan   

View 3 Replies View Related

Attaching DB And Mapping Users

Oct 15, 2007

I am trying to attach a db to SQL Server 2005 and assign a User to the DB that can read and write.  I am using one user (CreateDBs) to attach the DB and a second user (TestUser) to do the reading and writing.  I run the following code and the DB is attached but I get the following error when I run the code below.
********************ERROR********************
System.Data.SqlClient.SqlException: Cannot open database "hello2" requested by the login. The login failed.
Login failed for user 'CreateDBs'.
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK)
at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject)
at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart)
at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)
at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.SqlClient.SqlConnection.Open()
at NewSite.submit_Click(Object sender, EventArgs e) in X:InetpubRMA4NewSite.aspx.vb:line 120
 
********************CODE********************
'Need to attach to SQL Server
Dim objConn As New SqlConnection("Server=Web-testbedSQLExpress;uid=CreateDBs;pwd=ABC123;database=master")
objConn.Open()Dim objCmd As New SqlCommand("EXEC sp_attach_db @dbname = N'" & sitename & "', @filename1 = N'X:sites" & sitename & "Database" & sitename & ".mdf', @filename2 = N'X:sites" & sitename & "Database" & sitename & "_log.ldf'", objConn)
objCmd.CommandType = CommandType.Text
objCmd.ExecuteNonQuery()
objConn.Close()objConn = New SqlConnection("Server=Web-testbedSQLExpress;uid=CreateDBs;pwd=ABC123;database=" & sitename)
objConn.Open()objCmd = New SqlCommand("EXEC sp_addrolemember db_datareader, TestUser", objConn)
objCmd.CommandType = CommandType.Text
objCmd.ExecuteNonQuery()
objConn.Close()objConn = New SqlConnection("Server=Web-testbedSQLExpress;uid=CreateDBs;pwd=ABC123;database=" & sitename)
objConn.Open()objCmd = New SqlCommand("EXEC sp_addrolemember db_datawriter, TestUser", objConn)
objCmd.CommandType = CommandType.Text
objCmd.ExecuteNonQuery()
objConn.Close()
 
It still doesn't work if I use sa as the user.  I know I am missing a step, what is it? 

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved