J
Jen
Hello. I have a sql statement that should get all the records that match a
specific criteria; every record are assigned a textvalue like 12_2006 (as
for example this particular month, december 2006). I also have a drop-down
menu on this page where to filter which month should be shown on the page
based on these (text)values by request.querystring.
The problem is that (I guess) the value passed by the request.querystring
are of wrong format to the textfield in the table. Anyway, the error I get
is:
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Syntax error in query expression
'12_2006 = 12_2006'.
Here's the sql code:
<%
Dim rs_fakturalista__manad_ar
rs_fakturalista__manad_ar = month(now) & "_" & year(now)
If (request.querystring("manad_ar") <> "") Then
rs_fakturalista__manad_ar = request.querystring("manad_ar")
End If
%>
<%
Dim rs_fakturalista
Dim rs_fakturalista_numRows
Set rs_fakturalista = Server.CreateObject("ADODB.Recordset")
rs_fakturalista.ActiveConnection = MM_conn_test_STRING
rs_fakturalista.Source = "SELECT * FROM faktura WHERE " +
Replace(rs_fakturalista__manad_ar, "'", "''") + " = " +
Replace(rs_fakturalista__manad_ar, "'", "''") + ""
rs_fakturalista.CursorType = 0
rs_fakturalista.CursorLocation = 2
rs_fakturalista.LockType = 1
rs_fakturalista.Open()
rs_fakturalista_numRows = 0
%>
I tried to dim rs_fakturalista__manad_ar as string but then I get
Expected end of statement
Anybody could help me with this?
specific criteria; every record are assigned a textvalue like 12_2006 (as
for example this particular month, december 2006). I also have a drop-down
menu on this page where to filter which month should be shown on the page
based on these (text)values by request.querystring.
The problem is that (I guess) the value passed by the request.querystring
are of wrong format to the textfield in the table. Anyway, the error I get
is:
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Syntax error in query expression
'12_2006 = 12_2006'.
Here's the sql code:
<%
Dim rs_fakturalista__manad_ar
rs_fakturalista__manad_ar = month(now) & "_" & year(now)
If (request.querystring("manad_ar") <> "") Then
rs_fakturalista__manad_ar = request.querystring("manad_ar")
End If
%>
<%
Dim rs_fakturalista
Dim rs_fakturalista_numRows
Set rs_fakturalista = Server.CreateObject("ADODB.Recordset")
rs_fakturalista.ActiveConnection = MM_conn_test_STRING
rs_fakturalista.Source = "SELECT * FROM faktura WHERE " +
Replace(rs_fakturalista__manad_ar, "'", "''") + " = " +
Replace(rs_fakturalista__manad_ar, "'", "''") + ""
rs_fakturalista.CursorType = 0
rs_fakturalista.CursorLocation = 2
rs_fakturalista.LockType = 1
rs_fakturalista.Open()
rs_fakturalista_numRows = 0
%>
I tried to dim rs_fakturalista__manad_ar as string but then I get
Expected end of statement
Anybody could help me with this?