Wednesday, March 28, 2012
Problem with backup and restore
of this DB can't connect to this DB. I am getting teh error "login failed
for user 'somebody' ".
In DB Folder Users , this user exist.Vaidas
Search on internet for two stored procedures ('sp_help_revlogin') provided
by MS to move logins with their original SID
"Vaidas Gudas" <vaidas.gudas@.rst.lt> wrote in message
news:%23Dp$na43FHA.3880@.TK2MSFTNGP12.phx.gbl...
> When I am backuping and after restoring the DB on another server, all
> Users of this DB can't connect to this DB. I am getting teh error "login
> failed for user 'somebody' ".
> In DB Folder Users , this user exist.
>|||Hi ,
use dts tranfer login task . It will tranfer all the logins to the
restored database server.
from
Doller
Uri Dimant wrote:
> Vaidas
> Search on internet for two stored procedures ('sp_help_revlogin') provided
> by MS to move logins with their original SID
> "Vaidas Gudas" <vaidas.gudas@.rst.lt> wrote in message
> news:%23Dp$na43FHA.3880@.TK2MSFTNGP12.phx.gbl...
> > When I am backuping and after restoring the DB on another server, all
> > Users of this DB can't connect to this DB. I am getting teh error "login
> > failed for user 'somebody' ".
> > In DB Folder Users , this user exist.
> >|||yes but not with their oridinal SID
"doller" <sufianarif@.gmail.com> wrote in message
news:1130921760.840115.43300@.g14g2000cwa.googlegroups.com...
> Hi ,
> use dts tranfer login task . It will tranfer all the logins to the
> restored database server.
> from
> Doller
> Uri Dimant wrote:
>> Vaidas
>> Search on internet for two stored procedures ('sp_help_revlogin')
>> provided
>> by MS to move logins with their original SID
>> "Vaidas Gudas" <vaidas.gudas@.rst.lt> wrote in message
>> news:%23Dp$na43FHA.3880@.TK2MSFTNGP12.phx.gbl...
>> > When I am backuping and after restoring the DB on another server, all
>> > Users of this DB can't connect to this DB. I am getting teh error
>> > "login
>> > failed for user 'somebody' ".
>> > In DB Folder Users , this user exist.
>> >
>sql
Wednesday, March 21, 2012
Problem with 2 Dataset Sharing Parameters
period of time (@.StartDate, @.EndDate). Optionally the report has option to
select a single user (@.UserName) or just all of them. There are 2 datasets.
First dataset: Bugs requires 3 parameters: @.StartDate, @.EndDate, @.UserName.
Second dataset: UserName. At first I have a query to list all users. Since
the list has hundreds of users while the result set from dataset Bugs mostly
has less than 10 users, I built another query to list only users having bugs
assigned from @.StartDate to @.EndDate. So it requires 2 parameters @.StartDate
and @.Enddate.
Now both datasets use @.StartDate and @.EndDate. The list to select for
@.UserName is produced after @.StartDate and @.EndDate are entered. I expected
the report to let me select the username after I enter @.StartDate and
@.EndDate. However in the preview tab right at the moment when I clicked on
the box for @.EndDate to enter a value the program hang up (VS 2003). I
uploaded it to a report server to see how it behaves then I got this error
after I click on the EndDate box: The value provided for the report
parameter 'EndDate' is not valid for its type.
(rsReportParameterTypeMismatch).
I don't know what's wrong. If I change the dataset UserName to list all
users (no parameter required) then the report runs fine. I use Visual
Studio .NET 2003 Service Pack 1, report server is SQL 2000 with latest SP on
the O/S, SQL, and SQL RS.
An thought?
Thanks.On May 2, 5:31 pm, "ME" <M...@.mail.com> wrote:
> I have a report that will pull out a list of bugs assigned to users for a
> period of time (@.StartDate, @.EndDate). Optionally the report has option to
> select a single user (@.UserName) or just all of them. There are 2 datasets.
> First dataset: Bugs requires 3 parameters: @.StartDate, @.EndDate, @.UserName.
> Second dataset: UserName. At first I have a query to list all users. Since
> the list has hundreds of users while the result set from dataset Bugs mostly
> has less than 10 users, I built another query to list only users having bugs
> assigned from @.StartDate to @.EndDate. So it requires 2 parameters @.StartDate
> and @.Enddate.
> Now both datasets use @.StartDate and @.EndDate. The list to select for
> @.UserName is produced after @.StartDate and @.EndDate are entered. I expected
> the report to let me select the username after I enter @.StartDate and
> @.EndDate. However in the preview tab right at the moment when I clicked on
> the box for @.EndDate to enter a value the program hang up (VS 2003). I
> uploaded it to a report server to see how it behaves then I got this error
> after I click on the EndDate box: The value provided for the report
> parameter 'EndDate' is not valid for its type.
> (rsReportParameterTypeMismatch).
> I don't know what's wrong. If I change the dataset UserName to list all
> users (no parameter required) then the report runs fine. I use Visual
> Studio .NET 2003 Service Pack 1, report server is SQL 2000 with latest SP on
> the O/S, SQL, and SQL RS.
> An thought?
> Thanks.
The issue sounds kind of strange. Maybe you should check to make sure
that you have the correct @.EndDate mapping as part of the UserName
dataset (via the Data tab -> Edit Selected Dataset button [...] ->
Parameters tab). Also, make sure that the stored procedure/query that
sources the UserName dataset is not expecting a different data type
for @.EndDate (for whatever reason). Sorry I could not be of greater
assistance.
Regards,
Enrique Martinez
Sr. Software Consultant|||Thanks for the reply. I use datatime as data type for @.StartDate, @.EndDate
in both datasets. Double checked everything but still have no clue why.
When I learned and practiced SQL 2005 I had no problem doing similar thing.
"EMartinez" <emartinez.pr1@.gmail.com> wrote in message
news:1178160515.514988.169100@.e65g2000hsc.googlegroups.com...
> On May 2, 5:31 pm, "ME" <M...@.mail.com> wrote:
>> I have a report that will pull out a list of bugs assigned to users for a
>> period of time (@.StartDate, @.EndDate). Optionally the report has option
>> to
>> select a single user (@.UserName) or just all of them. There are 2
>> datasets.
>> First dataset: Bugs requires 3 parameters: @.StartDate, @.EndDate,
>> @.UserName.
>> Second dataset: UserName. At first I have a query to list all users.
>> Since
>> the list has hundreds of users while the result set from dataset Bugs
>> mostly
>> has less than 10 users, I built another query to list only users having
>> bugs
>> assigned from @.StartDate to @.EndDate. So it requires 2 parameters
>> @.StartDate
>> and @.Enddate.
>> Now both datasets use @.StartDate and @.EndDate. The list to select for
>> @.UserName is produced after @.StartDate and @.EndDate are entered. I
>> expected
>> the report to let me select the username after I enter @.StartDate and
>> @.EndDate. However in the preview tab right at the moment when I clicked
>> on
>> the box for @.EndDate to enter a value the program hang up (VS 2003). I
>> uploaded it to a report server to see how it behaves then I got this
>> error
>> after I click on the EndDate box: The value provided for the report
>> parameter 'EndDate' is not valid for its type.
>> (rsReportParameterTypeMismatch).
>> I don't know what's wrong. If I change the dataset UserName to list all
>> users (no parameter required) then the report runs fine. I use Visual
>> Studio .NET 2003 Service Pack 1, report server is SQL 2000 with latest SP
>> on
>> the O/S, SQL, and SQL RS.
>> An thought?
>> Thanks.
>
> The issue sounds kind of strange. Maybe you should check to make sure
> that you have the correct @.EndDate mapping as part of the UserName
> dataset (via the Data tab -> Edit Selected Dataset button [...] ->
> Parameters tab). Also, make sure that the stored procedure/query that
> sources the UserName dataset is not expecting a different data type
> for @.EndDate (for whatever reason). Sorry I could not be of greater
> assistance.
> Regards,
> Enrique Martinez
> Sr. Software Consultant
>
Wednesday, March 7, 2012
Problem Using XML BASE64 encoding & SQL Server
Here is what I am trying to do.
I allow users to upload images from client side. This is the code I m using to load image into a client side xml document element
var node1 = xmlData.createElement("PHOTO");
node1.dataType = "bin.base64";
// Open stream object and read source file
adoStream.Type = 1; // 1=adTypeBinary
adoStream.Open();
adoStream.LoadFromFile(filename);
// Store file content and filename into XML nodes
node1.nodeTypedValue = adoStream.Read(-1); // -1=adReadAll
document.all("INVST_PHOTO").src = adoStream.Read(-1);
node2.nodeTypedValue = filename;
Now after that I extract this Image and insert it into Sql server using a stored procedure.
Dim ImgBuff() As Byte
ImgBuff = objDOMDocument.selectSingleNode("SACWIS/INVST/INVST_PHOTO/PHOTO").Text
' Add null termination:
ReDim Preserve ImgBuff(0 To UBound(ImgBuff) + 2) As Byte
' Get the pointer to the string:
Dim lPtrString As Long
lPtrString = VarPtr(ImgBuff(0))
objCmd.Parameters("@.pIMG_PHOTO").AppendChunk ImgBuff().
I am Sucessfully able to store it in the database fileld type of Image. Now I am using XML: to retrieve images from the database. Here is how the SQL looks like
SELECT
1 AS TAG, NULL AS PARENT,
IMG_PHOT AS [PHOTO!1!PHOTO!ELEMENT]
FROM PHOTO
FOR XML EXPLICIT , BINARY BASE64
The problem I am runing into is that content of the IMG_PHOTO are not the same after saving and retreival.
Here is how the contents are prior to inserting into database
/9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAAPAAA/+4ADkFkb2JlAGTAAAAAAf/bAIQABgQEBAUEBgUFBgkGBQYJCwgGBggLDAoKCwoKDBand here is how they look after retrieval
LwA5AGoALwA0AEEAQQBRAFMAawBaAEoAUgBnAEEAQgBBAGcAQQBBAFoAQQBCAGsAQQBBAEQALwA3AEEAQQBSAFIASABWAGoAYQAzAGsAQQB
I expected them to look same. I guess what I am doing is encoding the contents twice once I load it and once I am retreiving it from xml. Can please somebody help me out with this so that I can have the same content on both ocassion.
I am using Javascript/VB6/SQLServer 2000
I resolved it Instead of using
ImgBuff = objDOMDocument.selectSingleNode("SACWIS/INVST/INVST_PHOTO/PHOTO").Tex
I shoudl have used it Instead of using
ImgBuff = objDOMDocument.selectSingleNode("SACWIS/INVST/INVST_PHOTO/PHOTO").nodeTypeValue
which gives me base64 encoding data. VB string gives us Unicode data.
Problem Using XML BASE64 encoding & SQL Server
Here is what I am trying to do.
I allow users to upload images from client side. This is the code I m using to load image into a client side xml document element
var node1 = xmlData.createElement("PHOTO");
node1.dataType = "bin.base64";
// Open stream object and read source file
adoStream.Type = 1; // 1=adTypeBinary
adoStream.Open();
adoStream.LoadFromFile(filename);
// Store file content and filename into XML nodes
node1.nodeTypedValue = adoStream.Read(-1); // -1=adReadAll
document.all("INVST_PHOTO").src = adoStream.Read(-1);
node2.nodeTypedValue = filename;
Now after that I extract this Image and insert it into Sql server using a stored procedure.
Dim ImgBuff() As Byte
ImgBuff = objDOMDocument.selectSingleNode("SACWIS/INVST/INVST_PHOTO/PHOTO").Text
' Add null termination:
ReDim Preserve ImgBuff(0 To UBound(ImgBuff) + 2) As Byte
' Get the pointer to the string:
Dim lPtrString As Long
lPtrString = VarPtr(ImgBuff(0))
objCmd.Parameters("@.pIMG_PHOTO").AppendChunk ImgBuff().
I am Sucessfully able to store it in the database fileld type of Image. Now I am using XML: to retrieve images from the database. Here is how the SQL looks like
SELECT
1 AS TAG, NULL AS PARENT,
IMG_PHOT AS [PHOTO!1!PHOTO!ELEMENT]
FROM PHOTO
FOR XML EXPLICIT , BINARY BASE64
The problem I am runing into is that content of the IMG_PHOTO are not the same after saving and retreival.
Here is how the contents are prior to inserting into database
/9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAAPAAA/+4ADkFkb2JlAGTAAAAAAf/bAIQABgQEBAUEBgUFBgkGBQYJCwgGBggLDAoKCwoKDBand here is how they look after retrieval
LwA5AGoALwA0AEEAQQBRAFMAawBaAEoAUgBnAEEAQgBBAGcAQQBBAFoAQQBCAGsAQQBBAEQALwA3AEEAQQBSAFIASABWAGoAYQAzAGsAQQB
I expected them to look same. I guess what I am doing is encoding the contents twice once I load it and once I am retreiving it from xml. Can please somebody help me out with this so that I can have the same content on both ocassion.
I am using Javascript/VB6/SQLServer 2000
I resolved it Instead of using
ImgBuff = objDOMDocument.selectSingleNode("SACWIS/INVST/INVST_PHOTO/PHOTO").Tex
I shoudl have used it Instead of using
ImgBuff = objDOMDocument.selectSingleNode("SACWIS/INVST/INVST_PHOTO/PHOTO").nodeTypeValue
which gives me base64 encoding data. VB string gives us Unicode data.