Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2003
    Location
    Manila, Philippines
    Posts
    17

    Unanswered: Problem with query with dates

    hi i was just wondering if there was a problem with the date type of mysql coz i have experienced a problem with my query that returned no recordset in vb6 but when i typed the same query in mysql the result set that i expected is displayed normally, I think it is about the date type coz when i remove the columns one by one hoping to find some clue, when i have removed the date type it displayed normally.

    Does anyone have a work around for this or have experienced it and solved it.

    thanks

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    if it works fine in mysql but not in vb6, then it isn't a mysql problem, is it



    moving thread to VB forum
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Jun 2004
    Location
    Arizona, USA
    Posts
    1,848
    It would help if you show us the code you use to connect to the server and to retrieve the hecordset. Otherwise, we'll just be trying to guess what you're doing.
    Lou
    使大吃一惊
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert


  4. #4
    Join Date
    Dec 2003
    Location
    Manila, Philippines
    Posts
    17
    thanks

    here is my connection

    Code:
    Provider=MSDASQL.1;Persist Security Info=False;Data Source=Library_LOCAL;Extended Properties="DATABASE=lp_opac2006;DESCRIPTION=MySQL ODBC 3.51 Driver DSN;DSN=Library_LOCAL;OPTION=3;PORT=3306;SERVER=localhost;UID=root"
    here is the structure of my table

    CREATE TABLE `tbllibmaterialitem` (
    `LibMaterialItem_Id` int(11) NOT NULL auto_increment,
    `LibMaterial_id` int(11) NOT NULL default '0',
    `Accession_No` int(11) NOT NULL default '0',
    `Status` int(4) default '0',
    `Prefix` varchar(10) default NULL,
    `Purchase_Price` double NOT NULL default '0',
    `Current_Price` double NOT NULL default '0',
    `Date_Purchased` date NOT NULL default '0000-00-00',
    `Serial` varchar(20) NOT NULL,
    `Volume` varchar(20) NOT NULL,
    `BookStatus_Id` int(11) NOT NULL default '1',
    PRIMARY KEY (`LibMaterialItem_Id`),
    KEY `IX_tblLibMaterialItem` (`LibMaterial_id`,`Accession_No`,`Prefix`)
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1
    here is my query that works
    Code:
    SELECT BookStatus_Id, Accession_No, Prefix, Current_Price, Purchase_Price, Serial, Volume FROM tbllibmaterialitem WHERE LibMaterialItem_Id=23

    and here is the one that doesn't
    Code:
    SELECT BookStatus_Id, Date_Purchased, Accession_No, Prefix, Current_Price, Purchase_Price, Serial, Volume FROM tbllibmaterialitem WHERE LibMaterialItem_Id=23

  5. #5
    Join Date
    May 2006
    Posts
    18

Posting Permissions

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