I am creating an ASP object that will recieve a table, a field for the table and the search text. I already have "edit objects" created for each table in my DB. what i need is a way to submit the page to the specific edit object - based on the table that the user selects. The user will submit his search which would call the search form, wich in turn would query the DB then submit the record found to the relavant edit object. The only thing the user sees is the edit form, the search and submit must be done in the background.
So here is where I'm stuck.
Here i should be writing some code to auto submit the ID of the record to MH_Edit. Can someone help please.
So here is where I'm stuck.
Code:
<%
Dim myTable=request.querystring("Table")
Dim myField=request.querystring("Field")
Dim mySchTxt=request.querystring("schTxt")
'-- Create object and open database
Set DataConnection = Server.CreateObject("ADODB.Connection")
DataConnection.Open ("Provider=Microsoft.Jet.OLEDB.4.0; Data Source="& Server.MapPath("/DMS/ISDAssetsDatabase3_be.mdb"))
Set cmdDC = Server.CreateObject("ADODB.Command")
cmdDC.ActiveConnection = DataConnection
'-- default SQL
SQL = "SELECT * FROM myTable"
'-- RecordToEdit SQL
If mySchTxt <> "" Then
SQL = "SELECT myTable.myfield, myTable.* FROM myTable WHERE (((myTable.myfield)=" & myScrTxt & "));"
End If
cmdDC.CommandText = SQL
Set RecordSet = Server.CreateObject("ADODB.Recordset")
if myTable= "[Maintenance History]" Then
Comment