SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseSQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old May 8th, 2002, 03:25 PM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
form to db insert problem

<i><b>Originally posted by : DC (dcleslie@partners.org)</b></i><br />I'm getting a:<br />Error Type:<br />Microsoft JET Database Engine (0x80004005)<br />Field 'Drugs.DrugInteraction' cannot be a zero-length string.<br />/begasp/drugsheets/confirm_insert.asp, line 21<br /><br />error when inserting into an access database from a form. <br />can anyone help?? <br />I've posted the code below:<br /><br /><br />form page:<br /><br /><!-- #include file="connect.asp" --> <br /><br /><br /><html><br /><head><br /><title>Insert Drug Into Drug Database</title><br /><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><br /></head><br /><br /><body bgcolor="#FFFFFF" text="#000000"><br /><p align="center"><font color="#660099" size="+2" face="Trebuchet MS>Insert Drug <br /> </font></p><br /><p align="center"><font color="#660099" size="2" face="Trebuchet MS><i><font size="3">into <br /> drug information database</font></i></font> </p><br /><form name="insertdrug" method="post" action="confirm_insert.asp"><br /> <table><br /> <tr> <br /> <td width="179" height="44"><b><font face="Trebuchet MS size="2">Short <br /> Drug Name: </font></b></td><br /> <td width="573" height="44"> <br /> <input type="text" name="DrugSheets" size="50"><br /> </td><br /> </tr><br /> <tr> <br /> <td width="179" height="44"><b><font face="Trebuchet MS size="2">Medical <br /> Drug Name: </font></b></td><br /> <td width="573" height="44"> <br /> <input type="text" name="DrugName" size="50"><br /> </td><br /> </tr><br /> <tr> <br /> <td width="179" height="81"><b><font face="Trebuchet MS size="2">Method <br /> Given:</font></b></td><br /> <td width="573" height="81"> <br /> <textarea name="MethodGiven" cols="50" rows="2"></textarea><br /> </td><br /> </tr><br /> <tr> <br /> <td width="179" height="92"><b><font face="Trebuchet MS size="2">Purpose <br /> of Drug: </font></b></td><br /> <td width="573" height="92"> <br /> <textarea name="Purpose" cols="50" rows="3"></textarea><br /> </td><br /> </tr><br /> <tr> <br /> <td width="179" height="94"><b><font face="Trebuchet MS size="2">Possible <br /> Side Effects: </font></b></td><br /> <td width="573" height="94"> <br /> <textarea name="PossibleEffects" cols="50" rows="3"></textarea><br /> </td><br /> </tr><br /> <tr> <br /> <td width="179" height="92"><b><font face="Trebuchet MS size="2">Early <br /> Side Effects: </font></b></td><br /> <td width="573" height="92"> <br /> <textarea name="EarlyEffects" cols="50" rows="3"></textarea><br /> </td><br /> </tr><br /> <tr> <br /> <td width="179" height="92"><b><font face="Trebuchet MS size="2">Late Side <br /> Effects: </font></b></td><br /> <td width="573" height="92"> <br /> <textarea name="LateEffects" cols="50" rows="3"></textarea><br /> </td><br /> </tr><br /> <tr> <br /> <td width="179" height="96"><b><font face="Trebuchet MS size="2">Special <br /> Points to Consider: </font></b></td><br /> <td width="573" height="96"> <br /> <textarea name="Points" cols="50" rows="3"></textarea><br /> </td><br /> </tr><br /> <tr> <br /> <td width="179"><b><font face="Trebuchet MS size="2">Drug Interactions: <br /> </font></b></td><br /> <td width="573"> <br /> <textarea name="DrugInteractions" cols="50" rows="3"></textarea><br /> </td><br /> </tr><br /> <tr> </tr><br /> </table><br /><br /><input type="submit" name="Submit" value="Insert Drug><br /><input type="reset" name="Reset" value="Clear Form><br /></form><br /></body><br /></html><br /><br />confirm_insert.asp page:<br /><%@ Language = "VBScript"%><br /><%<br /><br />dim conn<br />dim strconn<br />dim strsql<br /><br />strsql = ""<br /><br />strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" & _<br /> "Data Source=C:datastoresdrugsheets.mdb;" & _<br /> "Persist Security Info=False"<br /><br /><br />strSQL = "INSERT INTO Drugs(DrugSheets, DrugName, MethodGiven, Purpose, PossibleEffects, EarlyEffects, LateEffects, Points, DrugInteraction) Values('" & request("DrugSheets") & "', '" & request("DrugName") & "', '" & request("MethodGiven") & "', '" & request("Purpose") & "', '" & request("PossibleEffects") & "', '" & request("EarlyEffects") & "', '" & request("LateEffects") & "', '" & request("Points") & "', '" & request("DrugInteraction") & "')"<br /><br /><br />set conn = server.createobject("adodb.connection")<br />conn.open strconn<br /><br />conn.execute(strSQL)<br />conn.close<br />set conn = nothing<br />%><br /><html><head><br /><title>Confirmation of Insert</title><br /></head><br /><br /><body bgcolor="#FFFFFF"><br /><p align="center"><font color="#660099" size="+2" face="Trebuchet MS>Confirmation <br /> of Insert</font></p><br /><p align="center"><font color="#660099" size="2" face="Trebuchet MS><i><font size="3">into <br /> drug information database</font></i></font> </p><br /><p> <br /> <% = "Your record has been added" %><br /></p><br /></body><br /></html><br />

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseSQL Development > form to db insert problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway