CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Hybrid View

  1. #1
    Join Date
    Aug 2008
    Posts
    1

    "System.data.odbc.odbcexception ERROR [07002] [IBM][iSeries Access ODBC Driver]Wrong

    I got a weird error which iam struggling to fix for soo many days. I need u guys help. please help me. I got a web service in win 2003 server which access the database to do insert operation (dataadapter.update(dataset)). This webservice is called by 2 applications. one is client server application(winform poped up in browser at client side takes input file and processes to a dataset and calls webservice to insert into database using (dataadapter.update(dataset)). the second application(asp.net app) rests in same server calls webservice and does same operation inserting into database using same statement works fine). The problem arose when i migrated from .net 1.1 to .net 2.0 framework.

    The error message iam getting is:
    "System.data.odbc.odbcexception ERROR [07002] [IBM][iSeries Access ODBC Driver]Wrong number of parameters".

    Please help me. iam inserting it into db2 database(as400) . The server has v5r4 client access software. If u need further info please let me know.

    Note:
    I caught the dataset just before the insert operation and wrote it to a xml to check the condition of dataset(to verify any damage in network). It looks fine and i used same dataset to build insert statements to enter manually into database. So i believe there is some security or access provider issue.

  2. #2
    Join Date
    Dec 2007
    Location
    South Africa
    Posts
    263

    Re: "System.data.odbc.odbcexception ERROR [07002] [IBM][iSeries Access ODBC Driver]Wrong

    I seems that your command object has passed more parameters. Check your Command object if it has the same parameters as your Stored Procedure. Or you can just post your SP code and your App code and we can point where did things went wrong

    Hope it helps

  3. #3
    Join Date
    Oct 2012
    Posts
    1

    Lightbulb Re: "System.data.odbc.odbcexception ERROR [07002] [IBM][iSeries Access ODBC Driver]Wr

    I had the same problem.
    A DECIMAL(x,y) DB field may confuse the statement. For them you must specify precision and scale like this:
    Code:
    OdbcParameter par;            
    par = insert.Parameters.Add("?RPLATI", OdbcType.Decimal);
    par.Precision = 9;
    par.Scale     = 6;
    I noticed that sometimes the statement can work without specifying them, but only in the particular case when the value you set for the parameter has exactly precision 9 and scale 6; for instance 43.972503 is ok, 42.974730 is not, because of the trailing zero(!).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured