Showing posts with label connection. Show all posts
Showing posts with label connection. Show all posts

Tuesday, March 27, 2012

DB2 ODBC Connection Problems

Hello,

I've recently run across a couple of problems trying to connect to DB2 using the .NET ODBC Provider.

1) I can create a DataSource using the DataSource designer, and when I edit the connection, the User Name and Password text boxes are empty. If I fill in the correct information and hit "Test Connection", I am able to connect. However, this information is not saved in the DataSource the next time I open it or try to run a Data Flow task that uses it! Is there some property I can set to fix this?

2) When I open up a solution, the DataSource appears to be trying to connect to the DB2 server, and perhaps there is no valid User Name and Password, the connection is refused and I eventually get locked out of my account. This could be related to the issue above.

Does anyone have any experience connecting to DB2 using either an ODBC driver or the perhaps the IBM DB2 UDB iSeries OLE DB providers?

Thanks in advance,

Mark

Mark,

The same problem occurs with Progress Database using .NET ODBC Provider and a didn′t find a solution. Problably is a .NET ODBC Provider problem but I don′t know how to fix. If you find a solution, please post here.

Question: Do you receive this error message ?

“Error at Data Flow Task [DataReader Soucer [135]]: Cannot acquire a managed connection from the run-time connection manager”

Thanks.

Rodrigo Chagas

|||

I found this post:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=93045&SiteID=1

Maybe will be useful for you. It seems ODBC connections are having a lot of problems in SQL 2005.

My hope is getting smaller...

|||This is not a problem with .Net, but rather the way in which the ODBC driver builds the connection string or handles security. Some drivers including the CA ODBC driver do not append the password property to the connection string. So when you attempt to connect it will prompt for a password. Depending on how you invoke the program, you may not even see the prompt.
One way to resolve the issue is to append the password to your connection string in the form of "Password=MyPass;"
I've used the OLEDB provider for DB2 before, but there are some limitations to it. Per IBM, OLEDB does not provide the same level of functionality as their ODBC drivers. One thing that OLEDB does not provide is scrollable cursors.
I haven't used DB2 in almost a year, so IBM may have some updated drivers. Also MS just released their version of an OLEDB provider for DB2, so you could try it. You can get it at the following url.
http://www.microsoft.com/downloads/details.aspx?familyid=D09C1D60-A13C-4479-9B91-9E8B9D835CDC&displaylang=en
Larry

DB2 Linked Server

Hi List, anyone can help me?
I need to make a connection between SQL2000 SP3 and DB2 running on AS400.
When i try to make a Linked server i could not be able to see the ODBC
Driver for DB2.
What driver is needed to install the odbc support? is from MS?
ThanksHi
You need to get the DB2 ODBC/OLE DB driver from IBM and install it on your
SQL Server.
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/
"Tinchos" <Tinchos@.discussions.microsoft.com> wrote in message
news:A9564915-2DC7-431F-B1C3-BC4565CC5DCB@.microsoft.com...
> Hi List, anyone can help me?
> I need to make a connection between SQL2000 SP3 and DB2 running on AS400.
> When i try to make a Linked server i could not be able to see the ODBC
> Driver for DB2.
> What driver is needed to install the odbc support? is from MS?
> Thanks|||Mike Epprecht (SQL MVP) wrote:
> Hi
> You need to get the DB2 ODBC/OLE DB driver from IBM and install it on your
> SQL Server.
> 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/
> "Tinchos" <Tinchos@.discussions.microsoft.com> wrote in message
> news:A9564915-2DC7-431F-B1C3-BC4565CC5DCB@.microsoft.com...
>>Hi List, anyone can help me?
>>I need to make a connection between SQL2000 SP3 and DB2 running on AS400.
>>When i try to make a Linked server i could not be able to see the ODBC
>>Driver for DB2.
>>What driver is needed to install the odbc support? is from MS?
>>Thanks
>
>
and when you do, please tell us how did you set the connection string

DB2 Linked Server

