|
rdouglass -> RE: Batch Update One Table from Another Table (7/14/2005 15:13:03)
|
Without knowing all the specifics, I can only guess at this. Maybe something like: <% DIM myDSN, mySQL, myArray, conntemp, rstemp myDSN ="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.Mappath("/fpdb/myDatabase.mdb") mySQL = "SELECT DISTINCT EventID, TitleCode FROM CourseTitle" set conntemp=server.createobject("adodb.connection") conntemp.open myDSN set rstemp=conntemp.execute(mySQL) IF rstemp.eof THEN response.write ("ERROR 127:No Data in :" & mySQL) rstemp.close set rstemp=nothing conntemp.close set conntemp=nothing response.end ELSE myArray=rstemp.getrows rstemp.close set rstemp=nothing FOR i = 0 TO ubound(myArray,2) mySQL = "UPDATE Registration SET TitleCode = '" & myArray(1,i) & "' WHERE EventID = " & myArray(0,i) conntemp.execute(mySQL) NEXT conntemp.close set conntemp=nothing END IF %> You'll need to change the name of myDatabase.mdb to match yours. This is assuming your DB is in the fpdb folder and the registration table is named "Registration". Also, I did not test the syntax and I'm assuming that the field TitleCode is text. That help any?
|
|
|
|