Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Importing data from Excel to Access using VB6

Importing data from Excel to Access using VB6

Scheduled Pinned Locked Moved Visual Basic
databasehelp
2 Posts 2 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 787399
    wrote on last edited by
    #1

    Hello everyone, I am working on a module that involves querying from a .csv file in VB6. The problem that I am facing is with the Date/Time datatype. I have to compare the dates but it is being converted by the driver into text data type when the column is retrieved due to which the comparison cannot be made very accurately. I want to know if there is some way by means of which I can convert the datatype of the column obtained from the .csv file from text to Date/Time. Something like the toChar function in PL/SQL would be usefull. I am facing the same data type conversion problem when I tried to import the data into an Access table and tried to query it. Please send a response to this as early as possible. I need it urgently. Thanks Sathya

    R 1 Reply Last reply
    0
    • U User 787399

      Hello everyone, I am working on a module that involves querying from a .csv file in VB6. The problem that I am facing is with the Date/Time datatype. I have to compare the dates but it is being converted by the driver into text data type when the column is retrieved due to which the comparison cannot be made very accurately. I want to know if there is some way by means of which I can convert the datatype of the column obtained from the .csv file from text to Date/Time. Something like the toChar function in PL/SQL would be usefull. I am facing the same data type conversion problem when I tried to import the data into an Access table and tried to query it. Please send a response to this as early as possible. I need it urgently. Thanks Sathya

      R Offline
      R Offline
      Roger Stewart
      wrote on last edited by
      #2

      Try using CDate() to convert text to a date data type.

      Dim t As String
      Dim d As Date
      
      t = "January 23, 2004 7:45 AM"
      
      d = **CDate**(t)
      
      MsgBox d
      

      Roger Stewart "I Owe, I Owe, it's off to work I go..."

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups