ERRO DATA REPORT

MAICONLS 08/07/2005 11:44:10
#92907
Estou usando o código abaixo para carregar um data report só que esta me gerando o seguinte erro:

Run Time error -2147217904
nENHUM VALOR FOI FORNECIDO PARA UM OU MAIS PARÓ¡METROS NESCESSàRIOS...

O codigo que estou usando é este:

Private Sub Image2_Click()

If txtdatainicial.Text = "" Then
MsgBox "Informe a data inicial", vbInformation, " Atenção!"
txtdatainicial.SetFocus
Exit Sub

ElseIf Len(txtdatainicial.Text) < 8 Then
MsgBox "Data inicial inválida", vbInformation, " Atenção!"
txtdatainicial.Text = ""
txtdatainicial.SetFocus
Exit Sub

ElseIf txtdatafinal.Text = "" Then
MsgBox "Informe a data final", vbInformation, " Atenção!"
txtdatafinal.SetFocus
Exit Sub

ElseIf Len(txtdatafinal.Text) < 8 Then
MsgBox "Data final inválida", vbInformation, " Atenção!"
txtdatafinal.Text = ""
txtdatafinal.SetFocus
Exit Sub

ElseIf CDate(txtdatainicial.Text) > CDate(txtdatafinal.Text) Then
MsgBox "A data final tem que ser igual ou superior a data inicial", vbInformation, " Atenção!"
txtdatafinal.Text = ""
txtdatafinal.SetFocus
Exit Sub

Else

Set Cnn = New ADODB.Connection
Set Rs = New ADODB.Recordset

Cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:    riade\Data\dbase.mdb;Jet OLEDB:Database Password=tmonrsr2308sbnu;"
Set Rs = Cnn.Execute("Select * from TabClientes where Nascimento >= #" & Format(txtdatainicial.Text, "mm / dd / yyyy") & "# and Data <= #" & Format(txtdatafinal.Text, " mm / dd / yyyy") & " #")
Set RelAniverssarios.DataSource = Rs
RelAniverssarios.Show
End If

End Sub
JEAN.JEDSON 08/07/2005 11:48:25
#92909
não utilize espaços no format:
vc colocou: "dd / mm / yyyy"

use:
"dd/mm/yyy"
MAICONLS 08/07/2005 11:54:07
#92913
Tirei os espaços mais não adiantou..Gera o mesmo erro...
JEAN.JEDSON 08/07/2005 13:07:24
#92927
faça assim:
antes de fazer o recordset, coloque:
msgbox "Select * from TabClientes where Nascimento >= #" & Format(txtdatainicial.Text, "mm/dd/yyyy") & "# and Data <= #" & Format(txtdatafinal.Text, "mm/dd/yyyy") & " #"

ou então tente assim
"SELECT * FROM TabClientes WHERE Nascimento BETWEEN '" & Format(txtdatainicial.Text, "mm/dd/yyyy") & "' AND '" & Format(txtdatafinal.Text, "mm/dd/yyyy")
Tópico encerrado , respostas não são mais permitidas