Showing posts with label old. Show all posts
Showing posts with label old. Show all posts

Friday, March 23, 2012

Problem importing data from linked server

Sorry if this is the wrong newsgroup. If so, please point me to the right
one.
We use a linked server to import data from an old SQL 2000 database to a new
SQL 2000 database. We create a linked server like this:
exec sp_addlinkedserver 'OldDatabase', '', 'SQLOLEDB', 'ServerName', ''
exec sp_addlinkedsrvlogin 'OldDatabase', 'false', NULL, 'UserName',
'Password'
Then we execute a series of "INSERT INTO" statements to import data like
this:
INSERT INTO ATABLE( FIELD1, FIELD2, ... )
SELECT T.FIELD1, T.FIELD2, ...
FROM OPENQUERY( OldDatabase, 'SELECT * FROM DatabaseName.dbo.TableName') AS
T
There are about 10 "INSERT INTO" statements and all execute fine except for
one. The failing one (the 7th one) returns this error:
"MSDTC on server 'ServerName' is unavailable."
My DTC service is inactive, but that shouldn't matter since all other 9
statements executed fine. If I enable the service and rerun the failing SQL
statement, it returns this error:
"The operation could not be performed because the OLE DB provider 'SQLOLEDB'
was unable to begin a distributed transaction.
[OLE/DB provider returned message: New transaction cannot enlist in the
specified transaction coordinator. ]
OLE DB error trace [OLE/DB Provider 'SQLOLEDB'
ITransactionJoin::JoinTransaction returned 0x8004d00a]."
What's strange is that *all* "INSERT INTO" statements have the same format
as shown above, and only one of them fails. All others after that failing
statement run fine. This also happens using SQL Query Analyzer and happens
no matter how many times I run the script. Can anyone explain to me what's
going on here and how to fix it?
Thanks,
Jon E. Scott
Blue Orb Software
http://www.blueorbsoft.comHi
I can only think that this is a network problem! Check the SQL Server and
Event Logs, try changing protocols and possibly try four part naming instead
of OPENQUERY.
John
"Jon E. Scott" <NOSPAMsupport@.blueorbsoft.comNOSPAM> wrote in message
news:%23VenwxNIFHA.3108@.tk2msftngp13.phx.gbl...
> Sorry if this is the wrong newsgroup. If so, please point me to the right
> one.
> We use a linked server to import data from an old SQL 2000 database to a
> new
> SQL 2000 database. We create a linked server like this:
> exec sp_addlinkedserver 'OldDatabase', '', 'SQLOLEDB', 'ServerName', ''
> exec sp_addlinkedsrvlogin 'OldDatabase', 'false', NULL, 'UserName',
> 'Password'
> Then we execute a series of "INSERT INTO" statements to import data like
> this:
> INSERT INTO ATABLE( FIELD1, FIELD2, ... )
> SELECT T.FIELD1, T.FIELD2, ...
> FROM OPENQUERY( OldDatabase, 'SELECT * FROM DatabaseName.dbo.TableName')
> AS
> T
> There are about 10 "INSERT INTO" statements and all execute fine except
> for
> one. The failing one (the 7th one) returns this error:
> "MSDTC on server 'ServerName' is unavailable."
> My DTC service is inactive, but that shouldn't matter since all other 9
> statements executed fine. If I enable the service and rerun the failing
> SQL
> statement, it returns this error:
> "The operation could not be performed because the OLE DB provider
> 'SQLOLEDB'
> was unable to begin a distributed transaction.
> [OLE/DB provider returned message: New transaction cannot enlist in th
e
> specified transaction coordinator. ]
> OLE DB error trace [OLE/DB Provider 'SQLOLEDB'
> ITransactionJoin::JoinTransaction returned 0x8004d00a]."
> What's strange is that *all* "INSERT INTO" statements have the same format
> as shown above, and only one of them fails. All others after that failing
> statement run fine. This also happens using SQL Query Analyzer and
> happens
> no matter how many times I run the script. Can anyone explain to me
> what's
> going on here and how to fix it?
> --
> Thanks,
> Jon E. Scott
> Blue Orb Software
> http://www.blueorbsoft.com
>
>|||Is the server you are linking to running Server 2003?
nivek
"Jon E. Scott" <NOSPAMsupport@.blueorbsoft.comNOSPAM> wrote in message
news:%23VenwxNIFHA.3108@.tk2msftngp13.phx.gbl...
> Sorry if this is the wrong newsgroup. If so, please point me to the right
> one.
> We use a linked server to import data from an old SQL 2000 database to a
> new
> SQL 2000 database. We create a linked server like this:
> exec sp_addlinkedserver 'OldDatabase', '', 'SQLOLEDB', 'ServerName', ''
> exec sp_addlinkedsrvlogin 'OldDatabase', 'false', NULL, 'UserName',
> 'Password'
> Then we execute a series of "INSERT INTO" statements to import data like
> this:
> INSERT INTO ATABLE( FIELD1, FIELD2, ... )
> SELECT T.FIELD1, T.FIELD2, ...
> FROM OPENQUERY( OldDatabase, 'SELECT * FROM DatabaseName.dbo.TableName')
> AS
> T
> There are about 10 "INSERT INTO" statements and all execute fine except
> for
> one. The failing one (the 7th one) returns this error:
> "MSDTC on server 'ServerName' is unavailable."
> My DTC service is inactive, but that shouldn't matter since all other 9
> statements executed fine. If I enable the service and rerun the failing
> SQL
> statement, it returns this error:
> "The operation could not be performed because the OLE DB provider
> 'SQLOLEDB'
> was unable to begin a distributed transaction.
> [OLE/DB provider returned message: New transaction cannot enlist in th
e
> specified transaction coordinator. ]
> OLE DB error trace [OLE/DB Provider 'SQLOLEDB'
> ITransactionJoin::JoinTransaction returned 0x8004d00a]."
> What's strange is that *all* "INSERT INTO" statements have the same format
> as shown above, and only one of them fails. All others after that failing
> statement run fine. This also happens using SQL Query Analyzer and
> happens
> no matter how many times I run the script. Can anyone explain to me
> what's
> going on here and how to fix it?
> --
> Thanks,
> Jon E. Scott
> Blue Orb Software
> http://www.blueorbsoft.com
>
>sql

