OK so the way it all looks I have a working Update Query but I someone told me I need an Array to hold the values and thats why I'm getting the message message no varialbel for requird parimeter? Is this true and how you write an array? Here is what I have..
Thank You Guus and llkHous for all your help for guiding me this far...
Can someone please dear ASP / ACCESS Gods help me finish getting this working I have no hair left LOL
Actual Hard Code:
Code:
'**** Line 1 through Line 20
'Declare counter varibles
dim x
dim truerecordcount
dim rsrecordcount
'Delcare array to build buttons in listview
dim RsRecordArray
dim RsArray(5)
'Count the records
CountRecords()
'Declare array to hold one record
redim RsRecordArray(rsrecordcount)
'Declare MDB varibles to use
dim rs
dim sql
dim testsql
'testsql = "Test Message"
'Declare Counter Varibles to use with if, for loops
dim i
dim j
'Declare our button variables
dim DetectedButton
dim DetectedEditButton
dim DetectedDeleteButton
'Declare variables to detect which edit button was clicked
dim RecordButton
' LINE 25 Through 28
if Request.Form("ManuallyRetryMatchingRequests") <> "" then
DetectedButton = Request.Form("ManuallyRetryMatchingRequests")
end if
'COUPLE 1000 LINES OF CODE
' LAST QUERY ON PAGE LINE 2571 thru 2622
' Manually Retry Matching Request
if DetectedButton = "Manually Retry Matching Requests" then
'Prep the database to be accessed
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open(Server.Mappath("/MYDBPATH.mdb"))
set rs = Server.CreateObject("ADODB.recordset")
'Format the Query to use against the database
SQL = "UPDATE tbl_Customers SET "
SQL = SQL & "tbl_Customers.[ServiceMatchedTo] = tbl_Service_Providers.[ServiceProviderID], "
SQL = SQL & "tbl_Customers.[MatchedDate] = '" & NOW() & "', "
SQL = SQL & "tbl_Customers.[Matched] = '-1' "
SQL = SQL & "WHERE tbl_Customers.[Matched] LIKE '0' AND "
SQL = SQL & "tbl_Customers.[ZipCode] LIKE '% tbl_Service_Providers.[CoverageArea] %' AND "
SQL = SQL & "tbl_Customers.[ServiceType] LIKE '% tbl_Service_Providers.[Services_Provided]%'"
'Now read the record into the array
'i = 0
for i = 0 to 18
'each x in rs.Fields
RsRecordArray(i) = ""
next
' rs.Open sql, conn
Response.Write(sql)
%>
<table border="1" width="100%">
<tr>
<td width="50%" height="25">find this table and put your custom code
in its place</td>
<td width="50%" height="25"> </td>
</tr>
<tr>
<td width="50%" height="25"> </td>
<td width="50%" height="25"> </td>
</tr>
</table>
<%
end if
%>
Output of Code:
Code:
UPDATE tbl_Customers SET tbl_Customers.[ServiceMatchedTo] = tbl_Service_Providers.[ServiceProviderID], tbl_Customers.[MatchedDate] = '2/3/2010 7:55:25 PM', tbl_Customers.[Matched] = '-1' WHERE tbl_Customers.[Matched] LIKE '0' AND tbl_Customers.[ZipCode] LIKE '% tbl_Service_Providers.[CoverageArea] %' AND tbl_Customers.[ServiceType] LIKE '% tbl_Service_Providers.[Services_Provided]%