Typeuoverensstemmelse
Hej :-)første gang jeg prøver med ASP og access database.
Jeg prøver at oprette en kunde i DB fra en hjemmeside, men jeg få en grim fejl:
Provider fejl '80020005'
Typeuoverensstemmelse.
/fyp/bookingupdate.asp, linje 72.
Jeg ved det er fordi i databasen har jeg en kolonne der hedder repetitive (client) med to options: ja/nej, mens på siden som er på engelsk står der en option med to værdier: yes/no.
Hvor i koden (vedlagt) skal jeg beskrive denne betingelse og hvordan???
Tak for hjælpen
Susy
<% Option Explicit %>
<!-- #include virtual="common/adovbs.inc" -->
<html>
<body bgcolor="#FFFFFF" vlink=navy>
<!-- #include file="header.inc" --><p>
<%
' The first time this page is retrieved and any time it is
' submitted without being completely filled out, the form
' is displayed. If it is submitted and completely filled out
' the form is processed in the Else clause.
If Request("name")="" Or Request("surname")="" Or _
Request("address")="" Or Request("city")="" Or _
Request("country")="" or Request("repetitive")="" Then
%>
<% ShowHeader "Book your boat" %>
Please fill in all of these fields below.<p>
When you are finished, click the Book button.<p>
<form method="POST" action="bookingupdate.asp">
<table>
<tr><td>Name:</td>
<td><input type="text" size="50" name="name"></td></tr>
<tr><td>Surname:</td>
<td><input type="text" size="50" name="surname"></td></tr>
<tr><td>Address:</td>
<td><input type="text" size="50" name="address"></td></tr>
<tr><td>City:</td>
<td><input type="text" size="50" name="city"></td></tr>
<tr><td>Country:</td>
<td><input type="text" size="50" name="country"></td></tr>
<tr><td>Phone</td>
<td><input type="text" size="15" name="phone"> </td></tr>
<tr><td>Fax</td>
<td><input type="text" size="15" name="fax"> </td></tr>
<tr><td>Email:</td>
<td><input type="text" size="50" name="email"> </td></tr>
<tr><td>Repeted client:</td>
<td> <select name="repetitive" size="1">
<option selected value="ja">YES</option>
<option value="nej">NO</option>
<br><br>
<tr><td><input type="submit" value="Book"></td></tr>
</table>
</form>
<% Else %>
<%
Dim Query, Connect, Classifieds, Place
%>
<%
ShowClient Request("name"),Request("surname"),_
Request("address"),Request("city"), Request("country"),_
Request("phone"),Request("fax"),Request("email"),_
Request("repetitive"),Date
Set Connect = Server.CreateObject("ADODB.Connection")
Connect.Open "booking"
Set Classifieds = Server.CreateObject("ADODB.Recordset")
Classifieds.Open _
"SELECT name, surname, address, city, country, phone, fax, email, repetitive FROM client", _
Connect,adOpenDynamic,adLockOptimistic
Classifieds.AddNew
Classifieds("name") = Request("name")
Classifieds("surname") = Request("surname")
Classifieds("address") = Request("address")
Classifieds("city") = Request("city")
Classifieds("country") = Request("country")
Classifieds("phone") = Request("phone")
Classifieds("fax") = Request("fax")
Classifieds("email") = Request("email")
Classifieds("repetitive") = Request("repetitive")
Classifieds.Update
If Err.Number = 0 Then %>
<font size=5><i>Your booking has been registred.</i></font><p>
<a href="default.asp">Home</a><p>
<% Else %>
There was an error registering your booking.<p>
Error #<%=Err.Number%>: <%=Err.Description%><p>
<% End If %>
<% End If %>
</body>
</html>