Problem importing data from linked server

Sorry if this is the wrong newsgroup. If so, please point me to the right
one.
We use a linked server to import data from an old SQL 2000 database to a new
SQL 2000 database. We create a linked server like this:
exec sp_addlinkedserver 'OldDatabase', '', 'SQLOLEDB', 'ServerName', ''
exec sp_addlinkedsrvlogin 'OldDatabase', 'false', NULL, 'UserName',
'Password'
Then we execute a series of "INSERT INTO" statements to import data like
this:
INSERT INTO ATABLE( FIELD1, FIELD2, ... )
SELECT T.FIELD1, T.FIELD2, ...
FROM OPENQUERY( OldDatabase, 'SELECT * FROM DatabaseName.dbo.TableName') AS
T
There are about 10 "INSERT INTO" statements and all execute fine except for
one. The failing one (the 7th one) returns this error:
"MSDTC on server 'ServerName' is unavailable."
My DTC service is inactive, but that shouldn't matter since all other 9
statements executed fine. If I enable the service and rerun the failing SQL
statement, it returns this error:
"The operation could not be performed because the OLE DB provider 'SQLOLEDB'
was unable to begin a distributed transaction.
[OLE/DB provider returned message: New transaction cannot enlist in the
specified transaction coordinator. ]
OLE DB error trace [OLE/DB Provider 'SQLOLEDB'
ITransactionJoin::JoinTransaction returned 0x8004d00a]."
What's strange is that *all* "INSERT INTO" statements have the same format
as shown above, and only one of them fails. All others after that failing
statement run fine. This also happens using SQL Query Analyzer and happens
no matter how many times I run the script. Can anyone explain to me what's
going on here and how to fix it?
Thanks,
Jon E. Scott
Blue Orb Software
http://www.blueorbsoft.com
Hi
I can only think that this is a network problem! Check the SQL Server and
Event Logs, try changing protocols and possibly try four part naming instead
of OPENQUERY.
John
"Jon E. Scott" <NOSPAMsupport@.blueorbsoft.comNOSPAM> wrote in message
news:%23VenwxNIFHA.3108@.tk2msftngp13.phx.gbl...
> Sorry if this is the wrong newsgroup. If so, please point me to the right
> one.
> We use a linked server to import data from an old SQL 2000 database to a
> new
> SQL 2000 database. We create a linked server like this:
> exec sp_addlinkedserver 'OldDatabase', '', 'SQLOLEDB', 'ServerName', ''
> exec sp_addlinkedsrvlogin 'OldDatabase', 'false', NULL, 'UserName',
> 'Password'
> Then we execute a series of "INSERT INTO" statements to import data like
> this:
> INSERT INTO ATABLE( FIELD1, FIELD2, ... )
> SELECT T.FIELD1, T.FIELD2, ...
> FROM OPENQUERY( OldDatabase, 'SELECT * FROM DatabaseName.dbo.TableName')
> AS
> T
> There are about 10 "INSERT INTO" statements and all execute fine except
> for
> one. The failing one (the 7th one) returns this error:
> "MSDTC on server 'ServerName' is unavailable."
> My DTC service is inactive, but that shouldn't matter since all other 9
> statements executed fine. If I enable the service and rerun the failing
> SQL
> statement, it returns this error:
> "The operation could not be performed because the OLE DB provider
> 'SQLOLEDB'
> was unable to begin a distributed transaction.
> [OLE/DB provider returned message: New transaction cannot enlist in the
> specified transaction coordinator. ]
> OLE DB error trace [OLE/DB Provider 'SQLOLEDB'
> ITransactionJoin::JoinTransaction returned 0x8004d00a]."
> What's strange is that *all* "INSERT INTO" statements have the same format
> as shown above, and only one of them fails. All others after that failing
> statement run fine. This also happens using SQL Query Analyzer and
> happens
> no matter how many times I run the script. Can anyone explain to me
> what's
> going on here and how to fix it?
> --
> Thanks,
> Jon E. Scott
> Blue Orb Software
> http://www.blueorbsoft.com
>
>
|||Is the server you are linking to running Server 2003?
nivek
"Jon E. Scott" <NOSPAMsupport@.blueorbsoft.comNOSPAM> wrote in message
news:%23VenwxNIFHA.3108@.tk2msftngp13.phx.gbl...
> Sorry if this is the wrong newsgroup. If so, please point me to the right
> one.
> We use a linked server to import data from an old SQL 2000 database to a
> new
> SQL 2000 database. We create a linked server like this:
> exec sp_addlinkedserver 'OldDatabase', '', 'SQLOLEDB', 'ServerName', ''
> exec sp_addlinkedsrvlogin 'OldDatabase', 'false', NULL, 'UserName',
> 'Password'
> Then we execute a series of "INSERT INTO" statements to import data like
> this:
> INSERT INTO ATABLE( FIELD1, FIELD2, ... )
> SELECT T.FIELD1, T.FIELD2, ...
> FROM OPENQUERY( OldDatabase, 'SELECT * FROM DatabaseName.dbo.TableName')
> AS
> T
> There are about 10 "INSERT INTO" statements and all execute fine except
> for
> one. The failing one (the 7th one) returns this error:
> "MSDTC on server 'ServerName' is unavailable."
> My DTC service is inactive, but that shouldn't matter since all other 9
> statements executed fine. If I enable the service and rerun the failing
> SQL
> statement, it returns this error:
> "The operation could not be performed because the OLE DB provider
> 'SQLOLEDB'
> was unable to begin a distributed transaction.
> [OLE/DB provider returned message: New transaction cannot enlist in the
> specified transaction coordinator. ]
> OLE DB error trace [OLE/DB Provider 'SQLOLEDB'
> ITransactionJoin::JoinTransaction returned 0x8004d00a]."
> What's strange is that *all* "INSERT INTO" statements have the same format
> as shown above, and only one of them fails. All others after that failing
> statement run fine. This also happens using SQL Query Analyzer and
> happens
> no matter how many times I run the script. Can anyone explain to me
> what's
> going on here and how to fix it?
> --
> Thanks,
> Jon E. Scott
> Blue Orb Software
> http://www.blueorbsoft.com
>
>

Wednesday, March 21, 2012

Problem importing data from linked server

Sorry if this is the wrong newsgroup. If so, please point me to the right
one.
We use a linked server to import data from an old SQL 2000 database to a new
SQL 2000 database. We create a linked server like this:
exec sp_addlinkedserver 'OldDatabase', '', 'SQLOLEDB', 'ServerName', ''
exec sp_addlinkedsrvlogin 'OldDatabase', 'false', NULL, 'UserName',
'Password'
Then we execute a series of "INSERT INTO" statements to import data like
this:
INSERT INTO ATABLE( FIELD1, FIELD2, ... )
SELECT T.FIELD1, T.FIELD2, ...
FROM OPENQUERY( OldDatabase, 'SELECT * FROM DatabaseName.dbo.TableName') AS
T
There are about 10 "INSERT INTO" statements and all execute fine except for
one. The failing one (the 7th one) returns this error:
"MSDTC on server 'ServerName' is unavailable."
My DTC service is inactive, but that shouldn't matter since all other 9
statements executed fine. If I enable the service and rerun the failing SQL
statement, it returns this error:
"The operation could not be performed because the OLE DB provider 'SQLOLEDB'
was unable to begin a distributed transaction.
[OLE/DB provider returned message: New transaction cannot enlist in the
specified transaction coordinator. ]
OLE DB error trace [OLE/DB Provider 'SQLOLEDB'
ITransactionJoin::JoinTransaction returned 0x8004d00a]."
What's strange is that *all* "INSERT INTO" statements have the same format
as shown above, and only one of them fails. All others after that failing
statement run fine. This also happens using SQL Query Analyzer and happens
no matter how many times I run the script. Can anyone explain to me what's
going on here and how to fix it?
--
Thanks,
Jon E. Scott
Blue Orb Software
http://www.blueorbsoft.comHi
I can only think that this is a network problem! Check the SQL Server and
Event Logs, try changing protocols and possibly try four part naming instead
of OPENQUERY.
John
"Jon E. Scott" <NOSPAMsupport@.blueorbsoft.comNOSPAM> wrote in message
news:%23VenwxNIFHA.3108@.tk2msftngp13.phx.gbl...
> Sorry if this is the wrong newsgroup. If so, please point me to the right
> one.
> We use a linked server to import data from an old SQL 2000 database to a
> new
> SQL 2000 database. We create a linked server like this:
> exec sp_addlinkedserver 'OldDatabase', '', 'SQLOLEDB', 'ServerName', ''
> exec sp_addlinkedsrvlogin 'OldDatabase', 'false', NULL, 'UserName',
> 'Password'
> Then we execute a series of "INSERT INTO" statements to import data like
> this:
> INSERT INTO ATABLE( FIELD1, FIELD2, ... )
> SELECT T.FIELD1, T.FIELD2, ...
> FROM OPENQUERY( OldDatabase, 'SELECT * FROM DatabaseName.dbo.TableName')
> AS
> T
> There are about 10 "INSERT INTO" statements and all execute fine except
> for
> one. The failing one (the 7th one) returns this error:
> "MSDTC on server 'ServerName' is unavailable."
> My DTC service is inactive, but that shouldn't matter since all other 9
> statements executed fine. If I enable the service and rerun the failing
> SQL
> statement, it returns this error:
> "The operation could not be performed because the OLE DB provider
> 'SQLOLEDB'
> was unable to begin a distributed transaction.
> [OLE/DB provider returned message: New transaction cannot enlist in the
> specified transaction coordinator. ]
> OLE DB error trace [OLE/DB Provider 'SQLOLEDB'
> ITransactionJoin::JoinTransaction returned 0x8004d00a]."
> What's strange is that *all* "INSERT INTO" statements have the same format
> as shown above, and only one of them fails. All others after that failing
> statement run fine. This also happens using SQL Query Analyzer and
> happens
> no matter how many times I run the script. Can anyone explain to me
> what's
> going on here and how to fix it?
> --
> Thanks,
> Jon E. Scott
> Blue Orb Software
> http://www.blueorbsoft.com
>
>|||Is the server you are linking to running Server 2003?
nivek
"Jon E. Scott" <NOSPAMsupport@.blueorbsoft.comNOSPAM> wrote in message
news:%23VenwxNIFHA.3108@.tk2msftngp13.phx.gbl...
> Sorry if this is the wrong newsgroup. If so, please point me to the right
> one.
> We use a linked server to import data from an old SQL 2000 database to a
> new
> SQL 2000 database. We create a linked server like this:
> exec sp_addlinkedserver 'OldDatabase', '', 'SQLOLEDB', 'ServerName', ''
> exec sp_addlinkedsrvlogin 'OldDatabase', 'false', NULL, 'UserName',
> 'Password'
> Then we execute a series of "INSERT INTO" statements to import data like
> this:
> INSERT INTO ATABLE( FIELD1, FIELD2, ... )
> SELECT T.FIELD1, T.FIELD2, ...
> FROM OPENQUERY( OldDatabase, 'SELECT * FROM DatabaseName.dbo.TableName')
> AS
> T
> There are about 10 "INSERT INTO" statements and all execute fine except
> for
> one. The failing one (the 7th one) returns this error:
> "MSDTC on server 'ServerName' is unavailable."
> My DTC service is inactive, but that shouldn't matter since all other 9
> statements executed fine. If I enable the service and rerun the failing
> SQL
> statement, it returns this error:
> "The operation could not be performed because the OLE DB provider
> 'SQLOLEDB'
> was unable to begin a distributed transaction.
> [OLE/DB provider returned message: New transaction cannot enlist in the
> specified transaction coordinator. ]
> OLE DB error trace [OLE/DB Provider 'SQLOLEDB'
> ITransactionJoin::JoinTransaction returned 0x8004d00a]."
> What's strange is that *all* "INSERT INTO" statements have the same format
> as shown above, and only one of them fails. All others after that failing
> statement run fine. This also happens using SQL Query Analyzer and
> happens
> no matter how many times I run the script. Can anyone explain to me
> what's
> going on here and how to fix it?
> --
> Thanks,
> Jon E. Scott
> Blue Orb Software
> http://www.blueorbsoft.com
>
>

Problem importing data from Interbase using DTS

Hi im trying to import a old Interbase 6 database using MSSQL 2000 DTS
import wizard.
Im using Firebird / Interbase 1.5 ODBC driver as provider for the Interbase.
Everything works perfect if i choose to import one table at a time. But if i
choose 2 or more the wizards excutes the DDL (tables ar created) then it
just locks up. No error, just no progress. I have tried other ODBC provider
but with the exact same result.
Any idea why the DTS Data Iimport wizard locks up?
Thanks in regards
Anders, Denmark
Hi
If the ODBC driver does not return control to DTS, DTS looks like it has
hung.
That indicates a problem with the driver as not with DTS.
This problem does not occur with Oracle, Access or SQL Server drivers.
Regards
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Anders K. Jacobsen [DK]" <none@.at.all> wrote in message
news:uWFBqpE4EHA.208@.TK2MSFTNGP12.phx.gbl...
> Hi im trying to import a old Interbase 6 database using MSSQL 2000 DTS
> import wizard.
> Im using Firebird / Interbase 1.5 ODBC driver as provider for the
Interbase.
> Everything works perfect if i choose to import one table at a time. But if
i
> choose 2 or more the wizards excutes the DDL (tables ar created) then it
> just locks up. No error, just no progress. I have tried other ODBC
provider
> but with the exact same result.
> Any idea why the DTS Data Iimport wizard locks up?
> Thanks in regards
> Anders, Denmark
>
|||> If the ODBC driver does not return control to DTS, DTS looks like it has
> hung.
> That indicates a problem with the driver as not with DTS.
> This problem does not occur with Oracle, Access or SQL Server drivers.
Strange. Do you know of any Interbase ODBC provider wich is "compatible"
with DTS import?
I have tried:
EasySoft ODBC for interbase
XTG ODBC for interbase
FireBird / Interbase ODBC for interbase
IBProvider ODBC for interbase
All with the same result. Creates DDL then hang when starting to convert
data, if one table is choosen it works perfectly.
Suggestions to ODBC drivers?
Anders
|||Hi Anders,
I am using the Gemini Firebird / Interbase ODBC Driver for exactly what you
are trying to do. We're slowly converting all our clients from Interbase to
SQL Server. I use this driver for a DTS package which pulls about 80 tables
from Interbase source into our SQL Server target database. However, I use an
individual Transform Data task for each table. It's a nightmare to maintain
as we evolve the database structure but it runs really nicely, with multiple
TD tasks executing in parallel.
http://www.ibdatabase.com/
https://secure.shareit.com/shareit/c...oductid=148695
Hope this helps,
Joe Geretz
"Anders K. Jacobsen [DK]" <none@.at.all> wrote in message
news:ulIOTdF4EHA.2404@.TK2MSFTNGP14.phx.gbl...
> Strange. Do you know of any Interbase ODBC provider wich is "compatible"
> with DTS import?
> I have tried:
> EasySoft ODBC for interbase
> XTG ODBC for interbase
> FireBird / Interbase ODBC for interbase
> IBProvider ODBC for interbase
> All with the same result. Creates DDL then hang when starting to convert
> data, if one table is choosen it works perfectly.
> Suggestions to ODBC drivers?
> Anders
>
>
|||> I am using the Gemini Firebird / Interbase ODBC Driver for exactly what
> you are trying to do. We're slowly converting all our clients from
> Interbase to SQL Server. I use this driver for a DTS package which pulls
> about 80 tables from Interbase source into our SQL Server target database.
> However, I use an individual Transform Data task for each table. It's a
> nightmare to maintain as we evolve the database structure but it runs
> really nicely, with multiple TD tasks executing in parallel.
We try to create views on the IB database wich match our new tablestructure
seems quite maintainable not sure though. Anyway. I have already tried with
the Gemini ODBC driver...same results. Its real strange. Because everything
else works.
|||Which Task are you using to transfer the data?
It sounds like you're issuing SQL to insert into X select * from Y? This is
conveniently maintained, but you can't do this with the Data Pump. Or can
you?
- Joe Geretz -
"Anders K. Jacobsen [DK]" <none@.at.all> wrote in message
news:%23gg2PBu4EHA.824@.TK2MSFTNGP11.phx.gbl...
> We try to create views on the IB database wich match our new
> tablestructure seems quite maintainable not sure though. Anyway. I have
> already tried with the Gemini ODBC driver...same results. Its real
> strange. Because everything else works.
>
>

