Solved

ADO Simple  SEEK Problem

Posted on 2002-04-28
3
175 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
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

746 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now