Hi List, anyone can help me?
I need to make a connection between SQL2000 SP3 and DB2 running on AS400.
When i try to make a Linked server i could not be able to see the ODBC
Driver for DB2.
What driver is needed to install the odbc support? is from MS?
ThanksHi
You need to get the DB2 ODBC/OLE DB driver from IBM and install it on your
SQL Server.
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/
"Tinchos" <Tinchos@.discussions.microsoft.com> wrote in message
news:A9564915-2DC7-431F-B1C3-BC4565CC5DCB@.microsoft.com...
> Hi List, anyone can help me?
> I need to make a connection between SQL2000 SP3 and DB2 running on AS400.
> When i try to make a Linked server i could not be able to see the ODBC
> Driver for DB2.
> What driver is needed to install the odbc support? is from MS?
> Thanks|||Mike Epprecht (SQL MVP) wrote:
> Hi
> You need to get the DB2 ODBC/OLE DB driver from IBM and install it on your
> SQL Server.
> 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/
> "Tinchos" <Tinchos@.discussions.microsoft.com> wrote in message
> news:A9564915-2DC7-431F-B1C3-BC4565CC5DCB@.microsoft.com...
>
>
>
and when you do, please tell us how did you set the connection string

DB2 Linked Server

Hi List, anyone can help me?
I need to make a connection between SQL2000 SP3 and DB2 running on AS400.
When i try to make a Linked server i could not be able to see the ODBC
Driver for DB2.
What driver is needed to install the odbc support? is from MS?
Thanks
Hi
You need to get the DB2 ODBC/OLE DB driver from IBM and install it on your
SQL Server.
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/
"Tinchos" <Tinchos@.discussions.microsoft.com> wrote in message
news:A9564915-2DC7-431F-B1C3-BC4565CC5DCB@.microsoft.com...
> Hi List, anyone can help me?
> I need to make a connection between SQL2000 SP3 and DB2 running on AS400.
> When i try to make a Linked server i could not be able to see the ODBC
> Driver for DB2.
> What driver is needed to install the odbc support? is from MS?
> Thanks
|||Mike Epprecht (SQL MVP) wrote:
> Hi
> You need to get the DB2 ODBC/OLE DB driver from IBM and install it on your
> SQL Server.
> 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/
> "Tinchos" <Tinchos@.discussions.microsoft.com> wrote in message
> news:A9564915-2DC7-431F-B1C3-BC4565CC5DCB@.microsoft.com...
>
>
and when you do, please tell us how did you set the connection string

DB2 driver/connection issue

Hi guys,

I have a kind of weird situation that may be causing this problem. My setup is that I'm remote desktopping into a 64-bit box on a client's network. They installed SSIS there, I use login 1 which has rights to the box, but none of the databases. To do that I run SSIS as login 2, who can hit the databases.

I've got two datasources for this project one is DB2 and the other is SqlServer2k5. I've been focusing on the DB2 (I'm running the Microsoft OLEDB Provider for DB2 that was part of the feature pack from feb 2007). I've registered the dll with "regsvr32.exe /s /c ibmdadb2.dll" and tried to import database settings from a pdb with "db2cfimp db2Settings.pdb". The connection to, we'll call it, DB2A doesn't actually show up in the "Admin Tools\ODBC Data Source Administrator", but seeing as how the connection sort of works I don't think this is the problem.

Using the "IBM OLE DB Provider for DB2 Servers" connection I can connect to the DB2 database in SSIS's Data Flow with a DataReader Source. The correct columns are shown in the column mappings and everything looks good while designing.

Upon executing the package I get the following error:

SSIS package "Package.dtsx" starting.
Information: 0x4004300A at TGMV019, DTS.Pipeline: Validation phase is beginning.
Error: 0xC0047062 at TGMV019, GM19 [31]: System.InvalidOperationException: The 'IBMDADB2.1' provider is not registered on the local machine.
at Microsoft.SqlServer.Dts.Runtime.Wrapper.IDTSConnectionManager90.AcquireConnection(Object pTransaction)
at Microsoft.SqlServer.Dts.Pipeline.DataReaderSourceAdapter.AcquireConnections(Object transaction)
at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostAcquireConnections(IDTSManagedComponentWrapper90 wrapper, Object transaction)
Error: 0xC0047017 at TGMV019, DTS.Pipeline: component "GM19" (31) failed validation and returned error code 0x80131509.
Error: 0xC004700C at TGMV019, DTS.Pipeline: One or more component failed validation.
Error: 0xC0024107 at TGMV019: There were errors during task validation.
SSIS package "Package.dtsx" finished: Failure.

The problem sure looks like it's with the IBMDADB2.1 provider. I have retried the regsvr32 command (is this just a 32bit version?) to no avail. Does this assignment require a reboot (because they installed this on a training database box that really can't be easily rebooted)?