Problem Having Old TRN Files Deleted

Greetings!
I am working with two different SQL installations on two different servers.
Both have Enterprise Mgr Maintenance Plans that specify that both the
BAK and TRN files should be deleted after 1 day. On the one server,
both deletions occur just fine. On the second, the old BAK's get deleted,
but not the old TRN's. I have reviewed the maintenance plan settings
several times, but can't see anything amiss. Anyone have any ideas?
Would Be Grateful,
Tom
As long as the MP's are not too complex, I would try deleting and rebuilding
them. I have run into similar anomalies before inwhich this was the
solution.
HTH,
Chris
"Tom Glasser" <TomGlasser@.discussions.microsoft.com> wrote in message
news:74302972-33C1-470A-A18A-F273B84B449F@.microsoft.com...
> Greetings!
> I am working with two different SQL installations on two different
servers.
> Both have Enterprise Mgr Maintenance Plans that specify that both the
> BAK and TRN files should be deleted after 1 day. On the one server,
> both deletions occur just fine. On the second, the old BAK's get deleted,
> but not the old TRN's. I have reviewed the maintenance plan settings
> several times, but can't see anything amiss. Anyone have any ideas?
> Would Be Grateful,
> Tom
>

Saturday, February 25, 2012

Problem converting VS2003 code to VS2005

