开发者

Visual basic 6.0 to visual foxpro database error.?

I am making a form for report through vb and data base is foxpro, i want to view details any two date between values but the error is apper MISSING OPERAND my all the format in dtpicker and foxpro database date format is mm/dd/yy, but it still show same error,Pl开发者_StackOverflow中文版z help me code is below thanx

Private Sub Command1_Click()
Dim str As String
Dim con As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim cmd As New ADODB.Command

con.Open ("Provider=vfpoledb.1;Data Source=.\B042011.dbf")
cmd.ActiveConnection = con

Dim st As String
cmd.CommandText = "select B042011.t_amt from B042011 where B042011.t_trn_dt>=#" & DTPicker1.Value & "# And B042011.t_trn_dt <=#" & DTPicker2.Value & "#"

Set rs = cmd.Execute
rs.MoveFirst
While Not rs.EOF = True
   Combo1.AddItem (rs.Fields("t_amt").Value)
   rs.MoveNext
Wend
End Sub


try this

"select B042011.t_amt from B042011 where B042011.t_trn_dt> = CONVERT( _utf8 '" &   dtpicker1.value & "'USING latin1 ) And B042011.t_trn_dt< =CONVERT( _utf8'" & DTPicker2.Value & "'"

im not that sure but that's what i did and it works..,

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