Thanks for any ideas, I'm fresh out

Jeff
Since you are using the Microsoft OLEDB Provider for DB2, why aren't you using the OLE DB Source in the data flow instead of the DataReader source?|||I gave up on using "OLE DB Provider: Microsoft OLE DB Provider for DB2" because I can't seem to get away from the error: "Test connection failed because of an error in initializing provider. The parameter is incorrect.". Also, these forums (I think) said the IBM one was more reliable than the microsoft one.

I'm not sure what to enter under: Data Link Properties. I've tried various combination for 'Initial catalog', 'package collection' and 'default schema' but none of them work. Also, pressing the "Packages" button on the bottom crashes visual studio, so I'm not sure what's supposed to go there.
|||See if this helps any:
http://www.ssistalk.com/db2_configurations.jpg

That is the list of all of the properties for one of my connections that I use on a daily basis to transfer records from DB2 to SQL Server 2005.

Db2 Connection Problems SSIS (OLEDB)

Hello,

I'm trying to connect to a DB2 database via SSIS and I'm getting some problems:

I'm creating a new OLE DB Connection Manager and I'm getting two distinct errors:

1) When I try to use "IBM OLEDB Provider for DB2 Servers" I can create the connection manager and the connection is tested successfully.

But when I try to use the connection in OLE DB Source when I will list the tables I get this error:

Could not retrieve the table information for the connection manager 'MyDataSource'.
truncated. SQLSTATE=01004
CLI0002W Data truncated. SQLSTATE=01004

ADDITIONAL INFORMATION:

truncated. SQLSTATE=01004
CLI0002W Data truncated. SQLSTATE=01004 (IBM OLE DB Provider for DB2 Servers)

2) When I try to use "Microsoft OLE DB Provider for DB2" when I try to test the connection I get this error:

Test connection failed because of an error in initializing provider. The parameter is incorrect.

Anyone had these problems ?

Thanks,

Guber

i have been working on DTS/SSIS using DB2OLEDB. I do not have the error of using "Microsoft OLE DB Provider for DB2", which you described.

I guess that your connection manager was perhaps not correctly configured. Create a UDL file first to figure out the correct connection string and then create DB2 connection manager inside SSIS.

If you can post your connection string here, I should be able to tell you what went wrong.

Steve

|||Hi,

I am also getting the same problem. what is configuration you are using?
|||

I met the same problem yesteday. I found a solution to it.

My source table in db2 had a column defined decimal(20,2),but the length of numeric in SSIS is 16.

So the data will bu truncated .

When i had used a script component to read data from db2,the problem did not appear.

Db2 Connection Problems SSIS (OLEDB)

Hello,

I'm trying to connect to a DB2 database via SSIS and I'm getting some problems:

I'm creating a new OLE DB Connection Manager and I'm getting two distinct errors:

1) When I try to use "IBM OLEDB Provider for DB2 Servers" I can create the connection manager and the connection is tested successfully.

But when I try to use the connection in OLE DB Source when I will list the tables I get this error:

Could not retrieve the table information for the connection manager 'MyDataSource'.
truncated. SQLSTATE=01004
CLI0002W Data truncated. SQLSTATE=01004

ADDITIONAL INFORMATION:

truncated. SQLSTATE=01004
CLI0002W Data truncated. SQLSTATE=01004 (IBM OLE DB Provider for DB2 Servers)

2) When I try to use "Microsoft OLE DB Provider for DB2" when I try to test the connection I get this error:

Test connection failed because of an error in initializing provider. The parameter is incorrect.

Anyone had these problems ?

Thanks,

Guber

i have been working on DTS/SSIS using DB2OLEDB. I do not have the error of using "Microsoft OLE DB Provider for DB2", which you described.

I guess that your connection manager was perhaps not correctly configured. Create a UDL file first to figure out the correct connection string and then create DB2 connection manager inside SSIS.