Hi:

I am trying to convert my VS2003 project to VS2005 beta 2. The actual conversion has gone fine, but some code that was working fine under to old IDE is now giving me an exception when run under the VS2005 generated code.

The code is:

using (SqlConnection conn = new SqlConnection("Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=GestionNET00001;Data Source=localhost")

{
...
}

And the error I'm getting is:
{"The type initializer for 'System.Data.SqlClient.SqlConnection' threw an exception."}

Has anyone any idea why this is happening?

TIA,
MartinH.

You've got invalid parenthesis in that code sample you know?

Anyway, have you tried a simple declaration instead of using the using statement?
i.e.

SqlConnection conn;
conn = new SqlConnection("Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=GestionNET00001;Data Source=localhost");

Does it fail on either of those lines if it's written out like that?
If not, then merge them together into the same statement and see if that works.
If it does, try putting them back into the using statement and see what happens...|||

plenderj wrote:

You've got invalid parenthesis in that code sample you know?


Yes that was a typo, sorry, but in my code it was correct and compiled correctly.

plenderj wrote:

Anyway, have you tried a simple declaration instead of using the using statement?
i.e.

SqlConnection conn;
conn = new SqlConnection("Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=GestionNET00001;Data Source=localhost");

Does it fail on either of those lines if it's written out like that?


I have since tried to declare and instantiate the connection without a connection string, but still have the same problem. I have also tried to eliminate the 'using' block, still the same.
There seems to be a problem at runtime, but I have checked the 'references' and Syatem.Data is included, I don't think I need anything else for SqlConnection.
Finally, when I installed VS2005 b2, the SqlConnection, SqlCommand and other family members were not installed on the tool pallete, I have to install them manuallly. Is this standard procedure for VS2005? If not this may be related to the problem I have.
TIA,
MartinH.|||I had a problem with VS2005 not automatically including the System.data namespace references for me to use and had to manually add it to the project properties.

Try also including the System.Data.SqlClient namespace|||Just for the record, I have found the solution to the afore mentioned problem.
It was 2 fold. First, I was using the Microsoft Enterprise Library for January 2005, and once I removed this from my project it worked fine. Maybe the June update will work okay, I will have to try it.
Secondly, I use Developer Express's XPO and had the 'trace' feature enabled (within the App.config file). Turning this option off also solved the problem.
I have tried each option individually and they both cause the problem to reappear.
HTH,
MartinH.|||I am having the same issue. The designer generated code is throwing the same error from the InitConnection function of one of my datasets. This only happens when I have a listener configured in the app.config file. If I comment out the Systems.Diagnotics section of the config file, I no longer get the error. The highlighted line below is throwing the error.

This seems to be a bug in how the config file is being processed.

Private Sub InitConnection()

Me.m_connection = New System.Data.SqlClient.SqlConnection

Me.m_connection.ConnectionString = DnD.Settings.Default.DnDConnectionString

End Sub

|||It's not a bug -- the confusing thing was where the error was thrown. Drilling into the exception made it clear that I had a typo in the diagnostics section of the config file.

Monday, February 20, 2012

Problem converting Crystal Report to RS2005

I've run into a problem while converting an old Crystal report into a
RS2005 version. The report in question gets a dataset from a SQL
stored procedure. The stored procedure passes details on paper
production by day, machine and grade. The report groups the data by
grade and then by machine. In the grade group footer, I perform a
calculation on the data that is as follows:
=sum(GradePeriod.value)*avg(SBK.value). This works the same as in the
crystal report. However, in the crystal report, they declare a global
variable, that basically creates a running sum of this calculation.
So in the Machine footer, it is a sum of all of the
sum(GradePeriod.value)*avg(SBK.value). Now if I try in RS to sum the
values in the footer by using
=sum(sum(GradePeriod.value)*avg(SBK.value)) I get an error that says
you cannot use an aggregate of an aggregate. So my question is, how
do I replicate what is going on in the Crystal Report in RS?In RS you need to give some thing like this in the header or footer you cant
give directly. Try this. (you should use "reportitems")
=Sum(ReportItems!Gradeperiod.Value)
Amarnath, MCTS
"dachrist" wrote:
> I've run into a problem while converting an old Crystal report into a
> RS2005 version. The report in question gets a dataset from a SQL
> stored procedure. The stored procedure passes details on paper
> production by day, machine and grade. The report groups the data by
> grade and then by machine. In the grade group footer, I perform a
> calculation on the data that is as follows:
> =sum(GradePeriod.value)*avg(SBK.value). This works the same as in the
> crystal report. However, in the crystal report, they declare a global
> variable, that basically creates a running sum of this calculation.
> So in the Machine footer, it is a sum of all of the
> sum(GradePeriod.value)*avg(SBK.value). Now if I try in RS to sum the
> values in the footer by using
> =sum(sum(GradePeriod.value)*avg(SBK.value)) I get an error that says
> you cannot use an aggregate of an aggregate. So my question is, how
> do I replicate what is going on in the Crystal Report in RS?
>|||It wants me to put the sum(ReportItems!GradePeriod.value) in the Page
Footer. I need to have these sums at each group footer, because I
cannot have one paper machine per page.
Dave
On Mar 15, 2:33 am, Amarnath <Amarn...@.discussions.microsoft.com>
wrote:
> In RS you need to give some thing like this in the header or footer you cant
> give directly. Try this. (you should use "reportitems")
> =Sum(ReportItems!Gradeperiod.Value)
> Amarnath, MCTS
>
> "dachrist" wrote:
> > I've run into a problem while converting an old Crystal report into a
> > RS2005 version. The report in question gets a dataset from a SQL
> > stored procedure. The stored procedure passes details on paper
> > production by day, machine and grade. The report groups the data by
> > grade and then by machine. In the grade group footer, I perform a
> > calculation on the data that is as follows:
> > =sum(GradePeriod.value)*avg(SBK.value). This works the same as in the
> > crystal report. However, in the crystal report, they declare a global
> > variable, that basically creates a running sum of this calculation.
> > So in the Machine footer, it is a sum of all of the
> > sum(GradePeriod.value)*avg(SBK.value). Now if I try in RS to sum the
> > values in the footer by using
> > =sum(sum(GradePeriod.value)*avg(SBK.value)) I get an error that says
> > you cannot use an aggregate of an aggregate. So my question is, how
> > do I replicate what is going on in the Crystal Report in RS... Hide quoted text -
> - Show quoted text -

Problem connecting to SQL Server 2005 database instance

I have an old ASP app that I have had to migrate to use SQL Server 2005. I have two pages that are virtually identical (one is edit only the other makes provision for adding new records - I didn't write these apps but I am responsible for making them work now). One page connect successfully to the SQL Server Instance and the other does not. They are using EXACTLY the same connect string.

The only weird thing that has transpired is that we migrated to Active Directory recently. The ASP app that connects successfully was already on the web server prior to AD migration. The one that does not connect successfully was migrated after AD migration.

Further, the app that does not connect correctly when it is installed on my production web server does connect correctly when I am running it under IIS on my local development machine.

Anyone have any ideas about what could be wrong here? I'm suspecting that some credentialing issue is the problem as the big difference on the production web server is that the app that connects correctly from there was there pre AD migration and the app that does not connect correctly was not.

several questions:
1) Can you post your connection string here?
2) Did you get any error message?
3) Is you IIS server on the same box as your SQL Server?

