Showing posts with label file. Show all posts
Showing posts with label file. Show all posts

Friday, March 30, 2012

pfpagealloc error

I am running Sql Server 2005 SP 2 CTP and keep getting an error which says Internal Error pfpagealloc.cpp file is corrupt. This did not happen with SP1 and is very speradic. I get the problem when using both excel and the visual studio browser to manipulate an anylsis services database. I can then try again and everything works. I also get the same problem sometimes with my overnight rebuild of the cube.

Paul

Please, please. If you can catch the repro schenario, create a report with http://connect.microsoft.com/sql.

Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.

|||

We just applied SP 2 CTP and we are periodically getting the same error.

However, if we run the same MDX query immediately, we do not encounter it again. We can then run many other MDX queries without incident, but eventually we will generate the error again.

Error message is below:

Executing the query ...

Internal error: An unexpected error occurred (file 'pfpagealloc.cpp', line 428, function 'PFPageAllocator::PFPageAllocator').

Internal error: An unexpected error occurred (file 'pfpagealloc.cpp', line 428, function 'PFPageAllocator::PFPageAllocator').

Internal error: An unexpected error occurred (file 'pfpagealloc.cpp', line 428, function 'PFPageAllocator::PFPageAllocator').

Internal error: An unexpected error occurred (file 'pfpagealloc.cpp', line 428, function 'PFPageAllocator::PFPageAllocator').

Internal error: An unexpected error occurred (file 'pfpagealloc.cpp', line 428, function 'PFPageAllocator::PFPageAllocator').

Execution complete

|||

Please report this with http://connect.microsoft.com/sql.

This looks like a memory pressure problem. See if you get enoght memory for Analysis Server.

Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.

|||

This is exactly the issue I was getting and I did try to log my problem with connect. Unfortunately they obviously needed log files to be able to trace the problem and as unfortunately the system was live I had to go back to sp1.

Please let me know if you have any luck with a resolution I will contine to check on connect site.

pfpagealloc error

I am running Sql Server 2005 SP 2 CTP and keep getting an error which says Internal Error pfpagealloc.cpp file is corrupt. This did not happen with SP1 and is very speradic. I get the problem when using both excel and the visual studio browser to manipulate an anylsis services database. I can then try again and everything works. I also get the same problem sometimes with my overnight rebuild of the cube.

Paul

Please, please. If you can catch the repro schenario, create a report with http://connect.microsoft.com/sql.

Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.

|||

We just applied SP 2 CTP and we are periodically getting the same error.

However, if we run the same MDX query immediately, we do not encounter it again. We can then run many other MDX queries without incident, but eventually we will generate the error again.

Error message is below:

Executing the query ...

Internal error: An unexpected error occurred (file 'pfpagealloc.cpp', line 428, function 'PFPageAllocator::PFPageAllocator').

Internal error: An unexpected error occurred (file 'pfpagealloc.cpp', line 428, function 'PFPageAllocator::PFPageAllocator').

Internal error: An unexpected error occurred (file 'pfpagealloc.cpp', line 428, function 'PFPageAllocator::PFPageAllocator').

Internal error: An unexpected error occurred (file 'pfpagealloc.cpp', line 428, function 'PFPageAllocator::PFPageAllocator').

Internal error: An unexpected error occurred (file 'pfpagealloc.cpp', line 428, function 'PFPageAllocator::PFPageAllocator').

Execution complete

|||

Please report this with http://connect.microsoft.com/sql.

This looks like a memory pressure problem. See if you get enoght memory for Analysis Server.

Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.

|||

This is exactly the issue I was getting and I did try to log my problem with connect. Unfortunately they obviously needed log files to be able to trace the problem and as unfortunately the system was live I had to go back to sp1.

Please let me know if you have any luck with a resolution I will contine to check on connect site.

sql

Wednesday, March 28, 2012

Person.Coontact - AdventureWorks

I have the AdventureWorks database in sql server 2005.
The Table Person.Contact is empty. I have the .csv file for the data for
this table. This .csv seems to be xml data.
How can I get this particular .csv into this table?
I basically would like to somehow populate this particular table.
Thanks
If you look at the installation script for AdventureWorks (instawdb.sql),
you'll find a series of BULK INSERT statements that load all the .csv files
for the database. Here's the statement for the Person.Contact table. I
simply modified the statement to point to the location of the .csv file on
my server.
EXECUTE (N'BULK INSERT [Person].[Contact]
FROM ''C:\Program Files\Microsoft SQL Server\90\Tools\Samples\AdventureWorks
OLTP\Contact.csv''
WITH (
CHECK_CONSTRAINTS,
CODEPAGE=''ACP'',
DATAFILETYPE=''widechar'',
FIELDTERMINATOR=''+|'',
ROWTERMINATOR=''&|\n'',
KEEPIDENTITY,
TABLOCK
);');
However, unless you know for sure that the Person.Contact table is the only
empty table, you may want to recreate the entire database by running the
installation script. The instructions for doing this are in Books Online in
the topic "Reinstalling Sample Databases From Scripts".
Gail Erickson [MS]
SQL Server Documentation Team
This posting is provided "AS IS" with no warranties, and confers no rights
"farshad" <farshad@.discussions.microsoft.com> wrote in message
news:44F58336-3BAD-4EC9-868B-0FD6AD3DA921@.microsoft.com...
>I have the AdventureWorks database in sql server 2005.
> The Table Person.Contact is empty. I have the .csv file for the data for
> this table. This .csv seems to be xml data.
> How can I get this particular .csv into this table?
> I basically would like to somehow populate this particular table.
> Thanks
|||Ran the following script:
EXECUTE (N'BULK INSERT [Person].[Contact]
FROM ''C:\Program Files\Microsoft SQL Server 2005 AdventureWorks Sample
Database Scripts\awdb\Contact.csv''
WITH (
CHECK_CONSTRAINTS,
CODEPAGE=''ACP'',
DATAFILETYPE=''widechar'',
FIELDTERMINATOR=''+|'',
ROWTERMINATOR=''&|\n'',
KEEPIDENTITY,
TABLOCK
);');
It gave the following error. thanks
XML Validation: Declaration not found for element
'http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactRecord:ContactRecord'. Location: /*:AdditionalContactInfo[1]/*:ContactRecord[1]
"Gail Erickson [MS]" wrote:

> If you look at the installation script for AdventureWorks (instawdb.sql),
> you'll find a series of BULK INSERT statements that load all the .csv files
> for the database. Here's the statement for the Person.Contact table. I
> simply modified the statement to point to the location of the .csv file on
> my server.
> EXECUTE (N'BULK INSERT [Person].[Contact]
> FROM ''C:\Program Files\Microsoft SQL Server\90\Tools\Samples\AdventureWorks
> OLTP\Contact.csv''
> WITH (
> CHECK_CONSTRAINTS,
> CODEPAGE=''ACP'',
> DATAFILETYPE=''widechar'',
> FIELDTERMINATOR=''+|'',
> ROWTERMINATOR=''&|\n'',
> KEEPIDENTITY,
> TABLOCK
> );');
> However, unless you know for sure that the Person.Contact table is the only
> empty table, you may want to recreate the entire database by running the
> installation script. The instructions for doing this are in Books Online in
> the topic "Reinstalling Sample Databases From Scripts".
> --
> Gail Erickson [MS]
> SQL Server Documentation Team
> This posting is provided "AS IS" with no warranties, and confers no rights
> "farshad" <farshad@.discussions.microsoft.com> wrote in message
> news:44F58336-3BAD-4EC9-868B-0FD6AD3DA921@.microsoft.com...
>
>
|||> It gave the following error. thanks
Then you have more problems than just an empty table. You need to follow
the instructions in the Books Online topic "Reinstalling Sample Databases
From Scripts". This will drop the database and recreate it.
Gail Erickson [MS]
SQL Server Documentation Team
This posting is provided "AS IS" with no warranties, and confers no rights
"farshad" <farshad@.discussions.microsoft.com> wrote in message
news:9D8C349E-B64E-4D5D-B4D9-DF7A0D04C917@.microsoft.com...[vbcol=seagreen]
> Ran the following script:
> EXECUTE (N'BULK INSERT [Person].[Contact]
> FROM ''C:\Program Files\Microsoft SQL Server 2005 AdventureWorks Sample
> Database Scripts\awdb\Contact.csv''
> WITH (
> CHECK_CONSTRAINTS,
> CODEPAGE=''ACP'',
> DATAFILETYPE=''widechar'',
> FIELDTERMINATOR=''+|'',
> ROWTERMINATOR=''&|\n'',
> KEEPIDENTITY,
> TABLOCK
> );');
> It gave the following error. thanks
> XML Validation: Declaration not found for element
> 'http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactRecord:ContactRecord'.
> Location: /*:AdditionalContactInfo[1]/*:ContactRecord[1]
>
> "Gail Erickson [MS]" wrote:

Person.Coontact - AdventureWorks

I have the AdventureWorks database in sql server 2005.
The Table Person.Contact is empty. I have the .csv file for the data for
this table. This .csv seems to be xml data.
How can I get this particular .csv into this table?
I basically would like to somehow populate this particular table.
ThanksIf you look at the installation script for AdventureWorks (instawdb.sql),
you'll find a series of BULK INSERT statements that load all the .csv files
for the database. Here's the statement for the Person.Contact table. I
simply modified the statement to point to the location of the .csv file on
my server.
EXECUTE (N'BULK INSERT [Person].[Contact]
FROM ''C:\Program Files\Microsoft SQL Server\90\Tools\Samples\AdventureWorks
OLTP\Contact.csv''
WITH (
CHECK_CONSTRAINTS,
CODEPAGE=''ACP'',
DATAFILETYPE=''widechar'',
FIELDTERMINATOR=''+|'',
ROWTERMINATOR=''&|\n'',
KEEPIDENTITY,
TABLOCK
);');
However, unless you know for sure that the Person.Contact table is the only
empty table, you may want to recreate the entire database by running the
installation script. The instructions for doing this are in Books Online in
the topic "Reinstalling Sample Databases From Scripts".
Gail Erickson [MS]
SQL Server Documentation Team
This posting is provided "AS IS" with no warranties, and confers no rights
"farshad" <farshad@.discussions.microsoft.com> wrote in message
news:44F58336-3BAD-4EC9-868B-0FD6AD3DA921@.microsoft.com...
>I have the AdventureWorks database in sql server 2005.
> The Table Person.Contact is empty. I have the .csv file for the data for
> this table. This .csv seems to be xml data.
> How can I get this particular .csv into this table?
> I basically would like to somehow populate this particular table.
> Thanks|||Ran the following script:
EXECUTE (N'BULK INSERT [Person].[Contact]
FROM ''C:\Program Files\Microsoft SQL Server 2005 AdventureWorks Sample
Database Scripts\awdb\Contact.csv''
WITH (
CHECK_CONSTRAINTS,
CODEPAGE=''ACP'',
DATAFILETYPE=''widechar'',
FIELDTERMINATOR=''+|'',
ROWTERMINATOR=''&|\n'',
KEEPIDENTITY,
TABLOCK
);');
It gave the following error. thanks
XML Validation: Declaration not found for element
'http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactRecor
d:ContactRecord'. Location: /*:AdditionalContactInfo[1]/*:ContactRecord&
#91;1]
"Gail Erickson [MS]" wrote:

> If you look at the installation script for AdventureWorks (instawdb.sql),
> you'll find a series of BULK INSERT statements that load all the .csv file
s
> for the database. Here's the statement for the Person.Contact table. I
> simply modified the statement to point to the location of the .csv file on
> my server.
> EXECUTE (N'BULK INSERT [Person].[Contact]
> FROM ''C:\Program Files\Microsoft SQL Server\90\Tools\Samples\AdventureWor
ks
> OLTP\Contact.csv''
> WITH (
> CHECK_CONSTRAINTS,
> CODEPAGE=''ACP'',
> DATAFILETYPE=''widechar'',
> FIELDTERMINATOR=''+|'',
> ROWTERMINATOR=''&|\n'',
> KEEPIDENTITY,
> TABLOCK
> );');
> However, unless you know for sure that the Person.Contact table is the onl
y
> empty table, you may want to recreate the entire database by running the
> installation script. The instructions for doing this are in Books Online
in
> the topic "Reinstalling Sample Databases From Scripts".
> --
> Gail Erickson [MS]
> SQL Server Documentation Team
> This posting is provided "AS IS" with no warranties, and confers no rights
> "farshad" <farshad@.discussions.microsoft.com> wrote in message
> news:44F58336-3BAD-4EC9-868B-0FD6AD3DA921@.microsoft.com...
>
>|||> It gave the following error. thanks
Then you have more problems than just an empty table. You need to follow
the instructions in the Books Online topic "Reinstalling Sample Databases
From Scripts". This will drop the database and recreate it.
Gail Erickson [MS]
SQL Server Documentation Team
This posting is provided "AS IS" with no warranties, and confers no rights
"farshad" <farshad@.discussions.microsoft.com> wrote in message
news:9D8C349E-B64E-4D5D-B4D9-DF7A0D04C917@.microsoft.com...[vbcol=seagreen]
> Ran the following script:
> EXECUTE (N'BULK INSERT [Person].[Contact]
> FROM ''C:\Program Files\Microsoft SQL Server 2005 AdventureWorks Sample
> Database Scripts\awdb\Contact.csv''
> WITH (
> CHECK_CONSTRAINTS,
> CODEPAGE=''ACP'',
> DATAFILETYPE=''widechar'',
> FIELDTERMINATOR=''+|'',
> ROWTERMINATOR=''&|\n'',
> KEEPIDENTITY,
> TABLOCK
> );');
> It gave the following error. thanks
> XML Validation: Declaration not found for element
> 'http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactRec
ord:ContactRecord'.
> Location: /*:AdditionalContactInfo[1]/*:ContactRecord[1]
>
> "Gail Erickson [MS]" wrote:
>

Person.Coontact - AdventureWorks

I have the AdventureWorks database in sql server 2005.
The Table Person.Contact is empty. I have the .csv file for the data for
this table. This .csv seems to be xml data.
How can I get this particular .csv into this table?
I basically would like to somehow populate this particular table.
ThanksIf you look at the installation script for AdventureWorks (instawdb.sql),
you'll find a series of BULK INSERT statements that load all the .csv files
for the database. Here's the statement for the Person.Contact table. I
simply modified the statement to point to the location of the .csv file on
my server.
EXECUTE (N'BULK INSERT [Person].[Contact]
FROM ''C:\Program Files\Microsoft SQL Server\90\Tools\Samples\AdventureWorks
OLTP\Contact.csv''
WITH (
CHECK_CONSTRAINTS,
CODEPAGE=''ACP'',
DATAFILETYPE=''widechar'',
FIELDTERMINATOR=''+|'',
ROWTERMINATOR=''&|\n'',
KEEPIDENTITY,
TABLOCK
);');
However, unless you know for sure that the Person.Contact table is the only
empty table, you may want to recreate the entire database by running the
installation script. The instructions for doing this are in Books Online in
the topic "Reinstalling Sample Databases From Scripts".
--
Gail Erickson [MS]
SQL Server Documentation Team
This posting is provided "AS IS" with no warranties, and confers no rights
"farshad" <farshad@.discussions.microsoft.com> wrote in message
news:44F58336-3BAD-4EC9-868B-0FD6AD3DA921@.microsoft.com...
>I have the AdventureWorks database in sql server 2005.
> The Table Person.Contact is empty. I have the .csv file for the data for
> this table. This .csv seems to be xml data.
> How can I get this particular .csv into this table?
> I basically would like to somehow populate this particular table.
> Thanks|||Ran the following script:
EXECUTE (N'BULK INSERT [Person].[Contact]
FROM ''C:\Program Files\Microsoft SQL Server 2005 AdventureWorks Sample
Database Scripts\awdb\Contact.csv''
WITH (
CHECK_CONSTRAINTS,
CODEPAGE=''ACP'',
DATAFILETYPE=''widechar'',
FIELDTERMINATOR=''+|'',
ROWTERMINATOR=''&|\n'',
KEEPIDENTITY,
TABLOCK
);');
It gave the following error. thanks
XML Validation: Declaration not found for element
'http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactRecord:ContactRecord'. Location: /*:AdditionalContactInfo[1]/*:ContactRecord[1]
"Gail Erickson [MS]" wrote:
> If you look at the installation script for AdventureWorks (instawdb.sql),
> you'll find a series of BULK INSERT statements that load all the .csv files
> for the database. Here's the statement for the Person.Contact table. I
> simply modified the statement to point to the location of the .csv file on
> my server.
> EXECUTE (N'BULK INSERT [Person].[Contact]
> FROM ''C:\Program Files\Microsoft SQL Server\90\Tools\Samples\AdventureWorks
> OLTP\Contact.csv''
> WITH (
> CHECK_CONSTRAINTS,
> CODEPAGE=''ACP'',
> DATAFILETYPE=''widechar'',
> FIELDTERMINATOR=''+|'',
> ROWTERMINATOR=''&|\n'',
> KEEPIDENTITY,
> TABLOCK
> );');
> However, unless you know for sure that the Person.Contact table is the only
> empty table, you may want to recreate the entire database by running the
> installation script. The instructions for doing this are in Books Online in
> the topic "Reinstalling Sample Databases From Scripts".
> --
> Gail Erickson [MS]
> SQL Server Documentation Team
> This posting is provided "AS IS" with no warranties, and confers no rights
> "farshad" <farshad@.discussions.microsoft.com> wrote in message
> news:44F58336-3BAD-4EC9-868B-0FD6AD3DA921@.microsoft.com...
> >I have the AdventureWorks database in sql server 2005.
> > The Table Person.Contact is empty. I have the .csv file for the data for
> > this table. This .csv seems to be xml data.
> > How can I get this particular .csv into this table?
> > I basically would like to somehow populate this particular table.
> > Thanks
>
>|||> It gave the following error. thanks
Then you have more problems than just an empty table. You need to follow
the instructions in the Books Online topic "Reinstalling Sample Databases
From Scripts". This will drop the database and recreate it.
--
Gail Erickson [MS]
SQL Server Documentation Team
This posting is provided "AS IS" with no warranties, and confers no rights
"farshad" <farshad@.discussions.microsoft.com> wrote in message
news:9D8C349E-B64E-4D5D-B4D9-DF7A0D04C917@.microsoft.com...
> Ran the following script:
> EXECUTE (N'BULK INSERT [Person].[Contact]
> FROM ''C:\Program Files\Microsoft SQL Server 2005 AdventureWorks Sample
> Database Scripts\awdb\Contact.csv''
> WITH (
> CHECK_CONSTRAINTS,
> CODEPAGE=''ACP'',
> DATAFILETYPE=''widechar'',
> FIELDTERMINATOR=''+|'',
> ROWTERMINATOR=''&|\n'',
> KEEPIDENTITY,
> TABLOCK
> );');
> It gave the following error. thanks
> XML Validation: Declaration not found for element
> 'http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactRecord:ContactRecord'.
> Location: /*:AdditionalContactInfo[1]/*:ContactRecord[1]
>
> "Gail Erickson [MS]" wrote:
>> If you look at the installation script for AdventureWorks (instawdb.sql),
>> you'll find a series of BULK INSERT statements that load all the .csv
>> files
>> for the database. Here's the statement for the Person.Contact table. I
>> simply modified the statement to point to the location of the .csv file
>> on
>> my server.
>> EXECUTE (N'BULK INSERT [Person].[Contact]
>> FROM ''C:\Program Files\Microsoft SQL
>> Server\90\Tools\Samples\AdventureWorks
>> OLTP\Contact.csv''
>> WITH (
>> CHECK_CONSTRAINTS,
>> CODEPAGE=''ACP'',
>> DATAFILETYPE=''widechar'',
>> FIELDTERMINATOR=''+|'',
>> ROWTERMINATOR=''&|\n'',
>> KEEPIDENTITY,
>> TABLOCK
>> );');
>> However, unless you know for sure that the Person.Contact table is the
>> only
>> empty table, you may want to recreate the entire database by running the
>> installation script. The instructions for doing this are in Books Online
>> in
>> the topic "Reinstalling Sample Databases From Scripts".
>> --
>> Gail Erickson [MS]
>> SQL Server Documentation Team
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights
>> "farshad" <farshad@.discussions.microsoft.com> wrote in message
>> news:44F58336-3BAD-4EC9-868B-0FD6AD3DA921@.microsoft.com...
>> >I have the AdventureWorks database in sql server 2005.
>> > The Table Person.Contact is empty. I have the .csv file for the data
>> > for
>> > this table. This .csv seems to be xml data.
>> > How can I get this particular .csv into this table?
>> > I basically would like to somehow populate this particular table.
>> > Thanks
>>sql

Persisting XML

Hi all,
I would like to save the output of a FOR XML stored procedure to a file on my hard drive with a filename of my choosing. Can anybody point me in the write direction on how to do this. (I've got the FOR XML sproc written, I just need help figuring out ho
w to persist it to a file. Thanks.
JT
Hi JT,
I noticed you make another post with topic 'Persist Sproc OUTPUT' in the
newsgroup: microsoft.public.sqlserver.programming. I found an community
member has added his reply to that thread and I will add my reply if you
have follow up questions to that thread
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 Online Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Please reply to newsgroups only, many thanks!
|||See the thread entitled "extracting results of XML stored proc to file"
started by Mike UK in this newsgroup.
Cheers,
Graeme
--
Graeme Malcolm
Principal Technologist
Content Master Ltd.
www.contentmaster.com
www.microsoft.com/mspress/books/6137.asp
"JT" <JTnospam@.verizon.net> wrote in message
news:A3758B34-4AC8-4675-8326-319C40508CFF@.microsoft.com...
> Hi all,
> I would like to save the output of a FOR XML stored procedure to a file on
my hard drive with a filename of my choosing. Can anybody point me in the
write direction on how to do this. (I've got the FOR XML sproc written, I
just need help figuring out how to persist it to a file. Thanks.
> JT
|||Thanks Graeme.
JT

Monday, March 26, 2012

Permissions to run vb code

In one of my reports I’m using vb code that copies one file from a local disk to a server.

Like this:

Public Shared Function CopyFile(ByVal infile As String, ByVal outfile As String)

Dim fi As System.IO.FileInfo = New System.IO.FileInfo(infile)

fi.CopyTo(outfile, True)

End function

The report is executed using report services directly in a browser.

In the Visual Studio environment it works ok. In the browser I get an error. I’m sure it is a permissions problem.

Any pointers to set op permission for this rdl-file ?

/NHS

There is no way to elevate code permissions for a particular RDL.

Better way is to move this code into a separate assembly, grant permissions to that assembly and call it from the report.

Permissions to run vb code

In one of my reports I’m using vb code that copies one file from a local disk to a server.

Like this:

Public Shared Function CopyFile(ByVal infile As String, ByVal outfile As String)

Dim fi As System.IO.FileInfo = New System.IO.FileInfo(infile)

fi.CopyTo(outfile, True)

End function

The report is executed using report services directly in a browser.

In the Visual Studio environment it works ok. In the browser I get an error. I’m sure it is a permissions problem.

Any pointers to set op permission for this rdl-file ?

/NHS

There is no way to elevate code permissions for a particular RDL.

Better way is to move this code into a separate assembly, grant permissions to that assembly and call it from the report.

Wednesday, March 21, 2012

Permissions problem

Hi
I have some code that I am testing to read data from a FoxPro file.
I have copied the FoxPro file locally to test.
I have created a linked server that points to this file. Enterprise manager
correctly shows the tables available.
Works fine.!
However, when I create another linked server pointing towards the network
files, enterprise manager shows no available tables and my code returns an
error stating that the table does not exist.
I have checked the security permissions on the network drive/directories and
I appear to have full access. I can indeed move, delete etc these files.
Any ideas why I cannot connect in enterprise manager.?
ThanksI can however import these tables using a DTS job.!!!
"Chubbly Geezer" wrote:

> Hi
> I have some code that I am testing to read data from a FoxPro file.
> I have copied the FoxPro file locally to test.
> I have created a linked server that points to this file. Enterprise manag
er
> correctly shows the tables available.
> Works fine.!
> However, when I create another linked server pointing towards the network
> files, enterprise manager shows no available tables and my code returns an
> error stating that the table does not exist.
> I have checked the security permissions on the network drive/directories a
nd
> I appear to have full access. I can indeed move, delete etc these files.
> Any ideas why I cannot connect in enterprise manager.?
> Thanks|||Hi
Does the account that SQL Server and Agent run under have permission on the
remote share and files?
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Chubbly Geezer" wrote:

> Hi
> I have some code that I am testing to read data from a FoxPro file.
> I have copied the FoxPro file locally to test.
> I have created a linked server that points to this file. Enterprise manag
er
> correctly shows the tables available.
> Works fine.!
> However, when I create another linked server pointing towards the network
> files, enterprise manager shows no available tables and my code returns an
> error stating that the table does not exist.
> I have checked the security permissions on the network drive/directories a
nd
> I appear to have full access. I can indeed move, delete etc these files.
> Any ideas why I cannot connect in enterprise manager.?
> Thanks|||Both services were running under local system. Have changed to my login but
still no joy.
Also in linked server security options I have tried changing them to login
as myself but no luck.
The following 2 lines of code ALSO return table data:
EXEC sp_tables_ex @.table_server='OPERA_SERVER'
EXEC sp_columns_ex @.table_server='OPERA_SERVER', @.table_name='ssale'
"Mike Epprecht (SQL MVP)" wrote:
> Hi
> Does the account that SQL Server and Agent run under have permission on th
e
> remote share and files?
> Regards
> --
> Mike Epprecht, Microsoft SQL Server MVP
> Zurich, Switzerland
> MVP Program: http://www.microsoft.com/mvp
> Blog: http://www.msmvps.com/epprecht/
>
> "Chubbly Geezer" wrote:
>|||Correction.
The following 2 lines of code DO NOT WORK..
EXEC sp_tables_ex @.table_server='OPERA_SERVER'
EXEC sp_columns_ex @.table_server='OPERA_SERVER', @.table_name='ssale'
"Chubbly Geezer" wrote:
> Both services were running under local system. Have changed to my login b
ut
> still no joy.
> Also in linked server security options I have tried changing them to login
> as myself but no luck.
> The following 2 lines of code ALSO return table data:
> EXEC sp_tables_ex @.table_server='OPERA_SERVER'
> EXEC sp_columns_ex @.table_server='OPERA_SERVER', @.table_name='ssale'
>
> "Mike Epprecht (SQL MVP)" wrote:
>sql

Monday, March 12, 2012

Permissions for OleDb to an As400

I have a store procedure written in VB.NET to access an AS400 using System.Data.OleDb. I created the key for the procedure as a .pfx file and before adding the code to access the AS400, I tested it against a SQL Server database and it worked fine. When I added the code to access the AS400, I get the following error:

A .NET Framework error occurred during execution of user defined routine or aggregate 'ap_mapics_Data':

System.Security.SecurityException: Request for the permission of type 'System.Data.OleDb.OleDbPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

System.Security.SecurityException:

at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)

at System.Security.PermissionSet.Demand()

at System.Data.Common.DbConnectionOptions.DemandPermission()

at System.Data.OleDb.OleDbConnection.PermissionDemand()

at System.Data.OleDb.OleDbConnectionFactory.PermissionDemand(DbConnection outerConnection)

at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)

at System.Data.OleDb.OleDbConnection.Open()

at ProImage_Procedures_Test.StoredProcedures.ap_mapics_Data()

OleDbPermission is only available to assemblies deployed with an UNSAFE CAS permission set grant. Given that your code worked against what is presumably another SQL Server database, I'm guessing that your assembly is deployed with an EXTERNAL_ACCESS grant. If you want more information about the permissions granted at each level, see http://bordecal.mvps.org/Nicole/SqlClrCas/SqlClrCasSpeculations.htm.