Access Query from VB6

Here is the query generated by VB which is being sent through to Access 2003. Can somebody please tell me what I am doing wrong here. If I paste this into the query window of Access it works, but use it in VB6 to query the database and it doesn't work!!

SELECT Country.Country, Customer.Customer, Bit_Manufacturer.Manufacturer, [Bit Make].Type, DirectionalCompany.DirectionalCompany, DriveSystem.DriveSystem, Motor.MotorType, BitRun.BlockNumber, BitRun.SectionNumber, BitRun.WellName, BitRun.Operator, BitRun.RunDate, BitRun.Performance, BitRun.Size, BitRun.SerialNumber, BitRun.InnerDull, BitRun.OuterDull, BitRun.IADCDullCondition, BitRun.ReasonPulled, BitRun.MDIn, BitRun.MDOut, BitRun.TVDIn, BitRun.TVDOut, BitRun.WOB, BitRun.RPM, BitRun.FootageDrilled, BitRun.RunHours, BitRun.ROP, BitRun.InclIn, BitRun.InclOut, BitRun.AzIn, BitRun.AzOut, BitRun.Krevs, BitRun.Torque, BitRun.PumpPressure, MudType.MudType, BitRun.MudWeight, BitRun.FlowRate, BitRun.BitTFA, BitRun.Formation, BitRun.DrillersComments FROM (((((((BitRun INNER JOIN Customer ON BitRun.customerid = Customer.customerid) INNER JOIN Bit_Manufacturer ON BitRun.BitManufacturerid = Bit_Manufacturer.BitManufacturerid) INNER JOIN [Bit Make] ON BitRun.BitMakeID = [Bit Make].BitMakeID) INNER JOIN DirectionalCompany
ON BitRun.DirectionalCompanyID = DirectionalCompany.DirectionalCompanyID) INNER JOIN DriveSystem ON BitRun.DriveSystemID = DriveSystem.DriveSystemID) INNER JOIN Motor ON BitRun.MotorID = Motor.MotorID) INNER JOIN Country ON BitRun.CountryID = Country.CountryID) INNER JOIN MudType ON BitRun.MudTypeID = MudType.MudTypeID WHERE BitRun.Performance NOT LIKE 'Poor' AND BitRun.CountryID = 21 AND BitRun.Size = 8.5;

Things used to be clear and simple - until I started coding!!

Comments

  • : Here is the query generated by VB which is being sent through to
    : Access 2003. Can somebody please tell me what I am doing wrong here.
    : If I paste this into the query window of Access it works, but use it
    : in VB6 to query the database and it doesn't work!!
    :
    : SELECT Country.Country, Customer.Customer,
    : Bit_Manufacturer.Manufacturer, [Bit Make].Type,
    : DirectionalCompany.DirectionalCompany, DriveSystem.DriveSystem,
    : Motor.MotorType, BitRun.BlockNumber, BitRun.SectionNumber,
    : BitRun.WellName, BitRun.Operator, BitRun.RunDate,
    : BitRun.Performance, BitRun.Size, BitRun.SerialNumber,
    : BitRun.InnerDull, BitRun.OuterDull, BitRun.IADCDullCondition,
    : BitRun.ReasonPulled, BitRun.MDIn, BitRun.MDOut, BitRun.TVDIn,
    : BitRun.TVDOut, BitRun.WOB, BitRun.RPM, BitRun.FootageDrilled,
    : BitRun.RunHours, BitRun.ROP, BitRun.InclIn, BitRun.InclOut,
    : BitRun.AzIn, BitRun.AzOut, BitRun.Krevs, BitRun.Torque,
    : BitRun.PumpPressure, MudType.MudType, BitRun.MudWeight,
    : BitRun.FlowRate, BitRun.BitTFA, BitRun.Formation,
    : BitRun.DrillersComments FROM (((((((BitRun INNER JOIN Customer ON
    : BitRun.customerid = Customer.customerid) INNER JOIN Bit_Manufacturer
    : ON BitRun.BitManufacturerid = Bit_Manufacturer.BitManufacturerid)
    : INNER JOIN [Bit Make] ON BitRun.BitMakeID = [Bit Make].BitMakeID)
    : INNER JOIN DirectionalCompany
    : ON BitRun.DirectionalCompanyID =
    : DirectionalCompany.DirectionalCompanyID) INNER JOIN DriveSystem ON
    : BitRun.DriveSystemID = DriveSystem.DriveSystemID) INNER JOIN Motor
    : ON BitRun.MotorID = Motor.MotorID) INNER JOIN Country ON
    : BitRun.CountryID = Country.CountryID) INNER JOIN MudType ON
    : BitRun.MudTypeID = MudType.MudTypeID WHERE BitRun.Performance NOT
    : LIKE 'Poor' AND BitRun.CountryID = 21 AND BitRun.Size = 8.5;
    :
    : Things used to be clear and simple - until I started coding!!

    Can u include the error generated by the vb.
    I'm the best there is,
    the best there was,
    and the best there ever will be.
    hahahahaha lolz :)
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion