Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

inserting into access using wap & asp

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi!

Does anybody know how to insert into microsoft access using wap and asp. I can query a database using the above, but Im having problems inserting simple numbers. Heres the code I have written to try to do it. It compiles with no errors, but it doesent do the insert. Id appreciate any help as Im on a tight deadline! thanks in advance, tom

tomack@altavista.net

<% Response.ContentType = &quot;text/vnd.wap.wml&quot; %>
<?xml version=&quot;1.0&quot;?>
<!DOCTYPE wml PUBLIC &quot;-//WAPFORUM//DTD WML 1.1//EN&quot; &quot;<wml>
<%
Dim conn, rs
Set conn = Server.CreateObject(&quot;ADODB.Connection&quot;)
Set rs = Server.CreateObject(&quot;ADODB.Recordset&quot;)
conn.open &quot;DRIVER={Microsoft Access Driver (*.mdb)};DBQ=&quot; & Server.MapPath(&quot;medical.mdb&quot;) & &quot;;&quot;
SearchStr = Request.QueryString(&quot;center_number&quot;)
if SearchStr=&quot;&quot; then
%>
<card id=&quot;Fill_out&quot; title=&quot;Fill out&quot;>
<p>
Please Enter the center number <input name=&quot;center_number&quot; type=&quot;text&quot; maxlength=&quot;8&quot; />
<do type=&quot;accept&quot; label=&quot;Insert&quot;>
<go href=&quot;medicalquestionnaire.asp#card2&quot; method=&quot;post&quot;>
<postfield name=&quot;center_number&quot; value=&quot;$center_number&quot; />
</go>
</do>
</p>
</card>
<%
else
sqlInsert = &quot;INSERT INTO medicaltable1 (center_number) &quot; & &quot;VALUES ('&quot; & center_number & &quot;')&quot;

conn.Execute(SQLinsert)
%>

<% sqlQuery = &quot;SELECT * FROM center_number WHERE center_number LIKE '%&quot; & SearchSTR & &quot;%'&quot;
Set rs = conn.Execute(SQLquery)
%>

<card id=&quot;card2&quot; title=&quot;Result&quot;>
<p>

<%
if rs.EOF then
Response.Write &quot;<do type='accept' label='Back'>&quot;
Response.Write &quot; <go href='madical1.asp' method='get'>&quot;
Response.Write &quot; <postfield name='center_number value=' &quot; & Session(&quot;center_number&quot;) & &quot;' />&quot;
Response.Write &quot; </go>&quot;
Response.Write &quot; </do>&quot;
Response.Write &quot;<strong>Your center id has been entered</strong>&quot;
Response.Write &quot; <select name='center_number'>&quot;
While not rs.EOF
Response.Write &quot;<option value='&quot; & rs(&quot;center_number&quot;) & &quot; is your center number&quot; & &quot;</option>&quot;
rs.Movenext
Wend
Response.Write &quot;</select>&quot;
else
Response.Write &quot;Sorry! There was a problem with your entry&quot;
end if
%>
</p>
</card>
<%
end if
%>
</wml>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top