| | |
how to retrive data from different Ms Access tables using ASP
Please support our ASP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jan 2007
Posts: 21
Reputation:
Solved Threads: 0
hi
i have a problem if any one can help me please. i have 2 tables in Access database- Drug_Name and Chemistry. i have to retrive the from DB to the ASP. the Drug_Name has Drug_ID, D_name, Synonyms as the fields. once the user write a name it should check to the Drug_Name with the Synonyms fields and then with help of Drug_ID it should retrive D_name from Drug_Name table and other fields from Chemistry table.....
the code i used is :-
here only the html codes works but ASP codes dont work
i believe that SQL query is correct must be retrival ASP code is not correct
plz help
thanks
neha
i have a problem if any one can help me please. i have 2 tables in Access database- Drug_Name and Chemistry. i have to retrive the from DB to the ASP. the Drug_Name has Drug_ID, D_name, Synonyms as the fields. once the user write a name it should check to the Drug_Name with the Synonyms fields and then with help of Drug_ID it should retrive D_name from Drug_Name table and other fields from Chemistry table.....
the code i used is :-
ASP Syntax (Toggle Plain Text)
<HTML> <BODY> <% Actionvar=Request.QueryString("actionvar") strURL = Request.ServerVariables("URL") strSearch = Request.form("search") %> <p>Search our sample db by first or last name. (% returns all)</p> <form action="<%= strURL %>" method="post"> <input type = "text" name="search" size = "30" value="<%= strSearch %>" /> <input type="submit" /> </form> <% If strSearch <> "" Then Set conn = server.createobject("adodb.connection") DSNtemp = "DRIVER={Microsoft Access Driver (*.mdb)}; " DSNtemp=dsntemp & "DBQ=" & server.mappath("Databases/nprcDrugsDB.mdb") conn.Open DSNtemp strSQL= "SELECT * FROM Drug_Name, Chemistry WHERE Drug_Name.Drug_ID = Chemistry.Drug_ID And Drug_Namerequest.form("search")Search, "'", "''") & "'" response.write sql & "<br>" & vbNewLine set rstSearch = conn.execute(strSQL) %> <table border="1"> <tr> <th>Name</th> <th>Salts</th> </tr> <% Do While Not rstSearch.EOF %> <tr> <td><%= rstSearch.Fields("D_Name").Value %></td> <td><%= rstSearch.Fields("S").Value %></td> </tr> <% rstSearch.MoveNext Loop %> </table> <% rstSearch.Close conn.Close Set conn = nothing End If %> </BODY> </HTML>
here only the html codes works but ASP codes dont work
i believe that SQL query is correct must be retrival ASP code is not correct
plz help
thanks
neha
Hi neha,
Can you show the right code?
retrieving data from two databases... i'm also in a way to display like that.... can you help me out in this regards.??
Can you show the right code?
retrieving data from two databases... i'm also in a way to display like that.... can you help me out in this regards.??
![]() |
Similar Threads
- retrive data from different tables of Ms access (ASP)
- retrive data from different tables of Ms access (ASP)
- Using Visual Fox Pro data tables in asp.net application (ASP.NET)
Other Threads in the ASP Forum
- Previous Thread: How can i display my search result data in tabular form?
- Next Thread: permission denied error
| Thread Tools | Search this Thread |
archive asp asp.net aspandmssqlserver2005 aspandmssqlserver2005connection aspconnection connection database databaseconnection dreamweaver excel fso iis msmsql mssql2005 mssqlserver2005 mssqlserver2005andasp mssqlserverandasp opentextfile record searchbox selectoption single specfic sqlserver sqlserverconnection windows7





