Microsoft Access Data Access Page, qeury, and web browser... how do I use the 3 together??
-
How do I get a query (I have a macro that will run it) to display in the microsoft web browser (activex control) that I have on my data access page? I want my users to be able to click on a command button (which will run the query), and see the information displayed below in the same window.
-
Answer:
You really need to writ the entire thing using ASP. The data can still exist within Microsoft Access Database. To do it within Access itsef would be more complex. First, you need to understand how to create a connection string to your database. You can find that information here: http://www.carlprothman.net/Default.aspx?tabid=81 Then you would need to write some code to parse the database and return the results to the page, there are some good examples of ASP at: http://www.asp101.com/samples/ basically you would display a form on the screen that checks the field and returns the results accordingly. Example of a go to web page url code: <% strSite = Request.Form("Site") If strSite <> "" Then Set MyDb = CreateObject("ADODB.Connection") strConn = "<put your access adodb connection string here>" MyDb.Open strConn Set MyRec = CreateObject("ADODB.Recordset") strSQL = "SELECT URL FROM tblWebSites WHERE Site = '" & strSite & "'" MyRec.Open strSQL, MyDb If Not MyRec.EOF Then strURL = MyRec("URL") Else strURL = "" End If MyRec.Close Set MyRec = Nothing MyDb.Close Set MyDb = Nothing If strURL <> "" Then Response.Redirect strURL Else Response.Write "<form method='post' name='postme'>" Response.Write "<table border='1' cellpadding='2' cellspacing='2'>" Response.Write "<tr valign='top'>" Response.Write "<td align='right'><b>Pick A Site</b></td>" Response.Write "<td><select size='1' name='Site' onchange='postme.submit();'>" Response.Write "<option value=''>Pick One</option>" Set MyDb = CreateObject("ADODB.Connection") strConn = "<put your access adodb connection string here>" MyDb.Open strConn Set MyRec = CreateObject("ADODB.Recordset") strSQL = "SELECT Site FROM tblWebSites order by Site" MyRec.Open strSQL, MyDb While Not MyRec.EOF Response.Write "<option value='" & MyRec("Site") & "'>" & MyRec("Site") & "</option>" MyRec.MoveNext Wend MyRec.Close Set MyRec = Nothing MyDb.Close Set MyDb = Nothing Response.Write "</select></td></tr></table></form>" End If %> This querys the table and returns the url for a specific site and redirects user to that site.
kendraan... at Yahoo! Answers Visit the source
Related Q & A:
- How can I use real time social data from Datasift and perform real time analytics on it?Best solution by Quora
- How do I use Microsoft Word to open a Google Drive cloud document?Best solution by Quora
- How do I use my web cam for instant messaging?Best solution by Yahoo! Answers
- How do I use Microsoft Outlook Express?Best solution by eHow old
- How do I use my xbox 360 controller on Fallout 3 for the PC?Best solution by ChaCha
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.