Solved

ADO Simple  SEEK Problem

Posted on 2002-04-28
3
180 Views
Last Modified: 2010-05-02
Still having a simple problem with SEEK>>>>>>

Set db = OpenDatabase("c:\accounting\accounting.mdb")
    Set td = db.OpenRecordset("TheData", dbOpenTable)
    Set td2 = db.OpenRecordset("DataUnique", dbOpenTable)
    Set td3 = db.OpenRecordset("Results", dbOpenTable)
    td3.Index = "MainKey"
 
    td3.Seek "=", #3/11/2002#, "RR", 2
--------------------This Works**--------------------------
    DIM Vd as date
    vd=date ' for the sake of this question

    Dim lookd As String  
    lookd = "#" & Format(vd, "mm/dd/yyyy") & "#"    
    td3.Seek "=", lookd, "RR", 2
---------------------This does not work-----------------
If i put a message box and look at lookd, it looks ok.

RUN TIME ERROR 3421   DATA CONVERSION ERROR

?? How do you pass a set of parameters, both dates,char,numeric to seek.???
0
Comment
Question by:turnermich
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 6

Accepted Solution

by:
xSinbad earned 50 total points
ID: 6975810
You could try and convert lookd to a string first with Cstr() as I belive that seeks requires a string as the argument I think.

td3.Seek "=", Cstr(lookd), "RR", 2
0
 
LVL 45

Expert Comment

by:aikimark
ID: 6975849
define lookd as Date instead of String
0
 

Author Comment

by:turnermich
ID: 6976232
I have played around with cstr...  and now have it working.

Appreciate the help.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question