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: 24
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





 Free IT White Papers!
 
Create the Optimal Architecture for your Critical Applications
Warburton's the largest independently owned bakery in the UK faced a number of difficult challenges in providing the most robust yet efficient IT infrastructure for their organization's success. IBM's services combined with their xSeries servers created the perfect platform for their SAP environment with sufficient flexibility, and did so in very time effective fashion.

 
Five Best Practices for Deploying a Successful Service-Oriented Architecture
This white paper describes the benefits you can expect with SOA, and how IBM can help take your business there.

 
Gartner Magic Quadrant for Application Delivery Controllers
Gartner summarizes its view on Application Delivery Controllers, evaluates strengths and weaknesses of solutions, and provides Magic Quadrant reporting for a quick comparison across all vendors. Learn from Gartner how you can benefit from an all-in-one device like Citrix NetScaler that delivers the highest levels of availability, performance and security.

 
Knowledge is Power
What you don't know can hurt you, and is likely costing you money and increasing your security risks during an era of scarce resources. This white paper proposes six key strategies that enterprise security managers can use to improve their network defense posture.

 
Rationalizing the Multi-Tool Environment
The rationalized multi-tool approach is flexible, scalable and cost effective. It provides the necessary input to the IT service management business processes. It preserves prior investments in monitoring tools, empowers technologists to select the best tools with which to do their jobs, and enhances effective response to incidents.

 

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





© 2003-2010 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek