Showing posts with label located. Show all posts
Showing posts with label located. Show all posts

Friday, February 24, 2012

Attempting to Connect to SQLServer 2k

This is the code I'm using on the web page located on the server:

Dim strConn as String
Dim conn as SQLConnection
strConn="server=localhost;Trusted_Connection=Yes;database=CIS"

conn=New SQLConnection(strConn)
conn.Open()

and the error messgae I receive is: Login failed for user 'MSP00427\ASPNET'.

msp00427 is the name of the server
= = = = = = = = =

I have an MSAccess application that accesses the same database as follows with no trouble.

glblConnectString = "Driver=SQL Server;Server=msp00427;Database=CIS;Trusted_Connection=Yes"

Set cnn = New ADODB.Connection
cnn.Open glblConnectString
Set cmd = New ADODB.Command
cmd.ActiveConnection = cnn
cmd.CommandText = "Scorecard_Delete_ATLASDataDump"
cmd.CommandType = adCmdStoredProc
cmd.Execute

This is run on my PC and I have sa capabilities on the server.

The .NET framework is installed.

Any ideas why the data access on the web page fails?you need to add the user 'MSP00427\ASPNET' to the db and giv ehim permissions. if yo xpand the databases tab on your sql server xplorer and then the database you are trying to connect to, you would see a Users tab. right click and add new user..

hth|||In SQL Server Enterprise Manager (or using scripts) you must add the 'MSP00427\ASPNET' windows user as a SQL Server user.

When you access an ASP.NET app, it is not YOUR rights that count, but the rights of the ASPNET user (by default).|||Thanks to those who responded so quickly.

I had just figured it out and tested it.

I was now coming back to post the solution for others.

You beat me to it.

Sunday, February 19, 2012

attempt to copy 2005 db ouside my network shows wrong db?

I connected to an sql 2005 located out on the Internet.
I can export the database I have permissions for and its data ok.
When I right click on the db and choose copy, I get an error at the end of the
wizard saying that Database 'dbThatIsDifferentThanMine' cannot be opened because
it is offline. Error 942.
That database shows up in the managment console, and it is offline, but it is
not the one I right clicked on to copy. I don't have permission to put that
database online, just permissions for the one I want to copy.
How can I resolve this?
--
Thanks in advance, Les CaudleHi
I am not sure why this is not selecting your database when you right click!
Have you tried left clicking before you right click?
An althernative you be to backup and restore the database into a new copy,
you can do this in a query window. If you need to do this often then creating
a script will probably end up being quicker.
John
"Les Caudle" wrote:
> I connected to an sql 2005 located out on the Internet.
> I can export the database I have permissions for and its data ok.
> When I right click on the db and choose copy, I get an error at the end of the
> wizard saying that Database 'dbThatIsDifferentThanMine' cannot be opened because
> it is offline. Error 942.
> That database shows up in the managment console, and it is offline, but it is
> not the one I right clicked on to copy. I don't have permission to put that
> database online, just permissions for the one I want to copy.
> How can I resolve this?
> --
> Thanks in advance, Les Caudle
>|||John - Yes, I'd clicked on the database first. Very strange.
This is on a client's ISP's shared web server. I only have access to his
database - and am going to need to grab it.
Can I backup and restore in this circumstance - as you suggested? I think I'm
going to be limited in what I can do.
Thanks, Les Caudle
On Sun, 25 Jun 2006 00:00:02 -0700, John Bell <jbellnewsposts@.hotmail.com>
wrote:
>Hi
>I am not sure why this is not selecting your database when you right click!
>Have you tried left clicking before you right click?
>An althernative you be to backup and restore the database into a new copy,
>you can do this in a query window. If you need to do this often then creating
>a script will probably end up being quicker.
>John
>"Les Caudle" wrote:
>> I connected to an sql 2005 located out on the Internet.
>> I can export the database I have permissions for and its data ok.
>> When I right click on the db and choose copy, I get an error at the end of the
>> wizard saying that Database 'dbThatIsDifferentThanMine' cannot be opened because
>> it is offline. Error 942.
>> That database shows up in the managment console, and it is offline, but it is
>> not the one I right clicked on to copy. I don't have permission to put that
>> database online, just permissions for the one I want to copy.
>> How can I resolve this?
>> --
>> Thanks in advance, Les Caudle|||Les Caudle wrote:
> John - Yes, I'd clicked on the database first. Very strange.
> This is on a client's ISP's shared web server. I only have access to his
> database - and am going to need to grab it.
> Can I backup and restore in this circumstance - as you suggested? I think I'm
> going to be limited in what I can do.
>
Providing you can connect with Query Analyzer or Management Studio, and
have a directory that SQL can write to, you should be able to use the
BACKUP and RESTORE commands to do a backup and restore.|||Hi
To backup the datbase you will need in the db_backupoperator, db_owner or a
sysadmin role, for restoring you will need to be a sysadmin or in dbcreator
role.
To use sp_attach_db you will need CREATE DATABASE, CREATE ANY DATABASE, or
ALTER ANY DATABASE permission, for sp_detach_db you will need to be a
db_owner.
I suspect that the copy wizard may not be working because you fail on some
or all of these privileges. By doing a manual backup you may get a message
saying that you do not have the privileges to carry out the opertation.
John
"Les Caudle" wrote:
> John - Yes, I'd clicked on the database first. Very strange.
> This is on a client's ISP's shared web server. I only have access to his
> database - and am going to need to grab it.
> Can I backup and restore in this circumstance - as you suggested? I think I'm
> going to be limited in what I can do.
> Thanks, Les Caudle
>
> On Sun, 25 Jun 2006 00:00:02 -0700, John Bell <jbellnewsposts@.hotmail.com>
> wrote:
> >Hi
> >
> >I am not sure why this is not selecting your database when you right click!
> >Have you tried left clicking before you right click?
> >
> >An althernative you be to backup and restore the database into a new copy,
> >you can do this in a query window. If you need to do this often then creating
> >a script will probably end up being quicker.
> >
> >John
> >
> >"Les Caudle" wrote:
> >
> >> I connected to an sql 2005 located out on the Internet.
> >>
> >> I can export the database I have permissions for and its data ok.
> >>
> >> When I right click on the db and choose copy, I get an error at the end of the
> >> wizard saying that Database 'dbThatIsDifferentThanMine' cannot be opened because
> >> it is offline. Error 942.
> >>
> >> That database shows up in the managment console, and it is offline, but it is
> >> not the one I right clicked on to copy. I don't have permission to put that
> >> database online, just permissions for the one I want to copy.
> >>
> >> How can I resolve this?
> >> --
> >> Thanks in advance, Les Caudle
> >>
>

attempt to copy 2005 db ouside my network shows wrong db?

I connected to an sql 2005 located out on the Internet.
I can export the database I have permissions for and its data ok.
When I right click on the db and choose copy, I get an error at the end of
the
wizard saying that Database 'dbThatIsDifferentThanMine' cannot be opened bec
ause
it is offline. Error 942.
That database shows up in the managment console, and it is offline, but it i
s
not the one I right clicked on to copy. I don't have permission to put that
database online, just permissions for the one I want to copy.
How can I resolve this?
--
Thanks in advance, Les CaudleHi
I am not sure why this is not selecting your database when you right click!
Have you tried left clicking before you right click?
An althernative you be to backup and restore the database into a new copy,
you can do this in a query window. If you need to do this often then creatin
g
a script will probably end up being quicker.
John
"Les Caudle" wrote:

> I connected to an sql 2005 located out on the Internet.
> I can export the database I have permissions for and its data ok.
> When I right click on the db and choose copy, I get an error at the end o
f the
> wizard saying that Database 'dbThatIsDifferentThanMine' cannot be opened b
ecause
> it is offline. Error 942.
> That database shows up in the managment console, and it is offline, but it
is
> not the one I right clicked on to copy. I don't have permission to put th
at
> database online, just permissions for the one I want to copy.
> How can I resolve this?
> --
> Thanks in advance, Les Caudle
>|||Hi
I am not sure why this is not selecting your database when you right click!
Have you tried left clicking before you right click?
An althernative you be to backup and restore the database into a new copy,
you can do this in a query window. If you need to do this often then creatin
g
a script will probably end up being quicker.
John
"Les Caudle" wrote:

> I connected to an sql 2005 located out on the Internet.
> I can export the database I have permissions for and its data ok.
> When I right click on the db and choose copy, I get an error at the end o
f the
> wizard saying that Database 'dbThatIsDifferentThanMine' cannot be opened b
ecause
> it is offline. Error 942.
> That database shows up in the managment console, and it is offline, but it
is
> not the one I right clicked on to copy. I don't have permission to put th
at
> database online, just permissions for the one I want to copy.
> How can I resolve this?
> --
> Thanks in advance, Les Caudle
>|||John - Yes, I'd clicked on the database first. Very strange.
This is on a client's ISP's shared web server. I only have access to his
database - and am going to need to grab it.
Can I backup and restore in this circumstance - as you suggested? I think I
'm
going to be limited in what I can do.
Thanks, Les Caudle
On Sun, 25 Jun 2006 00:00:02 -0700, John Bell <jbellnewsposts@.hotmail.com>
wrote:
[vbcol=seagreen]
>Hi
>I am not sure why this is not selecting your database when you right click!
>Have you tried left clicking before you right click?
>An althernative you be to backup and restore the database into a new copy,
>you can do this in a query window. If you need to do this often then creati
ng
>a script will probably end up being quicker.
>John
>"Les Caudle" wrote:
>|||John - Yes, I'd clicked on the database first. Very strange.
This is on a client's ISP's shared web server. I only have access to his
database - and am going to need to grab it.
Can I backup and restore in this circumstance - as you suggested? I think I
'm
going to be limited in what I can do.
Thanks, Les Caudle
On Sun, 25 Jun 2006 00:00:02 -0700, John Bell <jbellnewsposts@.hotmail.com>
wrote:
[vbcol=seagreen]
>Hi
>I am not sure why this is not selecting your database when you right click!
>Have you tried left clicking before you right click?
>An althernative you be to backup and restore the database into a new copy,
>you can do this in a query window. If you need to do this often then creati
ng
>a script will probably end up being quicker.
>John
>"Les Caudle" wrote:
>|||Les Caudle wrote:
> John - Yes, I'd clicked on the database first. Very strange.
> This is on a client's ISP's shared web server. I only have access to his
> database - and am going to need to grab it.
> Can I backup and restore in this circumstance - as you suggested? I think
I'm
> going to be limited in what I can do.
>
Providing you can connect with Query Analyzer or Management Studio, and
have a directory that SQL can write to, you should be able to use the
BACKUP and RESTORE commands to do a backup and restore.|||Les Caudle wrote:
> John - Yes, I'd clicked on the database first. Very strange.
> This is on a client's ISP's shared web server. I only have access to his
> database - and am going to need to grab it.
> Can I backup and restore in this circumstance - as you suggested? I think
I'm
> going to be limited in what I can do.
>
Providing you can connect with Query Analyzer or Management Studio, and
have a directory that SQL can write to, you should be able to use the
BACKUP and RESTORE commands to do a backup and restore.|||Hi
To backup the datbase you will need in the db_backupoperator, db_owner or a
sysadmin role, for restoring you will need to be a sysadmin or in dbcreator
role.
To use sp_attach_db you will need CREATE DATABASE, CREATE ANY DATABASE, or
ALTER ANY DATABASE permission, for sp_detach_db you will need to be a
db_owner.
I suspect that the copy wizard may not be working because you fail on some
or all of these privileges. By doing a manual backup you may get a message
saying that you do not have the privileges to carry out the opertation.
John
"Les Caudle" wrote:

> John - Yes, I'd clicked on the database first. Very strange.
> This is on a client's ISP's shared web server. I only have access to his
> database - and am going to need to grab it.
> Can I backup and restore in this circumstance - as you suggested? I think
I'm
> going to be limited in what I can do.
> Thanks, Les Caudle
>
> On Sun, 25 Jun 2006 00:00:02 -0700, John Bell <jbellnewsposts@.hotmail.com>
> wrote:
>
>|||Hi
To backup the datbase you will need in the db_backupoperator, db_owner or a
sysadmin role, for restoring you will need to be a sysadmin or in dbcreator
role.
To use sp_attach_db you will need CREATE DATABASE, CREATE ANY DATABASE, or
ALTER ANY DATABASE permission, for sp_detach_db you will need to be a
db_owner.
I suspect that the copy wizard may not be working because you fail on some
or all of these privileges. By doing a manual backup you may get a message
saying that you do not have the privileges to carry out the opertation.
John
"Les Caudle" wrote:

> John - Yes, I'd clicked on the database first. Very strange.
> This is on a client's ISP's shared web server. I only have access to his
> database - and am going to need to grab it.
> Can I backup and restore in this circumstance - as you suggested? I think
I'm
> going to be limited in what I can do.
> Thanks, Les Caudle
>
> On Sun, 25 Jun 2006 00:00:02 -0700, John Bell <jbellnewsposts@.hotmail.com>
> wrote:
>
>