If you can post your connection string here, I should be able to tell you what went wrong.

Steve

|||Hi,

I am also getting the same problem. what is configuration you are using?
|||

I met the same problem yesteday. I found a solution to it.

My source table in db2 had a column defined decimal(20,2),but the length of numeric in SSIS is 16.

So the data will bu truncated .

When i had used a script component to read data from db2,the problem did not appear.

Db2 Connection Problems SSIS (OLEDB)

Hello,

I'm trying to connect to a DB2 database via SSIS and I'm getting some problems:

I'm creating a new OLE DB Connection Manager and I'm getting two distinct errors:

1) When I try to use "IBM OLEDB Provider for DB2 Servers" I can create the connection manager and the connection is tested successfully.

But when I try to use the connection in OLE DB Source when I will list the tables I get this error:

Could not retrieve the table information for the connection manager 'MyDataSource'.
truncated. SQLSTATE=01004
CLI0002W Data truncated. SQLSTATE=01004

ADDITIONAL INFORMATION:

truncated. SQLSTATE=01004
CLI0002W Data truncated. SQLSTATE=01004 (IBM OLE DB Provider for DB2 Servers)

2) When I try to use "Microsoft OLE DB Provider for DB2" when I try to test the connection I get this error:

Test connection failed because of an error in initializing provider. The parameter is incorrect.

Anyone had these problems ?

Thanks,

Guber

i have been working on DTS/SSIS using DB2OLEDB. I do not have the error of using "Microsoft OLE DB Provider for DB2", which you described.

I guess that your connection manager was perhaps not correctly configured. Create a UDL file first to figure out the correct connection string and then create DB2 connection manager inside SSIS.

If you can post your connection string here, I should be able to tell you what went wrong.

Steve

|||Hi,

I am also getting the same problem. what is configuration you are using?
|||

I met the same problem yesteday. I found a solution to it.

My source table in db2 had a column defined decimal(20,2),but the length of numeric in SSIS is 16.

So the data will bu truncated .

When i had used a script component to read data from db2,the problem did not appear.

DB2 Connection Custom Assembly

