Results 1 to 4 of 4

Thread: OleDbCommand.Prepare method requires all variable length parameters to have an expl

  1. #1

    Thread Starter
    Fanatic Member vuyiswamb's Avatar
    Join Date
    Jan 2007
    Location
    South Africa
    Posts
    830

    OleDbCommand.Prepare method requires all variable length parameters to have an expl

    hi All,

    am creating an application to search the Grid, i master that in SQl db, no am using Access for this Application. i have an adapter , at the moment am using a Wizard. and i have this SQl statement that works fine when i run it in Query analyzer, but when i drop it in the Adapter it give the Following Error.

    OleDbCommand.Prepare method requires all variable length parameters to have an explicitly set non-zero Size.

    Here is an SQl statement in the adapter.
    Code:
    SELECT Actual_Extent, Boundary_Area, Compl_Boundary_Area, Current_Values, Extension, First_Prop_Address, Improved_Value, Improvements_Value, Lis_key, Num_key, Own_Name, Parcel_No, Parcel_Portion_No, Primary_ID, Prop_Address, Purchase_Date, Site_Value, Street_Name, Street_No, Title_Deed_No, Values_Effective FROM Property_ValRoll WHERE (Boundary_Area = ?) AND (SUBSTRING(Lis_key , 5 , 5) = ? )
    This code is working fine only when i remove the substring search like this
    Code:
    SELECT Actual_Extent, Boundary_Area, Compl_Boundary_Area, Current_Values, Extension, First_Prop_Address, Improved_Value, Improvements_Value, Lis_key, Num_key, Own_Name, Parcel_No, Parcel_Portion_No, Primary_ID, Prop_Address, Purchase_Date, Site_Value, Street_Name, Street_No, Title_Deed_No, Values_Effective FROM Property_ValRoll WHERE (Boundary_Area = ?) AND (Lis_key  = ? )
    but i need to Search within the String. how can i achieve that.

    thanks


    Vuyiswa Maseko,

    Sorrow is Better than Laughter, it may Sudden your Face, but It sharpens your Understanding

  2. #2
    Registered User nmadd's Avatar
    Join Date
    Jun 2007
    Location
    U.S.A.
    Posts
    1,676

    Re: OleDbCommand.Prepare method requires all variable length parameters to have an ex

    Does Access support SUBSTRING? I'm not sure if it does. You may want to try the MID function:
    http://www.techonthenet.com/access/f...string/mid.php

  3. #3

    Thread Starter
    Fanatic Member vuyiswamb's Avatar
    Join Date
    Jan 2007
    Location
    South Africa
    Posts
    830

    Re: OleDbCommand.Prepare method requires all variable length parameters to have an expl

    Thank you very much,its working.

  4. #4

    Thread Starter
    Fanatic Member vuyiswamb's Avatar
    Join Date
    Jan 2007
    Location
    South Africa
    Posts
    830

    Resolved Re: OleDbCommand.Prepare method requires all variable length parameters to have an expl

    Thank you

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