Created
September 28, 2023 14:06
-
-
Save evagoras/91e8d85256bd36ac6a881c2fcf86e5f8 to your computer and use it in GitHub Desktop.
Calling MS Access Parameterized Queries from ASP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
strQuery = "faq_qry_sub_categories '" & numCategoryID & "', '" & secondparam & "'" | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
Dim numCategoryID | |
numCategoryID = Request.Form("CategoryID") | |
Set objConn = Server.CreateObject("ADODB.Connection") | |
objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("/faqs.mdb") | |
Set objRS = Server.CreateObject("ADODB.Recordset") | |
strQuery = "faq_qry_sub_categories '" & numCategoryID & "'" | |
objRS.Open strQuery, objConn, 0, 4 | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% | |
Dim objConn | |
Dim objRS | |
Dim strSQL | |
Dim numCategoryID | |
numCategoryID = Request.Form("CategoryID") | |
Set objConn = Server.CreateObject("ADODB.Connection") | |
objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("/faqs.mdb") | |
Set objRS = Server.CreateObject("ADODB.Recordset") | |
strQuery = "SELECT faq_category.ID, " _ | |
& "Count(faq_category.name) AS count, " _ | |
& "faq_category.name, faq_category.description "_ | |
& "FROM faq_category " _ | |
& "INNER JOIN faq_faq ON faq_category.ID = faq_faq.category_ID " _ | |
& "GROUP BY faq_category.ID, faq_category.name, " _ | |
& "faq_category.description, faq_category.parentID " _ | |
& "HAVING faq_category.parentID=" & numCategoryID _ | |
& " ORDER BY faq_category.name;" | |
objRS.Open strQuery, objConn, 0, 1 | |
'-- continue with writing your recordset out | |
... | |
%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
Set objConn = Server.CreateObject("ADODB.Connection") | |
objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("/faqs.mdb") | |
Set objRS = Server.CreateObject("ADODB.Recordset") | |
strQuery = "faq_qry_sub_categories" | |
objRS.Open strQuery, objConn, 0, 4 | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://evagoras.com/2011/02/08/calling-ms-access-parameterized-queries-from-asp/