Sunday, February 12, 2012

Attaching 6.5 db files

Hello everyone,
I'm in a situation with a 3rd party where they have 3 .dat files (no log fil
es) from a SQL 6.5 database. These files were located on a backup tape from
2001. The client would like to make this database operational again. The
master.dat file was not rec
overable, nor was the log file. Is there any way to "attach" these files so
we can ultimately upgrade to SQL 2000? Any input would be appreciatedYou would need a 6.5 installation to begin with. Then you would either use
LOAD ("restore") if the DAT file is a backup file (produced with DUMP) or
use DISK REINIT and DISK REFIT if it is a database file (which I'm sure
requires all the database devices that constituted the database).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"Mike" <mjucht@.neb.rr.com> wrote in message
news:E27B27A7-F299-473A-A816-42C757AE8330@.microsoft.com...
> Hello everyone,
> I'm in a situation with a 3rd party where they have 3 .dat files (no log
files) from a SQL 6.5 database. These files were located on a backup tape
from 2001. The client would like to make this database operational again.
The master.dat file was not recoverable, nor was the log file. Is there any
way to "attach" these files so we can ultimately upgrade to SQL 2000? Any
input would be appreciated|||Mike
You can not attach SQL 6.5 databases, it was not a feature available at that
time.
If you have the dat files you may be able to restore the database to a SQL S
erver 6.5 installation and then upgrade. Although you only have .dat files y
ou may have the logs, in 6.5 you do not have to seperate the data and logs s
o the .dat files may contai
n both.
However even if you do have the entire database in the files you have, you s
till will not be able to restore the database unless you build it exactly li
ke it was. What this means is that say you had a 300mb 6.5 database that was
created as 100mb and expan
ded by 100mb twice. You would need to create an empty database in exactly th
e same way before you could restore it.
The best way to restore a 6.5 database is to have the output from sp_help_re
vdatabase available. I don't suppose you have that do you?
Hope this helps
John|||I'm reading up on the DISK REINIT command and it states the SIZE parameter m
ust be identical to how the device was originally created. Is there any way
to tell how the device was originally created without the master.dat? I'm
afraid the answer is "no" b
ut if you have any ideas I'd appreciate them.
Thanks,
Mike
-- Tibor Karaszi wrote: --
You would need a 6.5 installation to begin with. Then you would either use
LOAD ("restore") if the DAT file is a backup file (produced with DUMP) or
use DISK REINIT and DISK REFIT if it is a database file (which I'm sure
requires all the database devices that constituted the database).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"Mike" <mjucht@.neb.rr.com> wrote in message
news:E27B27A7-F299-473A-A816-42C757AE8330@.microsoft.com...
> Hello everyone,
files) from a SQL 6.5 database. These files were located on a backup tape
from 2001. The client would like to make this database operational again.
The master.dat file was not recoverable, nor was the log file. Is there any
way to "attach" these files so we can ultimately upgrade to SQL 2000? Any
input would be appreciated|||You have the physical file size, and can go on that!
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"Mike" <mjucht@.hotmail.com> wrote in message
news:ECC5EA3A-2283-45A5-87A6-F29156BD01B4@.microsoft.com...
> I'm reading up on the DISK REINIT command and it states the SIZE parameter
must be identical to how the device was originally created. Is there any
way to tell how the device was originally created without the master.dat?
I'm afraid the answer is "no" but if you have any ideas I'd appreciate them.
> Thanks,
> Mike
> -- Tibor Karaszi wrote: --
> You would need a 6.5 installation to begin with. Then you would
either use
> LOAD ("restore") if the DAT file is a backup file (produced with
DUMP) or
> use DISK REINIT and DISK REFIT if it is a database file (which I'm
sure
> requires all the database devices that constituted the database).
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
>
> "Mike" <mjucht@.neb.rr.com> wrote in message
> news:E27B27A7-F299-473A-A816-42C757AE8330@.microsoft.com...
(no log
> files) from a SQL 6.5 database. These files were located on a backup
tape
> from 2001. The client would like to make this database operational
again.
> The master.dat file was not recoverable, nor was the log file. Is
there any
> way to "attach" these files so we can ultimately upgrade to SQL 2000?
Any
> input would be appreciated
>
>