Have a small problem. I have written a custom assembly to query a db2
database through a dsn datasource. It works fine in Report Designer but
shows the #error message in the fields on the report once it is published.
Following is my rssrvpolicy.config entry:
<CodeGroup
class="UnionCodeGroup"
version="1.0.0.0"
PermissionSetName="FullTrust"
Name="DB2Link"
Description="This assembly connects to the DB2 database server and
retrieves information">
<IMembershipCondition
class="UrlMembershipCondition"
version="1.0.0.0"
Url="C:\Program Files\Microsoft SQL
Server\MSSQL\Reporting Services\ReportServer\bin\DB2Link.dll"
/>
</CodeGroup>
I have also added the following code to my Class Library prior to compiling
and deploying:
Dim Permission As New
Odbc.OdbcPermission(Security.Permissions.PermissionState.Unrestricted)
Permission.Assert()
but to no avail. Any help would be greatly appreciated. BTW, the ODBC
connection information is all housed within the library. It takes a string
value passed from SRS and returns a single string value. Nothing fancy...
Do I need to create an access group to the DSN File?
Thanks,Asserting the ODBC Permission might not be sufficient. You may want to try
asserting full trust in the custom assembly:
[PermissionSet(SecurityAction.Assert, Unrestricted=true)]
public foo()
{
// Your code:
// open database connection
// ...
}
See also this thread related to connecting to Oracle from a custom assembly:
http://msdn.microsoft.com/newsgroups/default.aspx?dg=microsoft.public.sqlserver.reportingsvcs&mid=3cd1a1de-15d4-41fe-bc9b-3c9df93ac2ee&sloc=en-us
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"JamesH" <JamesH@.discussions.microsoft.com> wrote in message
news:84982C3D-32DD-4D3B-B46C-2766810046F0@.microsoft.com...
> Have a small problem. I have written a custom assembly to query a db2
> database through a dsn datasource. It works fine in Report Designer but
> shows the #error message in the fields on the report once it is published.
> Following is my rssrvpolicy.config entry:
> <CodeGroup
> class="UnionCodeGroup"
> version="1.0.0.0"
> PermissionSetName="FullTrust"
> Name="DB2Link"
> Description="This assembly connects to the DB2 database server and
> retrieves information">
> <IMembershipCondition
> class="UrlMembershipCondition"
> version="1.0.0.0"
> Url="C:\Program Files\Microsoft SQL
> Server\MSSQL\Reporting Services\ReportServer\bin\DB2Link.dll"
> />
> </CodeGroup>
> I have also added the following code to my Class Library prior to
compiling
> and deploying:
> Dim Permission As New
> Odbc.OdbcPermission(Security.Permissions.PermissionState.Unrestricted)
> Permission.Assert()
> but to no avail. Any help would be greatly appreciated. BTW, the ODBC
> connection information is all housed within the library. It takes a
string
> value passed from SRS and returns a single string value. Nothing fancy...
> Do I need to create an access group to the DSN File?
> Thanks,|||Thanks, I will look at it, I left the code on another computer and won't be
able to try it until tomorrow, will let you know.
"JamesH" wrote:
> Have a small problem. I have written a custom assembly to query a db2
> database through a dsn datasource. It works fine in Report Designer but
> shows the #error message in the fields on the report once it is published.
> Following is my rssrvpolicy.config entry:
> <CodeGroup
> class="UnionCodeGroup"
> version="1.0.0.0"
> PermissionSetName="FullTrust"
> Name="DB2Link"
> Description="This assembly connects to the DB2 database server and
> retrieves information">
> <IMembershipCondition
> class="UrlMembershipCondition"
> version="1.0.0.0"
> Url="C:\Program Files\Microsoft SQL
> Server\MSSQL\Reporting Services\ReportServer\bin\DB2Link.dll"
> />
> </CodeGroup>
> I have also added the following code to my Class Library prior to compiling
> and deploying:
> Dim Permission As New
> Odbc.OdbcPermission(Security.Permissions.PermissionState.Unrestricted)
> Permission.Assert()
> but to no avail. Any help would be greatly appreciated. BTW, the ODBC
> connection information is all housed within the library. It takes a string
> value passed from SRS and returns a single string value. Nothing fancy...
> Do I need to create an access group to the DSN File?
> Thanks,|||Robert, I've tried about everything I can think of: I even tried a sample
that has worked for others using an assembly to read a text file but to no
avail. Sorry for all of the code below but I'm at a loss. I've also set the
version to be 1.0.0.0.0 in my assembly and added the : <Assembly:
AllowPartiallyTrustedCallers()> although I haven't setup strong naming. If
you see anything that I've messed up, please let me know...I'm stumped.
This is my Class Code:
Imports System.IO
Imports System.Security.Permissions
Public Class ReadResultsFile
<FileIOPermissionAttribute(SecurityAction.Assert,
Read:="C:\JHHTST2.txt")> _
Public Shared Function GetResults() As String
Dim reader As StreamReader = New StreamReader("c:\JHHTST2.txt")
Dim hello As String = reader.ReadToEnd()
reader.Close()
Return hello
End Function
End Class
This as the PermissionSet Code:
<PermissionSet
class="NamedPermissionSet"
version="1"
Name="ReadObjectFilePermissionSet"
Description="A special permission set that grants read access to my hello
file.">
<IPermission
class="FileIOPermission"
version="1"
Read="C:\JHHTST2.txt"
/>
<IPermission
class="SecurityPermission"
version="1"
Flags="Execution, Assertion"
/>
</PermissionSet>
This is my Codegroup:
<CodeGroup
class="UnionCodeGroup"
version="1"
PermissionSetName="ReadObjectFilePermissionSet"
Name="ReadScriptFile"
Description="A special code group for my custom assembly.">
<IMembershipCondition
class="UrlMembershipCondition"
version="1"
Url="C:\Program Files\Microsoft SQL Server\MSSQL\Reporting
Services\ReportServer\bin\ReadScriptFile.dll"
/>
</CodeGroup>
Thanks,
JamesH.|||Make sure the the CodeGroup section you added is right below the
Report_Expressions_Default_Permissions CodeGroup. Position in the file
does have an effect.
--
Thanks.
Donovan R. Smith
Software Test Lead
This posting is provided "AS IS" with no warranties, and confers no rights.|||I added it in there, no change.
JamesH.
"Donovan R. Smith [MS]" wrote:
> Make sure the the CodeGroup section you added is right below the
> Report_Expressions_Default_Permissions CodeGroup. Position in the file
> does have an effect.
> --
> Thanks.
> Donovan R. Smith
> Software Test Lead
> This posting is provided "AS IS" with no warranties, and confers no rights.
>|||Never Mind, got it working today by adding a linked server to SQL and then
using the SQLClient connection in the assembly, worked like a champ... Is
there anybody that has used ODBC with Custom assemblies?
JamesH.
"JamesH" wrote:
> This weekend I rebuilt everything at least 10 times and then built a virtual
> pc image and reloaded everything to no avail. I've added Strong_name to the
> .dlls and still no luck. I'm not seeing any errors in the logs at all, just
> the #error message on my report screen. I've tried deleting the reports,
> re-adding the custom assembly each time and then re-deploying along with
> re-copying the .dll. I even tried to get it to work with another .dll that
> still doesn't work. Any help now would be greatly appreciated on just
> getting a single custom assembly working. Are there any walk-throughs
> (cradle to grave) at all by MS?
> THanks,
> "JamesH" wrote:
> > I added it in there, no change.
> >
> > JamesH.
> >
> > "Donovan R. Smith [MS]" wrote:
> >
> > > Make sure the the CodeGroup section you added is right below the
> > > Report_Expressions_Default_Permissions CodeGroup. Position in the file
> > > does have an effect.
> > >
> > > --
> > > Thanks.
> > >
> > > Donovan R. Smith
> > > Software Test Lead
> > >
> > > This posting is provided "AS IS" with no warranties, and confers no rights.
> > >sql

DB2 Connect and SSIS | Error in OLE DB Source Task

Hi All,

I am trying to connect to DB2 database via OLE DB connection manager in SSIS. But when I enter the SQL Query and press OK it gives following error

"Error at Data Flow Task - Header Load [OlE DB Source - Header_Load[1]]": An OLE DB Error has occured. Error Code: 0x80040E21

Additional Information:

Exception from HRESULT: 0xC0202009(Microsoft.SqlServer.DTSPipelineWrap)"

I followed following steps: -

1. I created OLE DB provider and tested the connection, it was successful(with give username and password)

2. Created query in Build query as following and tried executing it. It worked! Query used was

SELECT SRC_ID, ORG_ID FROM DB123.DEAL_HEADER

3. But when, in OLE DB Source Provider Task, when I press preview, It thorws the above error!

Kindly let me know, Because I am stuck at that point.

Thanks

Sid

What happens if you don't preview the results? Just run the package normally after building the query.|||In that case; when I press "OK" in OLE DB Source Task, the same Error appears. In short, I am not able to save the task and move futher with my implementation.|||What driver are you using to connect to DB2? IBM's DB2Connect?|||Yes I am using IBM's DB2 Connect|||

sidzone123 wrote:

Yes I am using IBM's DB2 Connect

Well, if you are on SQL Server Developer or Enterprise edition, you can download the Microsoft OLE DB for DB2 driver. That works really well for me.

Never-the-less, you can try some of the techniques in here to see if they'll help your situation, even though it doesn't deal with DB2 directly:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=142282&SiteID=1|||

Hi Phil,

I am using SQL Server Standard Edition.

However, I tried all methods suggested by the link suggested by you.

But unfortunately nothing work!

Thanks

Sid

|||

Hi,

I found the workaround for this!

1) In OLE DB Source, Open the Advance Editor and in the Custom property, set the Access Mode to "OpenRowset"

2) In the OpenRowset property, write the table that you want to access i.e. say "CZ123"."DEAL_HEADER"

Thats it and press OK!

To my surpise it worked great. I was able to connect to DB2 and transfer the data.

However I am not sure about why I was getting the errors that I mentioned earlier and why the above solution worked. Still trying to find the aswer to this.

Hope the same works for all.

Thanks

Sid

Friday, February 24, 2012

db maintenance issues with connection pooling

Hi,
Is there a way to do maintenance like integrity checks if there is still
a (sleeping)connection to a database? My maintenance jobs where you need
to be in single user mode fails. In our multi-tier environment we use an
applicationserver which uses connection pooling and a databaseserver
(SQL2K).
I've looked at dbcc opentran, but that doesn't work for me. The solution
i'm looking for is to check if there are any connections for a
particular database. If so, i want to disconnect it, but leave it in a
state so that the applicationserver doesn't have to restart it's
services (this is a manual proces).You could
SELECT cntr_value AS UsersConnected FROM master..sysperfinfo as p
WHERE p.object_name = 'SQLServer:General Statistics' And p.counter_name =
'User Connections'
this though will not give you the db upon which they are connected.
If you use -- sp_who 'active' this will give a more detailed breakdown of
active users and the db they are connected
Jack Vamvas
___________________________________
Receive free SQL tips - www.ciquery.com/sqlserver.htm
___________________________________
"Jason" <jasonlewis@.hotmail.com> wrote in message
news:exafy5ujGHA.2200@.TK2MSFTNGP05.phx.gbl...
> Hi,
> Is there a way to do maintenance like integrity checks if there is still
> a (sleeping)connection to a database? My maintenance jobs where you need
> to be in single user mode fails. In our multi-tier environment we use an
> applicationserver which uses connection pooling and a databaseserver
> (SQL2K).
> I've looked at dbcc opentran, but that doesn't work for me. The solution
> i'm looking for is to check if there are any connections for a
> particular database. If so, i want to disconnect it, but leave it in a
> state so that the applicationserver doesn't have to restart it's
> services (this is a manual proces).

Friday, February 17, 2012

DB is ReadOnly?

Hi all,
I am using DAO 3.6 to connect to a SQL Server db on a remote machine.
I can open and close the connection, read records, run stored procedures
but when I try to add a record I get "object or database is read only"
If I connect to the database using ADO I can add records.
Here is my code:
' ----
Dim wrk_DAO As DAO.Workspace
Dim cnn_DAO As DAO.Connection
Dim rec_DAO as DAO.Recordset
Set wrk_DAO = CreateWorkspace("MyWorkspace", "sa", "pw", dbUseODBC)
Set cnn_DAO = wrk_DAO.OpenConnection("MyConnection", dbDriverNoPrompt,
False, _
"ODBC;DATABASE=SQLTest;UID=sa;PWD=pw;DSN=odbc_test ")
Set rec_DAO = cnn_DAO.OpenRecordset(strSQL, dbOpenDynamic)
rec_DAO.AddNew '<<< ERROR occurs here
rec_DAO!Field1 = 1
rec_DAO!Field2 = "Test"
rec_DAO.Update
rec_DAO.Close
cnn_DAO.Close
' ----
If I use the same code but only read, it works fine.
What am I doing wrong?
Thanks.
kpg
"kpg" <ipost@.thereforeiam.com> wrote in message
news:%23Oremk8pEHA.2588@.TK2MSFTNGP12.phx.gbl...
> I am using DAO 3.6 to connect to a SQL Server db on a remote machine.
> I can open and close the connection, read records, run stored procedures
> but when I try to add a record I get "object or database is read only"
> If I connect to the database using ADO I can add records.
> Here is my code:
> ' ----
> Dim wrk_DAO As DAO.Workspace
> Dim cnn_DAO As DAO.Connection
> Dim rec_DAO as DAO.Recordset
> Set wrk_DAO = CreateWorkspace("MyWorkspace", "sa", "pw", dbUseODBC)
> Set cnn_DAO = wrk_DAO.OpenConnection("MyConnection", dbDriverNoPrompt,
> False, _
> "ODBC;DATABASE=SQLTest;UID=sa;PWD=pw;DSN=odbc_test ")
> Set rec_DAO = cnn_DAO.OpenRecordset(strSQL, dbOpenDynamic)
> rec_DAO.AddNew '<<< ERROR occurs here
> rec_DAO!Field1 = 1
> rec_DAO!Field2 = "Test"
> rec_DAO.Update
> rec_DAO.Close
> cnn_DAO.Close
> ' ----
> If I use the same code but only read, it works fine.
> What am I doing wrong?
It may not be anything you are doing "wrong", other than using a possibly
incompatible, old library to access SQL Server. DAO was written an intended
to be a library for Jet. The fact that your code works in ADO speaks to the
proper library to use...
Steve
|||"Steve Thompson" wrote
> It may not be anything you are doing "wrong", other than using a possibly
> incompatible, old library to access SQL Server.
<snip>
Yes, thanks for the reply. I solved my little problem however...
If I set the locking type to 'dbOptimisticValue' it works fine:
Re:
'--
Set rec_DAO = cnn_DAO.OpenRecordset(strSQL, dbOpenDynamic, _
dbExecDirect, dbOptimisticValue)
'--
I guess the default was a snapshot?
BTW: I would never really consider using DAO for a SQL Server DB,
I was mainly interested in benchmarking the difference between Access, SQL
Server, ADO and DAO, for use in a management proposal.
I use a SQL Server and an Access db located on the same machine on my LAN.
This way the netword has to be involved in all IO.
My test is not very rigid from a scientific standpoint and the results are
not very
suprising, but here the are:
Add 1000
Add x100
Read
SP
Delete
Total
ADO ACCESS
0.07
1.66
0.03
0.03
0.02
1.81
DAO ACCESS
0.06
1.2
0.03
0.02
0.01
1.32
ADO SQL
1.54
1.63
0.03
0.03
0.02
3.25
DAO SQL
0.66
2.67
0.05
0.04
0.03
3.45
times are in seconds.
Add 1000: adds 1000 small records by opening the db once, looping, then
closing.
Add x100: adds the same recodes bu7t opens and closes the db for each record
(100 times)
Read: reads the 1100 records by opening once, reading in a while loop,
closing.
SP: run a stored procedure instead of a SELECT Query, otherwise the same as
Read
Delete: execute a DELETE FORM Table command.
kpg
In theory, there is no difference between theory and practice.
But, in practice, there is - Jan L.A. van de Snepscheut
|||I'm glad you found that -- the default is snapshot from what I remember (and
that is digging back a while).
BTW, speed is only one factor, I would be more concerned about stability,
portability and support of your code. While DAO is fast (and it has always
been known for speed), DAO is not the way to go for a strategic software
development with SQL Server. You can achieve higher performance in SQL
Server by taking advantage of VIEWS and Stored Procedures (for data
manipulation).
Steve
"kpg" <ipost@.thereforeiam.com> wrote in message
news:upbmBF$pEHA.596@.TK2MSFTNGP11.phx.gbl...[vbcol=seagreen]
> "Steve Thompson" wrote
possibly
> <snip>
> Yes, thanks for the reply. I solved my little problem however...
> If I set the locking type to 'dbOptimisticValue' it works fine:
> Re:
> '--
> Set rec_DAO = cnn_DAO.OpenRecordset(strSQL, dbOpenDynamic, _
> dbExecDirect, dbOptimisticValue)
> '--
> I guess the default was a snapshot?
> BTW: I would never really consider using DAO for a SQL Server DB,
> I was mainly interested in benchmarking the difference between Access, SQL
> Server, ADO and DAO, for use in a management proposal.
> I use a SQL Server and an Access db located on the same machine on my LAN.
> This way the netword has to be involved in all IO.
> My test is not very rigid from a scientific standpoint and the results are
> not very
> suprising, but here the are:
>
> Add 1000
> Add x100
> Read
> SP
> Delete
> Total
> ADO ACCESS
> 0.07
> 1.66
> 0.03
> 0.03
> 0.02
> 1.81
> DAO ACCESS
> 0.06
> 1.2
> 0.03
> 0.02
> 0.01
> 1.32
> ADO SQL
> 1.54
> 1.63
> 0.03
> 0.03
> 0.02
> 3.25
> DAO SQL
> 0.66
> 2.67
> 0.05
> 0.04
> 0.03
> 3.45
>
> times are in seconds.
> Add 1000: adds 1000 small records by opening the db once, looping, then
> closing.
> Add x100: adds the same recodes bu7t opens and closes the db for each
record
> (100 times)
> Read: reads the 1100 records by opening once, reading in a while loop,
> closing.
> SP: run a stored procedure instead of a SELECT Query, otherwise the same
as
> Read
> Delete: execute a DELETE FORM Table command.
> --
> kpg
> In theory, there is no difference between theory and practice.
> But, in practice, there is - Jan L.A. van de Snepscheut
>
>