---
title: "Kan någon lösa detta?"
type: "forum-thread"
url: "https://www.webforum.nu/amne/asp/5785-kan-någon-lösa-detta"
topic: "ASP"
topic_url: "https://www.webforum.nu/amne/asp"
author: "tapani"
published: "2000-06-05T14:32:00.000Z"
updated: "2000-06-05T14:36:00.000Z"
replies: 1
views: 160
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/asp/5785-kan-någon-lösa-detta"
---

# Kan någon lösa detta?

## #1 — tapani, 2000-06-05T14:32Z

Har en sida där man fyller i kunduppgifter. Men om jag inte fyller i ett fält så får jag ett felmeddelande.
\--------------------------
Field 'Contacts.Title' cannot be a zero-length string. 
\---------------------------

Här är koden:

\<!--#include virtual="/ha/adovbs.inc"--\>
\<%

	Set Connect = CreateObject("ADODB.Connection")
	Connect.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=I:\\Inetpub\\cgi-bin\\ha\\contact.mdb")
	Set RecSet = CreateObject("ADODB.RecordSet")
	Addera = "SELECT \* FROM Contacts"

	RecSet.Open Addera, Connect, adOpenStatic, adLockOptimistic

	RecSet.AddNew

	RecSet("FirstName") = Request.Form("firstname")
	RecSet("Company") = Request.Form("company")
	RecSet("LastName") = Request.Form("lastname")
	RecSet("MiddleName") = Request.Form("middlename")
	RecSet("HomeStreetAddress") = Request.Form("homestreetaddress")
	RecSet("NickName") = Request.Form("nickname")
	RecSet("HomeZipCode") = Request.Form("homezipcode")
	RecSet("WorkStreetAddress") = Request.Form("workstreetaddress")
	RecSet("HomeCity") = Request.Form("homecity")
	RecSet("WorkZipCode") = Request.Form("workzipcode")
	RecSet("HomeCountry") = Request.Form("homecountry")
	RecSet("WorkCity") = Request.Form("workcity")
	RecSet("HomePhone") = Request.Form("homephone")
	RecSet("WorkCountry") = Request.Form("workcountry")
	RecSet("WorkPhone") = Request.Form("workphone")
	RecSet("WorkFax") = Request.Form("workfax")
	RecSet("EmailAddress") = Request.Form("Emailaddress")
	RecSet("JobTitle") = Request.Form("jobtitle")
	RecSet("Department") = Request.Form("department")
	RecSet("Office") = Request.Form("office")
	RecSet("When") = Request.Form("when")
	RecSet("Title") = Request.Form("title")
	RecSet("BusinessFax") = Request.Form("businessfax")
	RecSet("Workpager") = Request.Form("workpager")
	RecSet("Notes") = Request.Form("notes")
	

	RecSet.Update						
	RecSet.Close
	Connect.Close
%\>

Har en känsla av att det kan bero på filen adovbs.inc ?????

Permalänk: https://www.webforum.nu/p/5785

## #2 — Vide, 2000-06-05T14:36Z

Har du inte satt databasfältet Title så att den inte kan ta emot null då?

Tycker det ser ut som det utifrån den kod du angivit...

Permalänk: https://www.webforum.nu/p/243420

---

Tråden på webben: https://www.webforum.nu/amne/asp/5785-kan-någon-lösa-detta
