Re: record not displaying in between particular date




"bitu" <bitu@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:72C4C2CF-4513-498C-8DBA-4AA24AC8B789@xxxxxxxxxxxxxxxx
hello,
i am doing a project on zodiac sign.when we enter day and month the zodiac
sign should get displayed accordingly. eg. when we select 23rd march the
zodiac sign aries should get displayed because it comes in between 20th
march
and 20th april.now the problem is that when i enter the date between 3rd
april and 9th april i get the error message-"either bof or eof is true or
records are deleted". leaving this days rest all the days the zodiac sign
will get displayed properly.i am using backend as access and front end is
VB.i have used dtpicker control and the coding is as follows:-

--------------------------------------------------------------------------
-------------
dim cn as new ADODB.Connection
dim rs as new ADODB.Recordset

Set cn = New ADODB.Connection
Set rs = New ADODB.Recordset
Dim zd

zd = DTPicker1.Value


cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=zodiac.mdb;Persist
Security Info=False"

rs.Open "select name from zodiacsign where '" & zd & "' between
cdate(zfrom)
and cdate(zto)", cn, adOpenDynamic, adLockOptimistic

text1.text=rs(0)
--------------------------------------------------------------------------
------------
where name is the zodiac name field and zfrom and zto is the startdate and
enddate between which the zodiac sign comes.

pls help me.

thank u

arpana

Do some simple Debug.Print on the variables zd, zfrom, and zto, and your
open string. You probably aren't getting the results expected and may have
to use Format().

Also use the date-delimiters '#' within your sql statement.

hth
-ralph


.



Relevant Pages

  • Re: record not displaying between particular date
    ... Dim StartDate as String ... Dim SqlStr as String ... i am doing a project on zodiac sign.when we enter day and month the zodiac ... problem between 3rd and 9th date.it won't select or display the record when i ...
    (microsoft.public.vb.database.ado)
  • Re: record not displaying in between particular date
    ... but the same error comes that eof or bof is true or current record is ... i am doing a project on zodiac sign.when we enter day and month the zodiac ... dim rs as new ADODB.Recordset ...
    (microsoft.public.vb.database.ado)
  • Re: record not displaying between particular date
    ... i am doing a project on zodiac sign.when we enter day and month the zodiac ... problem between 3rd and 9th date.it won't select or display the record when i ... dim cn as new ADODB.Connection ...
    (microsoft.public.vb.database.ado)

Loading