Friday, March 30, 2012
Odbc error
My one user has installed sql server 2000 enterprise edition , SP3
(8.00.0860) on my computer.
I have created one odbc connection to sql server.
When he want to connect to sql user via odbc in application he gets
following error
Statement(s) could not be prepared
Unable to close cursor
[Microsoft][ODBC SQL Server Driver]Invalid cursor stat
What can be the problem?
RegardsWhat language is the application written in? At least the failing module?
I have seen similar errors in both T/SQL (implying a Stored Procedure) and C
(api level calls) modules.
I suspect it needs to be relinked with your new modules. To me, it sounds
like the api calls either are for a different ODBC release or have messed up
pointers.
If you can supply error numbers and complete error messages, it woulld help
--
Joseph R.P. Maloney, CSP,CCP,CDP
"amish" wrote:
> Dear all
> My one user has installed sql server 2000 enterprise edition , SP3
> (8.00.0860) on my computer.
> I have created one odbc connection to sql server.
> When he want to connect to sql user via odbc in application he gets
> following error
> Statement(s) could not be prepared
> Unable to close cursor
> [Microsoft][ODBC SQL Server Driver]Invalid cursor stat
> What can be the problem?
> Regards
>
ODBC error
I've a Third-Party application using a ODBC connection on a remote Acces fil
e (mdb file) (the file reside on a other server, so I map a drive).
I got this error
[[Microsoft][ODBC Microsoft Access Driver] '(unknown)' is not a
valid path. Make sure that the path name is spelled correctly and that you a
re connected to the server on which the file resides.-1023]
Does someone have hints?
ThanksI'm not real clear on what is using what and where but in
general, you want to avoid mapped drives. Try using a UNC
path instead of a mapped drive.
-Sue
On Tue, 20 Apr 2004 07:51:05 -0700, RemCgi
<anonymous@.discussions.microsoft.com> wrote:
>Hi,
>I've a Third-Party application using a ODBC connection on a remote Acces fi
le (mdb file) (the file reside on a other server, so I map a drive).
>I got this error
>[[Microsoft][ODBC Microsoft Access Driver] '(unknown)' is not a
valid path. Make sure that the path name is spelled correctly and that you
are connected to the server on which the file resides.-1023]
>Does someone have hints?
>Thanks
Monday, March 26, 2012
ODBC database slows down over time
I currently have an ODBC connection to a SQL server that exists on the other side of the country from me. I'm running queries in Access and I've found that over time, queries run slower and slower. If I create a new database and bring in the same tables, it runs quickly (relatively speaking) again. Why is this happening? Is there something I can do besides creating new databases all the time?
Thank you in advance.Is the problem that over time the query has more and more records to move through? Is the DB normalized?
ODBC Data Source Administrator
I have created a system DSN in the usual way using the above ODBC tool
(I am trying to create a connection to our Open Accounts package using
the OpenEdge 10.1A driver). I provide the host name, the port number
and the database name, the user ID and password and test the
connection. All works a treat...'Connection established'.
I open up Excel and try to import data using my newly created DSN...it
exposes all of the tables within the database and lets me select
fields from those table. When I get to the 'return data to Microsoft
Excel' part I get the following error message 'Access denied
(Authorisation failed) (7512)'.
Any ideas guys?
Regards
PaulHi Paul,
What database is the Open Accounts package using to store it's data, SQL
Server, Access, Oracle etc. We need to know this because we need to
troubleshoot the security settings/accounts etc. of the database
containing the Open Accounts data.
Jonathan
thePriest wrote:
> Hi all, hope you can help?
> I have created a system DSN in the usual way using the above ODBC tool
> (I am trying to create a connection to our Open Accounts package using
> the OpenEdge 10.1A driver). I provide the host name, the port number
> and the database name, the user ID and password and test the
> connection. All works a treat...'Connection established'.
> I open up Excel and try to import data using my newly created DSN...it
> exposes all of the tables within the database and lets me select
> fields from those table. When I get to the 'return data to Microsoft
> Excel' part I get the following error message 'Access denied
> (Authorisation failed) (7512)'.
> Any ideas guys?
> Regards
> Paul
>
ODBC data source
I am trying to use the ADO.NET bridge to connect to an old database on RISC6000 via an ODBC connection, but I receive an error.
So, I would use a script component to retrieve data directly from an ODBC connection, using a stored procedure.
Any sample code ?
Any idea ?
Thanks
You can use the DataReader source in the data flow as another option connecting to an ODBC source.ODBC Data Source
Using SSIS, I create an ODBC data connection to our transactional system,
from which we build our data warehouse. In the data flow, when I go to add
the data source, I find nothing that will reference the ODBC data connection
.
Suggestions?
StevenRight click on the data flow source and select edit. From
here you can enter the Connection Manager that you added.
What are you using as the Data Flow Source?
-Sue
On Tue, 23 May 2006 08:01:03 -0700, Steven
<Steven@.discussions.microsoft.com> wrote:
>I hope that I am being a real dunce about this.
>Using SSIS, I create an ODBC data connection to our transactional system,
>from which we build our data warehouse. In the data flow, when I go to add
>the data source, I find nothing that will reference the ODBC data connectio
n.
>Suggestions?
>Steven|||Sue,
Thanks for your response. Here is what I found after some digging. You use
a .Net Providers/ODBC data providers connection. You create it and then
configure it to use a system dsn. Within the dataflow, you access the
connection with a data reader source. You point it to the connection that
you configured. You control what is pulled by using the SQLCommand on the
component properties tab.
Simple enough once you know what to do.
-Steven
"Sue Hoegemeier" wrote:
> Right click on the data flow source and select edit. From
> here you can enter the Connection Manager that you added.
> What are you using as the Data Flow Source?
> -Sue
> On Tue, 23 May 2006 08:01:03 -0700, Steven
> <Steven@.discussions.microsoft.com> wrote:
>
>
ODBC data flow source
All I want to do is simply copy data from an ODBC data source into a SQL Server table.
ThanksDataReaderSrc is the one you'll need to pull out data from a ODBC connection, point it to the ADO.Net:ODBC connection you created and set up the SqlCommand properly, then hook it up with a OLEDBDest adapter or a SQLServerDest.|||
Can Data Reader Source be customized(for examplae, use parameters)?
|||The SqlCommand in DataReaderSrc is expressionable - which means, you can set SqlCommand to sth like "select * from HumanResources.Employee where EmployeeID="+(DT_WSTR,1)@.myVar1. For setting expressionable properties for dataflow components, pls reference BOL, basically you need to set it at dataflow task's "expressions" property.Thanks
Wenyang
ODBC data flow source
All I want to do is simply copy data from an ODBC data source into a SQL Server table.
ThanksDataReaderSrc is the one you'll need to pull out data from a ODBC connection, point it to the ADO.Net:ODBC connection you created and set up the SqlCommand properly, then hook it up with a OLEDBDest adapter or a SQLServerDest.|||
Can Data Reader Source be customized(for examplae, use parameters)?
|||The SqlCommand in DataReaderSrc is expressionable - which means, you can set SqlCommand to sth like "select * from HumanResources.Employee where EmployeeID="+(DT_WSTR,1)@.myVar1. For setting expressionable properties for dataflow components, pls reference BOL, basically you need to set it at dataflow task's "expressions" property.Thanks
Wenyangsql
ODBC Creation from commandline
have created the ODBC connection, exported the registry key, and have
tried doing regedit /s "regkey", problem is after I do that it never
shows us in the ODBC manager, it shows up in the registry under
ODBC.INI\Source, but I dont see it in the manager, any ideas?
"Duane Haas" <techsupport@.suduhaas.com> wrote in message
news:uUTjiBQcFHA.2212@.TK2MSFTNGP14.phx.gbl...
>I am trying to get an ODBC connection created from a commandline, I
> have created the ODBC connection, exported the registry key, and have
> tried doing regedit /s "regkey", problem is after I do that it never
> shows us in the ODBC manager, it shows up in the registry under
> ODBC.INI\Source, but I dont see it in the manager, any ideas?
Are you adding a value to the ODBC Data Sources key as well as the database
connection key values?
David Rowland
DBMonitor version 1.2 out now! http://dbmonitor.tripod.com
Email Alerts, logging, performance stats, process information!
Only $49.95
|||dbmonitor wrote:
> "Duane Haas" <techsupport@.suduhaas.com> wrote in message
> news:uUTjiBQcFHA.2212@.TK2MSFTNGP14.phx.gbl...
> Are you adding a value to the ODBC Data Sources key as well as the
> database connection key values?
Yes, it creates the key, and all the values. I just export it from
another machine that already has the connection.
|||"Duane Haas" <techsupport@.suduhaas.com> wrote in message
news:uUMF6ZndFHA.1456@.TK2MSFTNGP15.phx.gbl...
> dbmonitor wrote:
>
> Yes, it creates the key, and all the values. I just export it from
> another machine that already has the connection.
Are you able to post the reg settings you are adding?
David Rowland
DBMonitor version 1.2 out now! http://dbmonitor.tripod.com
Email Alerts, logging, performance stats, process information!
Only $49.95
ODBC Creation from commandline
have created the ODBC connection, exported the registry key, and have
tried doing regedit /s "regkey", problem is after I do that it never
shows us in the ODBC manager, it shows up in the registry under
ODBC.INI\Source, but I dont see it in the manager, any ideas?"Duane Haas" <techsupport@.suduhaas.com> wrote in message
news:uUTjiBQcFHA.2212@.TK2MSFTNGP14.phx.gbl...
>I am trying to get an ODBC connection created from a commandline, I
> have created the ODBC connection, exported the registry key, and have
> tried doing regedit /s "regkey", problem is after I do that it never
> shows us in the ODBC manager, it shows up in the registry under
> ODBC.INI\Source, but I dont see it in the manager, any ideas?
Are you adding a value to the ODBC Data Sources key as well as the database
connection key values?
--
David Rowland
DBMonitor version 1.2 out now! http://dbmonitor.tripod.com
Email Alerts, logging, performance stats, process information!
Only $49.95|||dbmonitor wrote:
> "Duane Haas" <techsupport@.suduhaas.com> wrote in message
> news:uUTjiBQcFHA.2212@.TK2MSFTNGP14.phx.gbl...
> Are you adding a value to the ODBC Data Sources key as well as the
> database connection key values?
Yes, it creates the key, and all the values. I just export it from
another machine that already has the connection.|||"Duane Haas" <techsupport@.suduhaas.com> wrote in message
news:uUMF6ZndFHA.1456@.TK2MSFTNGP15.phx.gbl...
> dbmonitor wrote:
>
> Yes, it creates the key, and all the values. I just export it from
> another machine that already has the connection.
Are you able to post the reg settings you are adding?
David Rowland
DBMonitor version 1.2 out now! http://dbmonitor.tripod.com
Email Alerts, logging, performance stats, process information!
Only $49.95
ODBC Connectivity problem in Sql Server2005
Hi,
I have created DSN connection with sql server authentication in Sql server 2005. There is message comes "Connection Succeeded".
After I try through my application again asking username and password for the DSN at run time. My application is developed in Powerbuilder 5.0.
The connection string as follows,
SQLCA.dbms= "ODBC"
SQLCA.dBparm = "CONNECTSTRING='DSN=ntm',APPNAME = 'ntm',uid='sa',pwd='sierra'"
Can you help me?
I'm not really sure what Powerbuilder syntax is, but did you try something like:SQLCA.dBparm ="CONNECTSTRING='DSN=ntm;uid=sa;pwd=sierra'"|||
Thanks for your kind reply..
We have rectified that problem.
sqlODBC Connectivity problem in Sql Server2005
Hi,
I have created DSN connection with sql server authentication in Sql server 2005. There is message comes "Connection Succeeded".
After I try through my application again asking username and password for the DSN at run time. My application is developed in Powerbuilder 5.0.
The connection string as follows,
SQLCA.dbms= "ODBC"
SQLCA.dBparm = "CONNECTSTRING='DSN=ntm',APPNAME = 'ntm',uid='sa',pwd='sierra'"
Can you help me?
I'm not really sure what Powerbuilder syntax is, but did you try something like:
SQLCA.dBparm ="CONNECTSTRING='DSN=ntm;uid=sa;pwd=sierra'"|||
Thanks for your kind reply..
We have rectified that problem.
ODBC connections error
How do I disable in sql server -- ansi quote identifiers in sql server.
ansi nulls, padding, warnings.
I set up an ODBC connection If I turn these off -- doesn't work , It works
it tehy are checked.
Any ideas?
Thanks
Set up what kind of ODBC connection - where did you set this
up? If it's a DSN, you can turn them on in the ODBC
Administrator applet. When you configure the DSN, it's on
the screen after you select the authentication method.
It's generally better to manage the settings you need from
the client side. A client connection settings for these
override the server settings.
If you wanted to change them at the server level, you can
use sp_configure to change the user options. If you change
the settings at the server level, it will only take affect
for new logins.
-Sue
On Mon, 2 Apr 2007 17:33:53 -0400, "mecn"
<mecn2002@.yahoo.com> wrote:
>Hi,
>How do I disable in sql server -- ansi quote identifiers in sql server.
> ansi nulls, padding, warnings.
>I set up an ODBC connection If I turn these off -- doesn't work , It works
>it tehy are checked.
>Any ideas?
>Thanks
>
ODBC connections error
How do I disable in sql server -- ansi quote identifiers in sql server.
ansi nulls, padding, warnings.
I set up an ODBC connection If I turn these off -- doesn't work , It works
it tehy are checked.
Any ideas?
ThanksSet up what kind of ODBC connection - where did you set this
up? If it's a DSN, you can turn them on in the ODBC
Administrator applet. When you configure the DSN, it's on
the screen after you select the authentication method.
It's generally better to manage the settings you need from
the client side. A client connection settings for these
override the server settings.
If you wanted to change them at the server level, you can
use sp_configure to change the user options. If you change
the settings at the server level, it will only take affect
for new logins.
-Sue
On Mon, 2 Apr 2007 17:33:53 -0400, "mecn"
<mecn2002@.yahoo.com> wrote:
>Hi,
>How do I disable in sql server -- ansi quote identifiers in sql server.
> ansi nulls, padding, warnings.
>I set up an ODBC connection If I turn these off -- doesn't work , It works
>it tehy are checked.
>Any ideas?
>Thanks
>
ODBC connections and SSIS
so im trying to connect to an odbc source and use ado.net to pass some sql queries and then write back into this odbc connection. i am aware that ssis does not have direct capabilities to do this, but i wanted to see if anyone knew of generic help docs/url's that show how to do this? i am new to ssis, and am just trying to get general information.
See Douglas post here:http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=70469&SiteID=1
The code is also in SQL Books Online.|||
to be honest with you, i did see that thread you mention above, probably the only thread with realistic information. I am looking for something specifically in C#.
I am also wondering if there is any way to not have the SQL Command line filled for the ODBC connection source and use ODBC and a combination of ADO.net? Anyone have success with this?
I did search books online for the particualar phrase mentioned in the above thread..not too helpful.
Just wondering if anyone has had success writing C# ado.net to read and write using ODBC as a source?
thanks!
|||If that's what you are after then I would try a dev forum if I were you: http://forums.microsoft.com/MSDN/default.aspx?ForumGroupID=12&SiteID=1
-Jamie
sqlODBC Connection.
about 30 mins, a connection time out occurs and the error
message displayed is as foolows:
Connection failed:
SQLState: 'S1000'
SQL Server Error: 0
SQL Server Error: 0
[Microsoft][ODBC SQL Server Driver]Cannot generate SSPI
context
I'm currently using Microsoft Windows Server 2003 for
Small Business Servers as my back-end server while my
client is using Microsoft Office Access 2003.
This problem does not occur in certain computers,
regardless of the authenticated users.
Normally what i would do when this problem occurs, will
be to log off and re login to windows. However this is
quite time consuming and i was wondering if there is any
way that this problem can be solved.
If you have not seen this troubleshooting page, you'll want to give this a
read:
How to troubleshoot the "Cannot generate SSPI context" error message
http://support.microsoft.com/default...&Product=sql2k
Steve
"Nexus Quest" <anonymous@.discussions.microsoft.com> wrote in message
news:2066301c459c0$68371610$a601280a@.phx.gbl...
> There is a problem with my ODBC connection. Usually after
> about 30 mins, a connection time out occurs and the error
> message displayed is as foolows:
> Connection failed:
> SQLState: 'S1000'
> SQL Server Error: 0
> SQL Server Error: 0
> [Microsoft][ODBC SQL Server Driver]Cannot generate SSPI
> context
> I'm currently using Microsoft Windows Server 2003 for
> Small Business Servers as my back-end server while my
> client is using Microsoft Office Access 2003.
> This problem does not occur in certain computers,
> regardless of the authenticated users.
> Normally what i would do when this problem occurs, will
> be to log off and re login to windows. However this is
> quite time consuming and i was wondering if there is any
> way that this problem can be solved.
|||I am having the same problem with ODBC timing out after 30 minutes. Did you find a way to correct the problem?
Posted using Wimdows.net NntpNews Component -
Post Made from http://www.SqlJunkies.com/newsgroups Our newsgroup engine supports Post Alerts, Ratings, and Searching.
ODBC Connection.
about 30 mins, a connection time out occurs and the error
message displayed is as foolows:
Connection failed:
SQLState: 'S1000'
SQL Server Error: 0
SQL Server Error: 0
[Microsoft][ODBC SQL Server Driver]Cannot generate SSPI
context
I'm currently using Microsoft Windows Server 2003 for
Small Business Servers as my back-end server while my
client is using Microsoft Office Access 2003.
This problem does not occur in certain computers,
regardless of the authenticated users.
Normally what i would do when this problem occurs, will
be to log off and re login to windows. However this is
quite time consuming and i was wondering if there is any
way that this problem can be solved.If you have not seen this troubleshooting page, you'll want to give this a
read:
How to troubleshoot the "Cannot generate SSPI context" error message
http://support.microsoft.com/defaul...9&Product=sql2k
Steve
"Nexus Quest" <anonymous@.discussions.microsoft.com> wrote in message
news:2066301c459c0$68371610$a601280a@.phx
.gbl...
> There is a problem with my ODBC connection. Usually after
> about 30 mins, a connection time out occurs and the error
> message displayed is as foolows:
> Connection failed:
> SQLState: 'S1000'
> SQL Server Error: 0
> SQL Server Error: 0
> [Microsoft][ODBC SQL Server Driver]Cannot generate SSPI
> context
> I'm currently using Microsoft Windows Server 2003 for
> Small Business Servers as my back-end server while my
> client is using Microsoft Office Access 2003.
> This problem does not occur in certain computers,
> regardless of the authenticated users.
> Normally what i would do when this problem occurs, will
> be to log off and re login to windows. However this is
> quite time consuming and i was wondering if there is any
> way that this problem can be solved.|||I am having the same problem with ODBC timing out after 30 minutes. Did you
find a way to correct the problem?
Posted using Wimdows.net NntpNews Component -
Post Made from http://www.SqlJunkies.com/newsgroups Our newsgroup engine sup
ports Post Alerts, Ratings, and Searching.sql
ODBC connection.
Server. But when I want to choose a Integration Service Destination
connection I am not given any ODBC connection type.
I would like to transfer and transform data from a SQL Server database to a
seperate database to which I already can create a connection.
Any help would be appreciated.
Regards,
Sami
[Remove Numbers from e-mail address to use it]Do you mean from the Connection Manager in Integration
Services? Not sure what steps you are following but Right
click on Connection Manage area. Select New
Connection...Then select ODBC type connection from the
list.in the window and select add. That will bring up the
ODBC Connection Manager.
-Sue
On Tue, 23 May 2006 13:39:09 +0200, "Sami"
<s8a2m9i1_i5s1l9a6m@.hotmail.com> wrote:
>Hello I can create a ODBC connection to another database which is not SQL
>Server. But when I want to choose a Integration Service Destination
>connection I am not given any ODBC connection type.
>I would like to transfer and transform data from a SQL Server database to a
>seperate database to which I already can create a connection.
>Any help would be appreciated.
ODBC connection with stored procedure on iSeries as data source
I have created a stored procedure on the iSeries that creates a cursor and opens it. I am trying to write my report to use the stored procedure. I cannot get the data source to work. How do I create my data source so that it uses the stored procedure? My SP has three parameters I am trying to pass from the report. The parms are created in the layout.
Thank you
Figured it out. Had to use this syntax: Call procname ('parm1', parm2, 'parm3')
|||I was looking for an answer to my stored procedure problem and I came across your question/answer...I was hoping you'd help me out...we are using ODBC and an iseries and since I'm very much of a newbie to VB and .net, I am using point and click when I can...can you tell me what I'm doing wrong? I have an asp.net master and content pages...the content pages have datagrids (Gridview1) and a SQLDataSource control...Any help is greatly appreciated!
Imports IBM.Data.DB2.iSeries
Partial Class SSNName
Inherits System.Web.UI.Page
Dim ssnpsn As String = "123456789"
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim conn As New iDB2Connection("DataSource=datasourcename")
Try
conn.Open()
Catch ex As Exception
End Try
Dim sqlSSN As String = "call libraryname.SP_QSSNNAME(@.ssn)"
Dim cmdSSN As New iDB2Command(sqlSSN, conn)
cmdSSN.Parameters.Add("@.ssn", iDB2DbType.iDB2Numeric, 9)
cmdSSN.Parameters("@.ssn").Value = ssnpsn
Dim dr As iDB2DataReader
dr = cmdSSN.ExecuteReader()
Gridview1.DataSource = dr
Gridview1.DataBind()
conn.Close()
End Sub
End Class
|||I have been using the iSeries for some time now and I find this approach the best.
1. Create a new class under App_code
2. Create a function with the follwing code:
Shared Function GetCatByCatID(ByVal CatID As Integer) As System.Data.DataSet
Dim connectionString As String = ConfigurationManager.ConnectionStrings("gsafleetcs").ConnectionString
Dim cnn As IBM.Data.DB2.iSeries.iDB2Connection = New IBM.Data.DB2.iSeries.iDB2Connection(connectionString)
Dim proc As String = "GetCatInfo"
Dim dbCmd As IBM.Data.DB2.iSeries.iDB2Command = New IBM.Data.DB2.iSeries.iDB2Command
dbCmd.CommandText = proc
dbCmd.CommandType = Data.CommandType.StoredProcedure
dbCmd.Connection = cnn
Dim dbParam_ID As System.Data.IDataParameter = New IBM.Data.DB2.iSeries.iDB2Parameter
dbParam_ID.ParameterName = "@.CatID"
dbParam_ID.Value = CatID
dbParam_ID.DbType = Data.DbType.Int32
dbParam_ID.Direction = Data.ParameterDirection.Input
dbCmd.Parameters.Add(dbParam_ID)
Dim dataAdapter As IBM.Data.DB2.iSeries.iDB2DataAdapter = New IBM.Data.DB2.iSeries.iDB2DataAdapter
Dim dataSet As System.Data.DataSet = New System.Data.DataSet
dataAdapter.SelectCommand = dbCmd
dataAdapter.Fill(dataSet)
dbCmd.Dispose()
cnn.Close()
Return dataSet
End Function
3. Then in your asp page where the grid view create a Object datasource, unclick the Show only data components to expose you class name, then click next and choose you approiate method and finally define your parameter(s).
These Rebooks helped a lot:
1. IBM Redbook Stored Procedures, Triggers, and User-Defined Functions on DB2 Universal Database for iSeries
2. Integrating DB2 Universal Database for iSeries with Microsoft ADO .NET
Good Luck
|||Are you using the Report Designer?
In my Dataset definition I've defined my Name, Data Source, Command Type as 'Stored Procedure' and in the Query String I put the name of the stored procedure. When I execute it responds with
TITLE: Microsoft Report Designer
An error occurred while executing the query.
Object reference not set to an instance of an object.
ADDITIONAL INFORMATION:
Object reference not set to an instance of an object. (System.Data)
BUTTONS:
OK
I know it finds the store procedure, becuase at first I had a typo and the error message stated it could not find it. When I fix the typo I recieved the above error message. Here is the stored procedure:
BEGIN
DECLARE C1 CURSOR FOR
SELECT PEMS . EMS1548 . EMSDCO , PEMS . EMS1548 . EMSDDE , PEMS . FUELDET . FUDEQT , PEMS . FUELDET . FUDTYP , PEMS . FUELDET . FUDFQ AS GALS , PEMS . FUELDET . FUDFD AS DOLS , PEMS . FUELDET . FUDDAT
FROM PEMS . EMS1548 , PEMS . EMS1547 , PEMS . FUELDET
WHERE PEMS . EMS1548 . EMSDCO = PEMS . EMS1547 . EMSDPT AND PEMS . EMS1547 . EMSIDC = PEMS . FUELDET . FUDIDX AND
( PEMS . FUELDET . FUDTYP IN ( 'UNL' , 'DSL' ) ) AND ( PEMS . FUELDET . FUDEQT IN ( '022406' , '016460' , '026352' , '017068' , '023207' , '021870' , '019334' , '022754' , '020608' , '019337' ) )
ORDER BY PEMS . EMS1548 . EMSDDE , PEMS . FUELDET . FUDEQT ;
OPEN C1 ;
END
Any ideas would be appreciated.
|||I found the solution:
I was missing "RESULT SET 1" before the LANGUAGE SQL and "SET RESULT SETS CURSOR C1;" after the OPEN C1; statement
ODBC connection with stored procedure on iSeries as data source
I have created a stored procedure on the iSeries that creates a cursor and opens it. I am trying to write my report to use the stored procedure. I cannot get the data source to work. How do I create my data source so that it uses the stored procedure? My SP has three parameters I am trying to pass from the report. The parms are created in the layout.
Thank you
Figured it out. Had to use this syntax: Call procname ('parm1', parm2, 'parm3')
|||I was looking for an answer to my stored procedure problem and I came across your question/answer...I was hoping you'd help me out...we are using ODBC and an iseries and since I'm very much of a newbie to VB and .net, I am using point and click when I can...can you tell me what I'm doing wrong? I have an asp.net master and content pages...the content pages have datagrids (Gridview1) and a SQLDataSource control...Any help is greatly appreciated!
Imports IBM.Data.DB2.iSeries
Partial Class SSNName
Inherits System.Web.UI.Page
Dim ssnpsn As String = "123456789"
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim conn As New iDB2Connection("DataSource=datasourcename")
Try
conn.Open()
Catch ex As Exception
End Try
Dim sqlSSN As String = "call libraryname.SP_QSSNNAME(@.ssn)"
Dim cmdSSN As New iDB2Command(sqlSSN, conn)
cmdSSN.Parameters.Add("@.ssn", iDB2DbType.iDB2Numeric, 9)
cmdSSN.Parameters("@.ssn").Value = ssnpsn
Dim dr As iDB2DataReader
dr = cmdSSN.ExecuteReader()
Gridview1.DataSource = dr
Gridview1.DataBind()
conn.Close()
End Sub
End Class
|||I have been using the iSeries for some time now and I find this approach the best.
1. Create a new class under App_code
2. Create a function with the follwing code:
Shared Function GetCatByCatID(ByVal CatID As Integer) As System.Data.DataSet
Dim connectionString As String = ConfigurationManager.ConnectionStrings("gsafleetcs").ConnectionString
Dim cnn As IBM.Data.DB2.iSeries.iDB2Connection = New IBM.Data.DB2.iSeries.iDB2Connection(connectionString)
Dim proc As String = "GetCatInfo"
Dim dbCmd As IBM.Data.DB2.iSeries.iDB2Command = New IBM.Data.DB2.iSeries.iDB2Command
dbCmd.CommandText = proc
dbCmd.CommandType = Data.CommandType.StoredProcedure
dbCmd.Connection = cnn
Dim dbParam_ID As System.Data.IDataParameter = New IBM.Data.DB2.iSeries.iDB2Parameter
dbParam_ID.ParameterName = "@.CatID"
dbParam_ID.Value = CatID
dbParam_ID.DbType = Data.DbType.Int32
dbParam_ID.Direction = Data.ParameterDirection.Input
dbCmd.Parameters.Add(dbParam_ID)
Dim dataAdapter As IBM.Data.DB2.iSeries.iDB2DataAdapter = New IBM.Data.DB2.iSeries.iDB2DataAdapter
Dim dataSet As System.Data.DataSet = New System.Data.DataSet
dataAdapter.SelectCommand = dbCmd
dataAdapter.Fill(dataSet)
dbCmd.Dispose()
cnn.Close()
Return dataSet
End Function
3. Then in your asp page where the grid view create a Object datasource, unclick the Show only data components to expose you class name, then click next and choose you approiate method and finally define your parameter(s).
These Rebooks helped a lot:
1. IBM Redbook Stored Procedures, Triggers, and User-Defined Functions on DB2 Universal Database for iSeries
2. Integrating DB2 Universal Database for iSeries with Microsoft ADO .NET
Good Luck
|||Are you using the Report Designer?
In my Dataset definition I've defined my Name, Data Source, Command Type as 'Stored Procedure' and in the Query String I put the name of the stored procedure. When I execute it responds with
TITLE: Microsoft Report Designer
An error occurred while executing the query.
Object reference not set to an instance of an object.
ADDITIONAL INFORMATION:
Object reference not set to an instance of an object. (System.Data)
BUTTONS:
OK
I know it finds the store procedure, becuase at first I had a typo and the error message stated it could not find it. When I fix the typo I recieved the above error message. Here is the stored procedure:
BEGIN
DECLARE C1 CURSOR FOR
SELECT PEMS . EMS1548 . EMSDCO , PEMS . EMS1548 . EMSDDE , PEMS . FUELDET . FUDEQT , PEMS . FUELDET . FUDTYP , PEMS . FUELDET . FUDFQ AS GALS , PEMS . FUELDET . FUDFD AS DOLS , PEMS . FUELDET . FUDDAT
FROM PEMS . EMS1548 , PEMS . EMS1547 , PEMS . FUELDET
WHERE PEMS . EMS1548 . EMSDCO = PEMS . EMS1547 . EMSDPT AND PEMS . EMS1547 . EMSIDC = PEMS . FUELDET . FUDIDX AND
( PEMS . FUELDET . FUDTYP IN ( 'UNL' , 'DSL' ) ) AND ( PEMS . FUELDET . FUDEQT IN ( '022406' , '016460' , '026352' , '017068' , '023207' , '021870' , '019334' , '022754' , '020608' , '019337' ) )
ORDER BY PEMS . EMS1548 . EMSDDE , PEMS . FUELDET . FUDEQT ;
OPEN C1 ;
END
Any ideas would be appreciated.
|||I found the solution:
I was missing "RESULT SET 1" before the LANGUAGE SQL and "SET RESULT SETS CURSOR C1;" after the OPEN C1; statement