Thanks.

|||

The SQL Server instance is running behind a firewall on a fairly beefy Win 2003 server. The IIS server is a separate machine on WIN 2003 Server behind the same firewall.

The error message I get is as follows:

Microsoft OLE DB Provider for SQL Server error '80004005'

[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.

/jblol/od_sheets_edit/Od_sheets.asp, line 32

Here is the connection string section that will not connect (of course uid and pwd are changed to protect the guilty).

<%@. Language=VBScript %>

<!--#Include File = "Resources/adovbs.inc"-->
<script LANGUAGE="vbscript">
<!--
Sub button2_onclick
if FORM1.selORGANIZATION.value = "" then
msgbox "You must first select a location"
Exit Sub
End If

if FORM1.txtPart.value = "" then
msgbox "You must provide an Item Number"
Exit Sub
End If

FORM1.action = "QueryPart.asp"
FORM1.submit
End Sub

-->
</script>
<html>
<%

Dim rst, conn, strDeptText, strOperation
'Here's Where we will Customize Which Group of Data we are Querying........
strOperation = Request.QueryString("txtOperation")
Set conn = Server.CreateObject("ADODB.Connection")
Set rst = server.CreateObject("ADODB.Recordset")
conn.ConnectionString = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=XXXXXX;Password=XXXXXX;Initial Catalog=OD_Sheets;Data Source=TSD0N1D01/TSDSQL200501"
conn.Open

Here is the section of pretty identical code that does connect properly.

<!--#Include File = "Resources/adovbs.inc"-->
<script LANGUAGE="vbscript">
<!--
Sub button2_onclick
if FORM1.selORGANIZATION.value = "" then
msgbox "You must first select a location"
Exit Sub
End If

if FORM1.txtPart.value = "" then
msgbox "You must provide a Item Number"
Exit Sub
End If

FORM1.action = "QueryPart.asp"
FORM1.submit
End Sub

-->
</script>
<html>
<%

Dim rst, conn, strDeptText, strOperation
'Here's Where we will Customize Which Group of Data we are Querying........
strOperation = Request.QueryString("txtOperation")
Set conn = Server.CreateObject("ADODB.Connection")
Set rst = server.CreateObject("ADODB.Recordset")
conn.ConnectionString = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=XXXXXX;Password=XXXXXX;Initial Catalog=OD_Sheets;Data Source=TSD0N1D01\TSDSQL200501"
conn.Open

%>

|||You know, it looks to me as if this must somehow be trying to execute an older version of this page that is perhaps in a cache or something. These things are identical and it makes no sense that one would connect just fine and one would not. I'm going to pursue that idea and see if it goes anywhere.|||

for the first one: should be:
--Data Source=TSD0N1D01\TSDSQL200501--

rather then:
--Data Source=TSD0N1D01/TSDSQL200501--

Please confirm if this fix your problem.

Thanks,

|||

Duh, how stupid am I. That was the problem.

Steve Wells - the stupidest programmer who manages to still stay employed despite it