Closed Thread Icon

Topic awaiting preservation: Sort of Funny problem (ASP) (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=12997" title="Pages that link to Topic awaiting preservation: Sort of Funny problem (ASP) (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: Sort of Funny problem (ASP) <span class="small">(Page 1 of 1)</span>\

 
Hiroki
Paranoid (IV) Inmate

From: NZ
Insane since: Dec 2002

posted posted 11-21-2003 06:25

Hi, how are you?
I am having a really funny serious problem.
I am just trying to get a value of record, which is WineryID from database.
I always get wrong data. I don't know why.
I did like:

code:
<%
''''''''''''''''''''''''''''''''''''''''''''''''''
'Setting up connection and recordset
''''''''''''''''''''''''''''''''''''''''''''''''''
Set conn = Server.CreateObject("ADODB.Connection")
conn.Provider = "Microsoft.Jet.OLEDB.4.0"
conn.Open(Server.mappath("../../db/wine.mdb"))
Set rs = Server.CreateObject("ADODB.Recordset")
sql = "SELECT * FROM Wine_Winery"
rs.Open sql, conn
%>
<h2>Add New Wine to Winery</h2>
<form method="post" action="Add_wine_to_winery2.asp">
<table>

<%
''''''''''''''''''''''''''''''''''''''''
'Here try to get WineryID into table
''''''''''''''''''''''''''''''''''''''''

For Each x in rs.Fields %>
<%If x.name="WineryID" Then%>
<tr>
<td><%=x.name%>:</td>
<td><%=x.value%></td>
</tr>
<%End If
Next%>
</table>

This is a part of code. Filed name appers fine. It says WineryID. But the value itself is totally wrong. Pick up wrong number. What kind of things do I have to check?? Thanks.



Hiroki Kozai

rickindy
Nervous Wreck (II) Inmate

From: Indianapolis, In USA
Insane since: Jan 2002

posted posted 11-21-2003 13:59

Hiroki, when you first started coming to the forum, you at least made an effort to find the solution to the problem before posting.
Now you expect everybody to write your code for you.

Have you looked in the database to make sure that the data you think is there is actually there?

Use the Access tool to test queries before using them in your pages. If they work in the Access tool at least you will know that the query is correct. Otherwise, you could be just guessing for a long time.


Few problems in life can't be solved by chocolate

« BackwardsOnwards »

Show Forum Drop Down Menu