By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,060 Members | 1,204 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,060 IT Pros & Developers. It's quick & easy.

Use field on web page as MS Access input parameter

P: 1
I need to convert a data element from a web page table into an MS Access input parameter and then run another MS Access query.

I have an ASP web page that generates an MS Access query and creates a table on a webpage. This code generates the field1 value on the original table.
Expand|Select|Wrap|Line Numbers
  1. If Request.querystring("mode") = "table1" then userID = Clng(Session("userID"))
  2.      Set rsViewProfile = Server.CreateObject("ADODB.Recordset")  
  3.      strSQL = "SELECT [username], [field1], [field2], [field3], [ID] FROM table1 WHERE ID=" & UserID
  4.      rsViewProfile.Open strSQL, adoCon
  6. Do While Not rsViewProfile.EOF 
  7. Response.Write (rsViewProfile("username"))
  9.     Response.Write ("</center></td><td><center><a href='detail.asp?mode=specificinfo'")
  10.     Response.Write (rsViewProfile("field1"))
  11.     Response.Write (">")
  12.     Response.Write (rsViewProfile("field1"))    
  14.     Response.Write ("</center></td><td><center>")
  15.     Response.Write (rsViewProfile("field2"))    
  17.     Response.Write ("</center></td><td><center>")
  18.     Response.Write (rsViewProfile("field3"))        
  19.     Response.Write ("</center></td></tr>")
  21. rsViewProfile.MoveNext
  22.     Loop
  23.     Response.Write ("</table>")
  24.     Set rsViewProfile = Nothing
  25.     Set adoCon = Nothing
  26. End If
I now need to take this field1 table element, convert it to a MS Access input parameter and run a new MS Access query.
Expand|Select|Wrap|Line Numbers
  1. strSQL = "SELECT [username], [field1], [field2], [field3], [ID] FROM table WHERE ID=" & UserID AND (((field1)= [@field1]))
In other words, I'm drilling down into the data. The first table creates a list of the customer's businesses. I want to click on the name of one of those businesses to generate a table with details for that specific business.

Any help, sample code would be greatly, greatly appreciated!!
Nov 7 '09 #1
Share this Question
Share on Google+
1 Reply

Expert 100+
P: 432
You should be able to just?

Expand|Select|Wrap|Line Numbers
  1. Response.Write ("</center></td><td><center><a href='detail.asp?mode=specificinfo&fieldLookup=rsViewProfile("field1")'")
Then on the detail.asp page take the value of fieldLookup for your sql string
Nov 20 '09 #2

Post your reply

Sign in to post your reply or Sign up for a free account.