This is a discussion on "Need help" within the Databases section. This forum, and the thread "Need help are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Need help
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
Need help
Hello.
I am tryng to connect to an SQL database... in the page,it has to filter by "month and year" i am getting the error '800a0bb9' Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another. It points to line 23...i will show the code... if someone can help me,i'll thank a lot <% caminho=left(Server.mappath(Request.ServerVariable s("PATH_INFO")),InstrRev(Server.mappath(Request.Se rverVariables("PATH_INFO")),"\")) Dim ObjDB Set ObjDB = Server.CreateObject("ADODB.Connection") ObjDB.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&caminho&"relatorio\banco.mdb" if request.form("mes") <> "" AND request.Form("ano") <> "" then SQL = "SELECT banco.nome,banco.telefone,banco.mail,banco.dataabe rtura,banco.horaabertura,banco.datafechamento,banc o.horafechamento FROM chamado WHERE dataabertura = #"&month(mes) & "" &year(ano)&"# order by cod desc" Response.Write("Nao foi possivel completar sua requisicao") Response.End end if Set rsinf = Server.CreateObject("ADODB.Recordset") rsinf.Open SQL, ObjDB ,adOpenStatic, adLockOptimistic, acCdmText(THIS IS THE LINE 23) %> Thanks. |
|
|
|
|||
|
You can't make a valid date with just a month and year, a valid date will also have a day.
But you probably want everything for that month, not just on a specific day so you'll need to use some date functions in SQL to compare the month and year. So
|
![]() |
| Tags |
| help |
| Thread Tools | |
|
|