Re: record not displaying in between particular date
- From: "Ralph" <nt_consulting64@xxxxxxxxx>
- Date: Fri, 12 Jan 2007 21:12:58 -0600
"bitu" <bitu@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:72C4C2CF-4513-498C-8DBA-4AA24AC8B789@xxxxxxxxxxxxxxxx
hello,march
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
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.Connectioncdate(zfrom)
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
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
.
- Follow-Ups:
- Prev by Date: Re: VBA Command don't recognize Error Trapping
- Next by Date: Re: VB6 Change all records in specific table
- Previous by thread: Requery Method
- Next by thread: Re: record not displaying in between particular date
- Index(es):
Relevant Pages
|
Loading